(exec-path-from-shell-copy-env "SSH_AUTH_SOCK"))
#+end_src
-** Only one custom theme at a time
+** COMMENT Only one custom theme at a time
#+begin_src emacs-lisp
-;; only one custom theme at a time
-;;
-;; (defadvice load-theme (before clear-previous-themes activate)
-;; "Clear existing theme settings instead of layering them"
-;; (mapc #'disable-theme custom-enabled-themes))
+(defadvice load-theme (before clear-previous-themes activate)
+ "Clear existing theme settings instead of layering them"
+ (mapc #'disable-theme custom-enabled-themes))
#+end_src
** Server
:config (or (server-running-p) (server-mode)))
#+end_src
-** Unicode support
+** COMMENT Unicode support
Font stack with better unicode support, around =Ubuntu Mono= and
=Hack=.
#+begin_src emacs-lisp
-;; unicode support
-;;
-;; (dolist (ft (fontset-list))
-;; (set-fontset-font
-;; ft
-;; 'unicode
-;; (font-spec :name "Source Code Pro" :size 14))
-;; (set-fontset-font
-;; ft
-;; 'unicode
-;; (font-spec :name "DejaVu Sans Mono")
-;; nil
-;; 'append)
-;; ;; (set-fontset-font
-;; ;; ft
-;; ;; 'unicode
-;; ;; (font-spec
-;; ;; :name "Symbola monospacified for DejaVu Sans Mono")
-;; ;; nil
-;; ;; 'append)
-;; ;; (set-fontset-font
-;; ;; ft
-;; ;; #x2115 ; ℕ
-;; ;; (font-spec :name "DejaVu Sans Mono")
-;; ;; nil
-;; ;; 'append)
-;; (set-fontset-font
-;; ft
-;; (cons ?Α ?ω)
-;; (font-spec :name "DejaVu Sans Mono" :size 14)
-;; nil
-;; 'prepend))
+(dolist (ft (fontset-list))
+ (set-fontset-font
+ ft
+ 'unicode
+ (font-spec :name "Source Code Pro" :size 14))
+ (set-fontset-font
+ ft
+ 'unicode
+ (font-spec :name "DejaVu Sans Mono")
+ nil
+ 'append)
+ ;; (set-fontset-font
+ ;; ft
+ ;; 'unicode
+ ;; (font-spec
+ ;; :name "Symbola monospacified for DejaVu Sans Mono")
+ ;; nil
+ ;; 'append)
+ ;; (set-fontset-font
+ ;; ft
+ ;; #x2115 ; ℕ
+ ;; (font-spec :name "DejaVu Sans Mono")
+ ;; nil
+ ;; 'append)
+ (set-fontset-font
+ ft
+ (cons ?Α ?ω)
+ (font-spec :name "DejaVu Sans Mono" :size 14)
+ nil
+ 'prepend))
#+end_src
** Gentler font resizing
(winner-mode 1)
#+end_src
-*** Close =*compilation*= on success
+*** Don’t display =*compilation*= on success
+
+Based on https://stackoverflow.com/a/17788551, with changes to use
+=cl-letf= instead of the now obsolete =flet=.
#+begin_src emacs-lisp
-(setq compilation-exit-message-function
- (lambda (status code msg)
- "Close the compilation window if successful."
- ;; if M-x compile exits with 0
- (when (and (eq status 'exit) (zerop code))
- (bury-buffer)
- (delete-window (get-buffer-window (get-buffer "*compilation*"))))
- ;; return the result of compilation-exit-message-function
- (cons msg code)))
+(defun amin--compilation-finish-function (buffer outstr)
+ (unless (string-match "finished" outstr)
+ (switch-to-buffer-other-window buffer))
+ t)
+
+(setq compilation-finish-functions #'amin--compilation-finish-function)
+
+(require 'cl-macs)
+
+(setq ad-redefinition-action 'accept)
+(defadvice compilation-start
+ (around inhibit-display
+ (command &optional mode name-function highlight-regexp))
+ (if (not (string-match "^\\(find\\|grep\\)" command))
+ (cl-letf (((symbol-function 'display-buffer) #'ignore)
+ ((symbol-function 'set-window-point) #'ignore)
+ ((symbol-function 'goto-char) #'ignore))
+ (save-window-excursion ad-do-it))
+ ad-do-it))
+
+(ad-activate 'compilation-start)
#+end_src
*** Search for non-ASCII characters
'(("default"
("dired" (mode . dired-mode))
("org" (mode . org-mode))
+ ("gnus"
+ (or
+ (mode . gnus-group-mode)
+ (mode . gnus-summary-mode)
+ (mode . gnus-article-mode)
+ ;; not really, but...
+ (mode . message-mode)))
("web"
(or
(mode . web-mode)
("shell"
(or
(mode . eshell-mode)
- (mode . shell-mode)))
- ("notmuch" (name . "\*notmuch\*"))
+ (mode . shell-mode)
+ (mode . term-mode)))
("programming"
(or
(mode . python-mode)
+ (mode . c-mode)
(mode . c++-mode)
- (mode . emacs-lisp-mode)))
+ (mode . emacs-lisp-mode)
+ (mode . scheme-mode)
+ (mode . haskell-mode)
+ (mode . lean-mode)))
("emacs"
(or
(name . "^\\*scratch\\*$")
- (name . "^\\*Messages\\*$")))
- ("slack"
- (or
- (name . "^\\*Slack*"))))))
+ (name . "^\\*Messages\\*$"))))))
(ibuffer-formats
'((mark modified read-only locked " "
(name 18 18 :left :elide)
:hook (web-mode css-mode html-mode sgml-mode))
#+end_src
-** Nix
-
-#+begin_src emacs-lisp
-(use-package nix-mode
- :defer t
- :mode "\\.nix\\'")
-#+end_src
-
-** Java
+** COMMENT Java
*** meghanada
-#+begin_src emacs-lisp :tangle no
+#+begin_src emacs-lisp
(use-package meghanada
:bind
(:map meghanada-mode-map
treemacs
#+end_comment
-#+begin_src emacs-lisp :tangle no
+#+begin_src emacs-lisp
(use-package treemacs
:config (setq treemacs-never-persist t))
:after (treemacs))
#+end_src
+** geiser
+
+#+begin_src emacs-lisp
+(use-package geiser)
+
+(use-package geiser-guile
+ :config
+ (setq geiser-guile-load-path "~/src/git/guix"))
+#+end_src
+
+** guix
+
+#+begin_src emacs-lisp
+(use-package guix
+ :load-path "lib/guix/elisp")
+#+end_src
+
* Emacs Enhancements
** [[https://github.com/justbur/emacs-which-key][which-key]]
(load-theme 'tangomod t)
#+end_src
-** doom-modeline
+** smart-mode-line
#+begin_src emacs-lisp
-(use-package doom-modeline
- :demand t
- :config (setq doom-modeline-height 32)
- :hook (after-init . doom-modeline-init))
+(use-package smart-mode-line
+ :config
+ (sml/setup))
#+end_src
** doom-themes
(defun amin/lights-on ()
"Enable my favourite light theme."
(interactive)
- (progn
- (mapc #'disable-theme custom-enabled-themes)
- (load-theme 'tangomod t)))
+ (mapc #'disable-theme custom-enabled-themes)
+ (load-theme 'tangomod t)
+ (sml/apply-theme 'automatic))
(defun amin/lights-off ()
"Go dark."
(interactive)
- (progn
- (mapc #'disable-theme custom-enabled-themes)
- (load-theme 'doom-tomorrow-night t)))
+ (mapc #'disable-theme custom-enabled-themes)
+ (load-theme 'doom-tomorrow-night t)
+ (sml/apply-theme 'automatic))
(bind-keys
("s-t d" . amin/lights-off)
Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
-** [[https://github.com/DarthFennec/highlight-indent-guides][highlight-indent-guides]]
+** COMMENT [[https://github.com/DarthFennec/highlight-indent-guides][highlight-indent-guides]]
#+begin_src emacs-lisp
(use-package highlight-indent-guides
- :disabled t
:defer 3
:hook ((prog-mode . highlight-indent-guides-mode)
;; (org-mode . highlight-indent-guides-mode)
("l" . image-forward-hscroll)))
#+end_src
-** anzu
-
-#+begin_src emacs-lisp
-(use-package anzu)
-#+end_src
-
** typo.el
#+begin_src emacs-lisp
""))))
#+end_src
-** slack
+** COMMENT slack
Hopefully temporary.
#+begin_src emacs-lisp
(use-package slack
- :disabled t
:commands (slack-start)
:init
(eval-when-compile ; silence the byte-compiler
read-mail-command 'gnus)
(use-package gnus
- :bind (("s-m" . gnus)
- ("s-M" . gnus-unplugged))
+ :bind (("C-c m" . gnus)
+ ("C-c M" . gnus-unplugged)
+ ("s-m" . gnus)
+ ("s-M" . gnus-unplugged))
:init
(setq
gnus-select-method '(nnnil "")
(bbdb-initialize 'gnus 'message))
#+end_src
-** message-x
+** COMMENT message-x
#+begin_src emacs-lisp
(use-package message-x
- :disabled t
:custom
(message-x-completion-alist
(quote
. message-expand-group)))))
#+end_src
-** gnus-harvest
+** COMMENT gnus-harvest
#+begin_src emacs-lisp
(use-package gnus-harvest
- :disabled t
:commands gnus-harvest-install
:demand t
:config
(message "Loading %s...done (%.3fs)" user-init-file
(float-time (time-subtract (current-time)
amin--before-user-init-time)))
+(setq ad-redefinition-action 'warn)
#+end_src
* Footer
* COMMENT Local Variables :ARCHIVE:
# Local Variables:
# eval: (add-hook 'after-save-hook #'amin/async-babel-tangle 'append 'local)
+# eval: (typo-mode -1)
# End: