diff options
author | Amin Bandali <bandali@gnu.org> | 2018-11-12 19:45:08 -0500 |
---|---|---|
committer | Amin Bandali <bandali@gnu.org> | 2018-11-12 19:45:08 -0500 |
commit | 7db2ffd1add1ed1b10f8944a5592a9aa5cc39a0c (patch) | |
tree | 8597ec5bef257d1b1285b43a26053004548474ea | |
parent | 6e9d8a2b6d4b998de8aae4a2b694af3d1dff97db (diff) | |
download | configs-7db2ffd1add1ed1b10f8944a5592a9aa5cc39a0c.tar.gz configs-7db2ffd1add1ed1b10f8944a5592a9aa5cc39a0c.tar.xz configs-7db2ffd1add1ed1b10f8944a5592a9aa5cc39a0c.zip |
[emacs] set up supercite to my liking
-rw-r--r-- | init.org | 63 |
1 files changed, 19 insertions, 44 deletions
@@ -2008,53 +2008,28 @@ Convenient footnotes in =message-mode=. ** supercite -#+begin_src emacs-lisp :tangle no +#+begin_src emacs-lisp (use-package supercite - :commands sc-cite-original + :after message :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 - (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: |