[emacs] set up supercite to my liking
[~bandali/configs] / init.org
index 79a97e4..6152f3b 100644 (file)
--- a/init.org
+++ b/init.org
@@ -355,7 +355,7 @@ in my shell.
   (mapc #'disable-theme custom-enabled-themes))
 #+end_src
 
   (mapc #'disable-theme custom-enabled-themes))
 #+end_src
 
-** Server
+** COMMENT Server
 
 Start server if not already running. Alternatively, can be done by
 issuing =emacs --daemon= in the terminal, which can be automated with
 
 Start server if not already running. Alternatively, can be done by
 issuing =emacs --daemon= in the terminal, which can be automated with
@@ -371,7 +371,7 @@ See [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.htm
   :config (or (server-running-p) (server-mode)))
 #+end_src
 
   :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=.
 
 Font stack with better unicode support, around =Ubuntu Mono= and
 =Hack=.
@@ -708,6 +708,7 @@ In short, my favourite way of life.
         org-edit-src-content-indentation 0
         org-email-link-description-format "Email %c: %s" ; %.30s
         org-log-done 'time)
         org-edit-src-content-indentation 0
         org-email-link-description-format "Email %c: %s" ; %.30s
         org-log-done 'time)
+  (add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t)
   :bind (:map org-mode-map ("M-L" . org-insert-last-stored-link))
   :hook ((org-mode . org-indent-mode)
          (org-mode . auto-fill-mode)
   :bind (:map org-mode-map ("M-L" . org-insert-last-stored-link))
   :hook ((org-mode . org-indent-mode)
          (org-mode . auto-fill-mode)
@@ -1517,20 +1518,14 @@ Emacs package that displays available keybindings in popup
   :config (which-key-mode))
 #+end_src
 
   :config (which-key-mode))
 #+end_src
 
-** [[https://github.com/seagle0128/doom-modeline][doom-modeline]]
+** [[https://github.com/Malabarba/smart-mode-line][smart-mode-line]]
 
 #+begin_src emacs-lisp
 
 #+begin_src emacs-lisp
-(use-package doom-modeline
-  :demand t
-  :config (setq doom-modeline-height 32)
-  :hook (after-init . doom-modeline-init))
-#+end_src
-
-** [[https://github.com/maio/eink-emacs][eink-theme]]
-
-#+begin_src emacs-lisp
-(setq doom-modeline-bar-width 5)
-(load-theme 'eink t)
+(use-package smart-mode-line
+  :config
+  (sml/setup)
+  ;; (sml/apply-theme 'light)
+  (remove-hook 'display-time-hook 'sml/propertize-time-string))
 #+end_src
 
 ** [[https://github.com/bbatsov/crux][crux]]
 #+end_src
 
 ** [[https://github.com/bbatsov/crux][crux]]
@@ -1665,7 +1660,7 @@ Make =*scratch*= and =*Messages*= unkillable.
 
 Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
 
 
 Also see [[https://www.emacswiki.org/emacs/rebox2][rebox2]].
 
-** [[https://github.com/DarthFennec/highlight-indent-guides][highlight-indent-guides]]
+** COMMENT [[https://github.com/DarthFennec/highlight-indent-guides][highlight-indent-guides]]                                 :ARCHIVE:
 
 #+begin_src emacs-lisp
 (use-package highlight-indent-guides
 
 #+begin_src emacs-lisp
 (use-package highlight-indent-guides
@@ -1779,6 +1774,58 @@ Hopefully temporary.
   (setq alert-default-style 'notifier))
 #+end_src
 
   (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
+
+For when I /have to/ use GH.
+
+#+begin_src emacs-lisp
+(use-package magithub
+  :after magit
+  :config
+  (magithub-feature-autoinject t)
+  (setq magithub-clone-default-directory "~/src/git"))
+#+end_src
+
 * Email
 
 #+begin_src emacs-lisp
 * Email
 
 #+begin_src emacs-lisp
@@ -1961,53 +2008,28 @@ Convenient footnotes in =message-mode=.
 
 ** supercite
 
 
 ** supercite
 
-#+begin_src emacs-lisp :tangle no
+#+begin_src emacs-lisp
 (use-package supercite
 (use-package supercite
-  :commands sc-cite-original
+  :after message
   :init
   :init
-  (add-hook 'mail-citation-hook 'sc-cite-original)
-
-  (defun sc-remove-existing-signature ()
-    (save-excursion
-      (goto-char (region-beginning))
-      (when (re-search-forward message-signature-separator (region-end) t)
-        (delete-region (match-beginning 0) (region-end)))))
-
-  (add-hook 'mail-citation-hook 'sc-remove-existing-signature)
-
-  (defun sc-remove-if-not-mailing-list ()
-    (unless (assoc "list-id" sc-mail-info)
-      (setq attribution sc-default-attribution
-            citation (concat sc-citation-delimiter
-                             sc-citation-separator))))
-
-  (add-hook 'sc-attribs-postselect-hook 'sc-remove-if-not-mailing-list)
-
+  (setq sc-nested-citation-p t
+        ;; sc-cite-blank-lines-p t
+        sc-citation-leader ""
+        sc-auto-fill-region-p t
+        sc-confirm-always-p nil)
   :config
   :config
-  (defun sc-fill-if-different (&optional prefix)
-    "Fill the region bounded by `sc-fill-begin' and point.
-Only fill if optional PREFIX is different than
-`sc-fill-line-prefix'.  If `sc-auto-fill-region-p' is nil, do not
-fill region.  If PREFIX is not supplied, initialize fill
-variables.  This is useful for a regi `begin' frame-entry."
-    (if (not prefix)
-        (setq sc-fill-line-prefix ""
-              sc-fill-begin (line-beginning-position))
-      (if (and sc-auto-fill-region-p
-               (not (string= prefix sc-fill-line-prefix)))
-          (let ((fill-prefix sc-fill-line-prefix))
-            (unless (or (string= fill-prefix "")
-                        (save-excursion
-                          (goto-char sc-fill-begin)
-                          (or (looking-at ">+  +")
-                              (< (length
-                                  (buffer-substring (point)
-                                                    (line-end-position)))
-                                 65))))
-              (fill-region sc-fill-begin (line-beginning-position)))
-            (setq sc-fill-line-prefix prefix
-                  sc-fill-begin (line-beginning-position)))))
-nil))
+  (defun amin--sc-header ()
+    "Hi <firstname>,\n\n <from> writes:"
+    (let ((sc-mumble "")
+             (whofrom (sc-whofrom)))
+      (if whofrom
+             (insert (sc-hdr "Hi " (sc-mail-field "sc-firstname") ", \n\n")
+                  sc-reference-tag-string
+                         whofrom
+                         " writes:\n"))))
+  (add-to-list 'sc-rewrite-header-list '(amin--sc-header) t)
+  (setq sc-preferred-header-style (1- (length sc-rewrite-header-list)))
+  (add-hook 'mail-citation-hook 'sc-cite-original))
 #+end_src
 
 ** COMMENT gnus-alias                                              :ARCHIVE:
 #+end_src
 
 ** COMMENT gnus-alias                                              :ARCHIVE: