* citation get name no matter name or e-mail
@ 2018-01-06 5:30 Emanuel Berg
2018-01-06 5:33 ` Emanuel Berg
0 siblings, 1 reply; 2+ messages in thread
From: Emanuel Berg @ 2018-01-06 5:30 UTC (permalink / raw)
To: ding
(defun citation-style-f ()
(let*((from (mail-header-from message-reply-headers))
(from-data (gnus-extract-address-components from))
(name (or (car from-data)
;; if the cited user hasn't set his name
;; use first part of his e-mail
;; e.g., joe@hacker.com -> joe
(car (split-string (cadr from-data) "@"))))
(citation-string (format "%s wrote:" name)) )
(insert citation-string)
(newline 2) ))
(setq message-citation-line-function #'citation-style-f)
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: citation get name no matter name or e-mail
2018-01-06 5:30 citation get name no matter name or e-mail Emanuel Berg
@ 2018-01-06 5:33 ` Emanuel Berg
0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg @ 2018-01-06 5:33 UTC (permalink / raw)
To: ding
Or perhaps better looking:
(defun citation-style-f ()
(let*((from (mail-header-from message-reply-headers))
(from-data (gnus-extract-address-components from))
(name (or (car from-data)
;; if the cited user hasn't set his name
;; use first part of his e-mail
;; e.g., joe@hacker.com -> joe
(car (split-string (cadr from-data) "@"))))
(citation-string (format "%s wrote:\n\n" name)) )
(insert citation-string) ))
(setq message-citation-line-function #'citation-style-f)
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-06 5:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-06 5:30 citation get name no matter name or e-mail Emanuel Berg
2018-01-06 5:33 ` Emanuel Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).