[emacs] remove unneeded borg-insert-update-message C-c b m binding
[~bandali/configs] / init.org
index 1c69169..7c49ca2 100644 (file)
--- a/init.org
+++ b/init.org
@@ -191,7 +191,7 @@ but for now I've decided to keep them enabled. See documentation for
 
 #+begin_src emacs-lisp
 (setq user-full-name "Amin Bandali"
-      user-mail-address "amin@bandali.me")
+      user-mail-address "amin@aminb.org")
 #+end_src
 
 ** Package management
@@ -244,7 +244,6 @@ can then be managed with the help of Magit or other tools.
    ("C-c b a" . borg-assimilate)
    ("C-c b b" . borg-build)
    ("C-c b c" . borg-clone)
-   ("C-c b m" . borg-insert-update-message)
    ("C-c b r" . borg-remove)))
 #+end_src
 
@@ -419,6 +418,24 @@ Font stack with better unicode support, around =Ubuntu Mono= and
 (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
@@ -727,10 +744,11 @@ customizing it.
         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
@@ -997,7 +1015,10 @@ Not just how I do git, but /the/ way to do git.
 #+begin_src emacs-lisp
 (use-package magit
   :defer 1
-  :general (amin--leader-keys "g s" 'magit-status)
+  :general
+  (amin--leader-keys
+    "g s" 'magit-status
+    "g l" 'magit-log-buffer-file)
   :bind ("s-g" . magit-status)
   :config
   (magit-add-section-hook 'magit-status-sections-hook
@@ -1990,7 +2011,47 @@ Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
   :hook (text-mode . typo-mode))
 #+end_src
 
-** slack
+** hl-todo
+
+#+begin_src emacs-lisp
+(use-package hl-todo
+  :defer 4
+  :config
+  (global-hl-todo-mode))
+#+end_src
+
+** shrink-path
+
+#+begin_src emacs-lisp
+(use-package shrink-path
+  :after eshell
+  :config
+  (setq eshell-prompt-regexp "\\(.*\n\\)*λ "
+        eshell-prompt-function #'+eshell/prompt)
+
+  (defun +eshell/prompt ()
+    (let ((base/dir (shrink-path-prompt default-directory)))
+      (concat (propertize (car base/dir)
+                          'face 'font-lock-comment-face)
+              (propertize (cdr base/dir)
+                          'face 'font-lock-constant-face)
+              (propertize (+eshell--current-git-branch)
+                          'face 'font-lock-function-name-face)
+              "\n"
+              (propertize "λ" 'face 'eshell-prompt-face)
+              ;; needed for the input text to not have prompt face
+              (propertize " " 'face 'default))))
+
+  (defun +eshell--current-git-branch ()
+    (let ((branch (car (loop for match in (split-string (shell-command-to-string "git branch") "\n")
+                             when (string-match "^\*" match)
+                             collect match))))
+      (if (not (eq branch nil))
+          (concat " " (substring branch 2))
+        ""))))
+#+end_src
+
+** COMMENT slack                                                   :ARCHIVE:
 
 Hopefully temporary.
 
@@ -2055,47 +2116,7 @@ Hopefully temporary.
   (setq alert-default-style 'notifier))
 #+end_src
 
-** hl-todo
-
-#+begin_src emacs-lisp
-(use-package hl-todo
-  :defer 4
-  :config
-  (global-hl-todo-mode))
-#+end_src
-
-** shrink-path
-
-#+begin_src emacs-lisp
-(use-package shrink-path
-  :after eshell
-  :config
-  (setq eshell-prompt-regexp "\\(.*\n\\)*λ "
-        eshell-prompt-function #'+eshell/prompt)
-
-  (defun +eshell/prompt ()
-    (let ((base/dir (shrink-path-prompt default-directory)))
-      (concat (propertize (car base/dir)
-                          'face 'font-lock-comment-face)
-              (propertize (cdr base/dir)
-                          'face 'font-lock-constant-face)
-              (propertize (+eshell--current-git-branch)
-                          'face 'font-lock-function-name-face)
-              "\n"
-              (propertize "λ" 'face 'eshell-prompt-face)
-              ;; needed for the input text to not have prompt face
-              (propertize " " 'face 'default))))
-
-  (defun +eshell--current-git-branch ()
-    (let ((branch (car (loop for match in (split-string (shell-command-to-string "git branch") "\n")
-                             when (string-match "^\*" match)
-                             collect match))))
-      (if (not (eq branch nil))
-          (concat " " (substring branch 2))
-        ""))))
-#+end_src
-
-** magithub
+** COMMENT magithub                                                :ARCHIVE:
 
 For when I /have to/ use GH.
 
@@ -2242,27 +2263,25 @@ 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)
-   ("M-L" . org-store-link)))
+   ("M-L" . org-store-link))
+  :hook (gnus-summary-mode . amin--no-mouse-autoselect-window))
 
 (use-package gnus-msg
   :config
   (setq gnus-posting-styles
         '((".*"
-           (address "amin@bandali.me")
+           (address "amin@aminb.org")
            (body "\nBest,\namin\n")
-           (signature-file "~/.signature-amin")
            (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")
-           (gcc "\"nnimap+uwaterloo:Sent Items\"")
-           (signature-file nil)))))
+           (gcc "\"nnimap+uwaterloo:Sent Items\"")))))
 
 (use-package gnus-topic
   :hook (gnus-group-mode . gnus-topic-mode))
@@ -2315,7 +2334,7 @@ For when I /have to/ use GH.
         message-send-mail-function 'message-send-mail-with-sendmail
         message-sendmail-envelope-from 'header
         message-dont-reply-to-names
-        "\\(\\(amin@bandali\\.me\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(aminb?\\|mab\\|bandali\\)@gnu\\.org\\)\\|\\(\\(m\\|a\\(min\\.\\)?\\)bandali@uwaterloo\\.ca\\)\\)"
+        "\\(\\(.*@aminb\\.org\\)\\|\\(amin@bandali\\.me\\)\\|\\(\\(aminb?\\|mab\\|bandali\\)@gnu\\.org\\)\\|\\(\\(m\\|a\\(min\\.\\)?\\)bandali@uwaterloo\\.ca\\)\\)"
         message-user-fqdn "aminb.org")
   :hook (;; (message-setup . mml-secure-message-sign-pgpmime)
          (message-mode . flyspell-mode)