Discussion:
message-citation-line-format - should %F have a fall back?
Adam Sjøgren
2015-02-25 20:34:24 UTC
Permalink
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 <***@example.invalid>".
| %n The mail address, e.g. "***@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 ***@koldfront.dk
whatever solution you've got so far."
Katsumi Yamaoka
2015-02-26 00:41:01 UTC
Permalink
Post by Adam Sjøgren
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.
Adam Sjøgren
2015-02-26 22:38:29 UTC
Permalink
Post by Katsumi Yamaoka
Post by Adam Sjøgren
Should %F in message-citation-line-format fall back to something
different than nil, if no first name can be detected?
--- 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
***@koldfront.dk
Loading...