X-Git-Url: https://git.shemshak.org/gitweb.cgi/~bandali/configs/blobdiff_plain/f1149591ecba2cb36ba9ea47a85fd1d12b5701db..21ad71fa7e98449ed407035a632dc3199a355e22:/init.org?ds=sidebyside diff --git a/init.org b/init.org index 787d386..ae1a6e6 100644 --- a/init.org +++ b/init.org @@ -345,14 +345,12 @@ in my shell. (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 @@ -371,44 +369,42 @@ See [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.htm :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 @@ -650,18 +646,35 @@ Enable =winner-mode=. (winner-mode 1) #+end_src -*** Close =*compilation*= on success +*** Don’t display =*compilation*= on success + +From https://stackoverflow.com/a/17788551. #+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) + +(defadvice compilation-start + (around inhibit-display + (command &optional mode name-function highlight-regexp)) + (if (not (string-match "^\\(find\\|grep\\)" command)) + (flet ((display-buffer) + (set-window-point) + (goto-char)) + (fset 'display-buffer 'ignore) + (fset 'goto-char 'ignore) + (fset 'set-window-point 'ignore) + (save-window-excursion + ad-do-it)) + ad-do-it)) + +(ad-activate 'compilation-start) #+end_src *** Search for non-ASCII characters @@ -1569,13 +1582,12 @@ Emacs package that displays available keybindings in popup (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 @@ -1590,16 +1602,16 @@ Emacs package that displays available keybindings in popup (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)