[emacs] update 5 drones
[~bandali/configs] / init.org
index 81c652e..5dacc59 100644 (file)
--- a/init.org
+++ b/init.org
@@ -577,7 +577,8 @@ variable.
 
 #+begin_src emacs-lisp
 (setq backup-by-copying t
-      version-control t)
+      version-control t
+      delete-old-versions t)
 #+end_src
 
 *** Auto revert
@@ -607,6 +608,20 @@ Enable =winner-mode=.
 (winner-mode 1)
 #+end_src
 
+*** Close =*compilation*= on success
+
+#+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)))
+#+end_src
+
 ** Bindings
 
 #+begin_src emacs-lisp
@@ -679,6 +694,9 @@ file.
   (defvar amin-show-async-tangle-time nil
     "Show the time spent tangling the file.")
 
+  (defvar amin-async-tangle-post-compile "make ti"
+    "If non-nil, pass to `compile' after successful tangle.")
+
   (defun amin/async-babel-tangle ()
     "Tangle org file asynchronously."
     (interactive)
@@ -693,13 +711,16 @@ file.
        (unless amin-show-async-tangle-results
          `(lambda (result)
             (if result
-                (message "Tangled %s%s"
-                         ,file-nodir
-                         (if amin-show-async-tangle-time
-                             (format " (%.3fs)"
-                                     (float-time (time-subtract (current-time)
-                                                                ',file-tangle-start-time)))
-                           ""))
+                (progn
+                  (message "Tangled %s%s"
+                           ,file-nodir
+                           (if amin-show-async-tangle-time
+                               (format " (%.3fs)"
+                                       (float-time (time-subtract (current-time)
+                                                                  ',file-tangle-start-time)))
+                             ""))
+                  (when amin-async-tangle-post-compile
+                    (compile amin-async-tangle-post-compile)))
               (message "Tangling %s failed" ,file-nodir))))))))
 
 (add-to-list
@@ -1240,7 +1261,7 @@ Emacs package that displays available keybindings in popup
         '(("*Help*" :align right :select t :size 0.5)
           ("\\`\\*helm.*?\\*\\'" :regexp t :align t)
           ((compilation-mode "\\`\\*magit-diff: .*?\\'") :regexp t :noselect t)
-          ("*magit-dispatch-popup*" :align bottom)
+          ("*magit-dispatch-popup*" :align below)
           ((inferior-scheme-mode "*shell*" "*eshell*") :popup t))
         shackle-default-rule '(:select t)
         shackle-default-size 0.4
@@ -1271,6 +1292,55 @@ Emacs package that displays available keybindings in popup
   (shell-pop-shell-type '("eshell" "*eshell*" (lambda nil (eshell)))))
 #+end_src
 
+** [[https://github.com/EricCrosson/unkillable-scratch][unkillable-scratch]]
+
+Make =*scratch*= and =*Messages*= unkillable.
+
+#+begin_src emacs-lisp
+(use-package unkillable-scratch
+  :config
+  (unkillable-scratch 1)
+  :custom
+  (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")))
+#+end_src
+
+** [[https://github.com/davep/boxquote.el][boxquote.el]]
+
+#+begin_example
+,----
+| make pretty boxed quotes like this
+`----
+#+end_example
+
+#+begin_src emacs-lisp
+(use-package boxquote
+  :bind
+  (:prefix-map amin--boxquote-prefix-map
+   :prefix "C-c q"
+   ("b"   . boxquote-buffer)
+   ("B"   . boxquote-insert-buffer)
+   ("d"   . boxquote-defun)
+   ("F"   . boxquote-insert-file)
+   ("hf"  . boxquote-describe-function)
+   ("hk"  . boxquote-describe-key)
+   ("hv"  . boxquote-describe-variable)
+   ("hw"  . boxquote-where-is)
+   ("k"   . boxquote-kill)
+   ("p"   . boxquote-paragraph)
+   ("q"   . boxquote-boxquote)
+   ("r"   . boxquote-region)
+   ("s"   . boxquote-shell-command)
+   ("t"   . boxquote-text)
+   ("T"   . boxquote-title)
+   ("u"   . boxquote-unbox)
+   ("U"   . boxquote-unbox-region)
+   ("y"   . boxquote-yank)
+   ("M-q" . boxquote-fill-paragraph)
+   ("M-w" . boxquote-kill-ring-save)))
+#+end_src
+
+Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
+
 * Email
 ** [[https://notmuchmail.org][notmuch]]