* message-citation-line-format - should %F have a fall back?
@ 2015-02-25 20:34 Adam Sjøgren
2015-02-26 0:41 ` Katsumi Yamaoka
0 siblings, 1 reply; 3+ messages in thread
From: Adam Sjøgren @ 2015-02-25 20:34 UTC (permalink / raw)
To: ding
Should %F in message-citation-line-format fall back to something
different than nil, if no first name can be detected?
Like, say, the email address?
,----[ C-h v message-citation-line-format RET ]
| message-citation-line-format is a variable defined in `message.el'.
| Its value is "%F writes:
| "
| Original value was
| "On %a, %b %d %Y, %N wrote:\n"
|
| Documentation:
| Format of the "Whomever writes:" line.
|
| The string is formatted using `format-spec'. The following constructs
| are replaced:
|
| %f The full From, e.g. "John Doe <john.doe@example.invalid>".
| %n The mail address, e.g. "john.doe@example.invalid".
| %N The real name if present, e.g.: "John Doe", else fall
| back to the mail address.
| %F The first name if present, e.g.: "John".
| %L The last name if present, e.g.: "Doe".
| %Z, %z The time zone in the numeric form, e.g.:"+0000".
|
| All other format specifiers are passed to `format-time-string'
| which is called using the date from the article your replying to, but
| the date in the formatted string will be expressed in the author's
| time zone as much as possible.
| Extracting the first (%F) and last name (%L) is done heuristically,
| so you should always check it yourself.
|
| Please also read the note in the documentation of
| `message-citation-line-function'.
`----
Or is there already some way of doing this? The "you should always check
it yourself" might be implying so?
It is kind of weird to get "nil writes:" when From: is just an email
address...
What do y'all think?
Best regards,
Adam
--
"You have to be optimistic about the possibility of Adam Sjøgren
solving the problem, but skeptical about the value of asjo@koldfront.dk
whatever solution you've got so far."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: message-citation-line-format - should %F have a fall back?
2015-02-25 20:34 message-citation-line-format - should %F have a fall back? Adam Sjøgren
@ 2015-02-26 0:41 ` Katsumi Yamaoka
2015-02-26 22:38 ` Adam Sjøgren
0 siblings, 1 reply; 3+ messages in thread
From: Katsumi Yamaoka @ 2015-02-26 0:41 UTC (permalink / raw)
To: ding
On Wed, 25 Feb 2015 21:34:24 +0100, Adam Sjøgren wrote:
> Should %F in message-citation-line-format fall back to something
> different than nil, if no first name can be detected?
The most corner‐cutting way would be:
--- message.el~ 2015-01-29 02:00:24.303787500 +0000
+++ message.el 2015-02-26 00:40:28.328441100 +0000
@@ -4085,3 +4085,3 @@
(push ?E lst) (push "<E>" lst)
- (push ?F lst) (push fname lst)
+ (push ?F lst) (push (or fname name-or-net) lst)
;; We might want to use "" instead of "<X>" later.
This is what %N does.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: message-citation-line-format - should %F have a fall back?
2015-02-26 0:41 ` Katsumi Yamaoka
@ 2015-02-26 22:38 ` Adam Sjøgren
0 siblings, 0 replies; 3+ messages in thread
From: Adam Sjøgren @ 2015-02-26 22:38 UTC (permalink / raw)
To: ding
Katsumi Yamaoka writes:
> On Wed, 25 Feb 2015 21:34:24 +0100, Adam Sjøgren wrote:
>> Should %F in message-citation-line-format fall back to something
>> different than nil, if no first name can be detected?
> The most corner‐cutting way would be:
> --- message.el~ 2015-01-29 02:00:24.303787500 +0000
> +++ message.el 2015-02-26 00:40:28.328441100 +0000
> @@ -4085,3 +4085,3 @@
> (push ?E lst) (push "<E>" lst)
> - (push ?F lst) (push fname lst)
> + (push ?F lst) (push (or fname name-or-net) lst)
> ;; We might want to use "" instead of "<X>" later.
>
> This is what %N does.
I was testing this:
--- a/lisp/message.el
+++ b/lisp/message.el
@@ -4036,7 +4036,7 @@ See `message-citation-line-format'."
from)
(error nil)))
(name (car data))
- (fname name)
+ (fname-or-net (or name (car (cdr data)) from))
(lname name)
(net (car (cdr data)))
(name-or-net (or (car data)
@@ -4083,7 +4083,7 @@ See `message-citation-line-format'."
(setq fname lname lname newlname)))))
;; The following letters are not used in `format-time-string':
(push ?E lst) (push "<E>" lst)
- (push ?F lst) (push fname lst)
+ (push ?F lst) (push fname-or-net lst)
;; We might want to use "" instead of "<X>" later.
(push ?J lst) (push "<J>" lst)
(push ?K lst) (push "<K>" lst)
I don't know if that is better or worse...
Best regards,
Adam
--
"Apparantly I was misinformed." Adam Sjøgren
asjo@koldfront.dk
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-26 22:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-25 20:34 message-citation-line-format - should %F have a fall back? Adam Sjøgren
2015-02-26 0:41 ` Katsumi Yamaoka
2015-02-26 22:38 ` Adam Sjøgren
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).