Gnus development mailing list
 help / color / mirror / Atom feed
From: Emanuel Berg <moasen@zoho.com>
To: ding@gnus.org
Subject: Re: citation get name no matter name or e-mail
Date: Sat, 06 Jan 2018 06:33:14 +0100	[thread overview]
Message-ID: <86a7xry2jp.fsf@zoho.com> (raw)
In-Reply-To: <86po6ny2nv.fsf@zoho.com>

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




      reply	other threads:[~2018-01-06  5:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-06  5:30 Emanuel Berg
2018-01-06  5:33 ` Emanuel Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a7xry2jp.fsf@zoho.com \
    --to=moasen@zoho.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).