From fe251e620a29818ce529a1b74a51fb070fda09b3 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 19 Nov 2018 10:18:13 -0500 Subject: [PATCH 1/1] [emacs/supercite] use built-in sc-header-author-writes header style --- init.org | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/init.org b/init.org index 0f1e578..73da39d 100644 --- a/init.org +++ b/init.org @@ -2179,20 +2179,32 @@ Convenient footnotes in =message-mode=. ;; sc-cite-blank-lines-p t sc-citation-leader "" sc-reference-tag-string "" + sc-preferred-header-style 5 ; (sc-header-author-writes) sc-auto-fill-region-p nil sc-confirm-always-p nil) :config - (defun amin--sc-header () - "Hi ,\n\n 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))) + ;; (defun amin--sc-header-on-wrote () + ;; "\"On , wrote:\" unless: + ;; 1. the \"sc-author\" field cannot be found, in which case nothing is inserted; + ;; 2. the \"date\" field is missing in which case only the from part is printed." + ;; (let ((sc-mumble "") + ;; (whofrom (sc-whofrom))) + ;; (if whofrom + ;; (insert sc-reference-tag-string + ;; (sc-hdr "On " (sc-mail-field "date") ", ") + ;; (sc-hdr "" (sc-mail-field "sc-author")) " wrote:\n")))) + ;; (defun amin--sc-header () + ;; "Hi ,\n\n 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) + ;; (add-to-list 'sc-rewrite-header-list '(amin--sc-header-on-wrote) t) + ;; (setq sc-preferred-header-style (1- (length sc-rewrite-header-list))) (add-hook 'mail-citation-hook 'sc-cite-original)) #+end_src -- 2.20.1