[emacs] update 9 drones
[~bandali/configs] / init.org
index 7083e9b..9c64204 100644 (file)
--- a/init.org
+++ b/init.org
@@ -419,6 +419,24 @@ Font stack with better unicode support, around =Ubuntu Mono= and
 (setq text-scale-mode-step 1.05)
 #+end_src
 
 (setq text-scale-mode-step 1.05)
 #+end_src
 
+** Focus follows mouse
+
+I’d like focus to follow the mouse when I move the cursor from one
+window to the next.
+
+#+begin_src emacs-lisp
+(setq mouse-autoselect-window t)
+#+end_src
+
+Let’s define a function to conveniently disable this for certain
+buffers and/or modes.
+
+#+begin_src emacs-lisp
+(defun amin--no-mouse-autoselect-window ()
+  (make-local-variable 'mouse-autoselect-window)
+  (setq mouse-autoselect-window nil))
+#+end_src
+
 ** Libraries
 
 #+begin_src emacs-lisp
 ** Libraries
 
 #+begin_src emacs-lisp
@@ -727,10 +745,11 @@ customizing it.
         evil-cross-lines t)
 
   ;; custom mode state mappings
         evil-cross-lines t)
 
   ;; custom mode state mappings
-  (dolist (mspair '((ebdb-mode    . emacs)
-                    (term-mode    . emacs)
-                    (helpful-mode . motion)
-                    (view-mode    . motion)))
+  (dolist (mspair '((ebdb-mode        . emacs)
+                    (term-mode        . emacs)
+                    (helpful-mode     . motion)
+                    (magit-blame-mode . motion)
+                    (view-mode        . motion)))
     (evil-set-initial-state (car mspair) (cdr mspair)))
 
   ;; fix tab and indentation in src blocks inside org-mode buffer
     (evil-set-initial-state (car mspair) (cdr mspair)))
 
   ;; fix tab and indentation in src blocks inside org-mode buffer
@@ -2242,7 +2261,8 @@ For when I /have to/ use GH.
    :map gnus-summary-mode-map
    ("r"   . gnus-summary-reply-with-original)
    ("R"   . gnus-summary-wide-reply-with-original)
    :map gnus-summary-mode-map
    ("r"   . gnus-summary-reply-with-original)
    ("R"   . gnus-summary-wide-reply-with-original)
-   ("M-L" . org-store-link)))
+   ("M-L" . org-store-link))
+  :hook (gnus-summary-mode . amin--no-mouse-autoselect-window))
 
 (use-package gnus-msg
   :config
 
 (use-package gnus-msg
   :config
@@ -2250,19 +2270,16 @@ For when I /have to/ use GH.
         '((".*"
            (address "amin@aminb.org")
            (body "\nBest,\namin\n")
         '((".*"
            (address "amin@aminb.org")
            (body "\nBest,\namin\n")
-           (signature-file "~/.signature-amin")
            (eval (setq amin--message-cite-say-hi t)))
           ("gnu.*"
            (eval (setq amin--message-cite-say-hi t)))
           ("gnu.*"
-           (address "bandali@gnu.org")
-           (signature-file nil))
+           (address "bandali@gnu.org"))
           ((header "subject" "ThankCRM")
            (to "webmasters-comment@gnu.org")
            (body "\nAdded  to 2018supporters.html.\n\nMoving to campaigns.\n\n-amin\n")
            (eval (setq amin--message-cite-say-hi nil)))
           ("nnimap\\+uwaterloo:.*"
            (address "abandali@uwaterloo.ca")
           ((header "subject" "ThankCRM")
            (to "webmasters-comment@gnu.org")
            (body "\nAdded  to 2018supporters.html.\n\nMoving to campaigns.\n\n-amin\n")
            (eval (setq amin--message-cite-say-hi nil)))
           ("nnimap\\+uwaterloo:.*"
            (address "abandali@uwaterloo.ca")
-           (gcc "\"nnimap+uwaterloo:Sent Items\"")
-           (signature-file nil)))))
+           (gcc "\"nnimap+uwaterloo:Sent Items\"")))))
 
 (use-package gnus-topic
   :hook (gnus-group-mode . gnus-topic-mode))
 
 (use-package gnus-topic
   :hook (gnus-group-mode . gnus-topic-mode))