[emacs] remove magithub
[~bandali/configs] / init.org
index c0cd733..5a163e3 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
@@ -327,8 +327,11 @@ it it's own file. While at it, treat themes as safe.
 
 ** Secrets file
 
+Load the secrets file if it exists, otherwise show a warning.
+
 #+begin_src emacs-lisp
-(load (no-littering-expand-etc-file-name "secrets"))
+(with-demoted-errors
+    (load (no-littering-expand-etc-file-name "secrets")))
 #+end_src
 
 ** Better =$PATH= handling
@@ -416,6 +419,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
@@ -724,9 +745,11 @@ customizing it.
         evil-cross-lines t)
 
   ;; custom mode state mappings
-  (dolist (mspair '((ebdb-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
@@ -794,6 +817,8 @@ customizing it.
   "a"   '(:ignore t :wk "apps")
   "a i" 'ielm
 
+  "a s" '(:ignore t :wk "shells/terms")
+
   "b"   '(:ignore t :wk "buffers")
   "b k" 'kill-this-buffer
   "b s" 'save-buffer
@@ -991,7 +1016,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
@@ -1259,7 +1287,8 @@ TODO: break this giant source block down into individual org sections.
   :config (column-number-mode))
 
 (progn ;    `text-mode'
-  (add-hook 'text-mode-hook #'indicate-buffer-boundaries-left))
+  (add-hook 'text-mode-hook #'indicate-buffer-boundaries-left)
+  (add-hook 'text-mode-hook #'abbrev-mode))
 
 (use-package tramp
   :defer t
@@ -1836,7 +1865,7 @@ Emacs package that displays available keybindings in popup
 #+begin_src emacs-lisp
 (use-package shell-toggle
   :after eshell
-  :general (amin--leader-keys "a s" 'amin/shell-toggle)
+  :general (amin--leader-keys "a s e" 'amin/shell-toggle)
   :bind ("C-c e" . amin/shell-toggle)
   :config
   (defun amin/shell-toggle (make-cd)
@@ -2088,7 +2117,7 @@ Hopefully temporary.
         ""))))
 #+end_src
 
-** magithub
+** COMMENT magithub
 
 For when I /have to/ use GH.
 
@@ -2107,6 +2136,40 @@ For when I /have to/ use GH.
   :after eshell)
 #+end_src
 
+** multi-term
+
+#+begin_src emacs-lisp
+(use-package multi-term
+  :defer 1
+  :general (amin--leader-keys
+             "a s m" 'multi-term
+             "a s p" 'multi-term-dedicated-toggle)
+  :bind ("C-c C-j" . term-line-mode)
+  :config
+  (setq multi-term-program "/bin/screen"
+        ;; TODO: add separate bindings for connecting to existing
+        ;; session vs. always creating a new one
+        multi-term-dedicated-select-after-open-p t
+        multi-term-dedicated-window-height 20
+        multi-term-dedicated-max-window-height 30
+        term-bind-key-alist
+        '(("C-c C-c" . term-interrupt-subjob)
+          ("C-c C-e" . term-send-esc)
+          ("C-k" . kill-line)
+          ("C-y" . term-paste)
+          ("M-f" . term-send-forward-word)
+          ("M-b" . term-send-backward-word)
+          ("M-p" . term-send-up)
+          ("M-n" . term-send-down)
+          ("<C-backspace>" . term-send-backward-kill-word)
+          ("<M-DEL>" . term-send-backward-kill-word)
+          ("M-d" . term-send-delete-word)
+          ("M-," . term-send-raw)
+          ("M-." . comint-dynamic-complete))
+        term-unbind-key-alist
+        '("C-z" "C-x" "C-c" "C-h" "C-y" "<ESC>")))
+#+end_src
+
 * Email
 
 #+begin_src emacs-lisp
@@ -2201,27 +2264,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))
@@ -2274,13 +2335,13 @@ 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)
          (message-mode . (lambda ()
-                           (setq fill-column 65
-                                 message-fill-column 65)
+                           ;; (setq fill-column 65
+                           ;;       message-fill-column 65)
                            (make-local-variable 'company-idle-delay)
                            (setq company-idle-delay 0.2))))
   ;; :custom-face
@@ -2345,9 +2406,10 @@ I tried using =borg-elpa= instead of doing it like this, but it added
   :load-path "lisp/bbdb"
   :init
   (load (expand-file-name "lisp/bbdb/bbdb-autoloads.el" user-emacs-directory))
-  (bbdb-mua-auto-update-init 'message)
-  (setq bbdb-mua-auto-update-p 'query)
-  (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus))
+  ;; (bbdb-mua-auto-update-init 'message)
+  (setq bbdb-mua-auto-update-p 'query
+        bbdb-complete-mail nil)
+  (bbdb-initialize 'gnus 'message))
 #+end_src
 
 ** COMMENT message-x