[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master bf43bcb: Fix the message-fetch-field doc string
From: |
Lars Ingebrigtsen |
Subject: |
master bf43bcb: Fix the message-fetch-field doc string |
Date: |
Wed, 2 Dec 2020 05:17:48 -0500 (EST) |
branch: master
commit bf43bcbed81ba0fa4376bcd6568279fa3c519c3a
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Fix the message-fetch-field doc string
* lisp/gnus/message.el (message-fetch-field): Improve the doc
string (bug#44991).
---
lisp/gnus/message.el | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 288ccc4..2ab3eb6 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -2090,14 +2090,21 @@ is used by default."
(goto-char (point-min))
(looking-at message-unix-mail-delimiter))))
-(defun message-fetch-field (header &optional not-all)
- "The same as `mail-fetch-field', only remove all newlines.
+(defun message-fetch-field (header &optional first)
+ "Return the value of the header field named HEADER.
+Continuation lines are folded (i.e., newlines are removed).
Surrounding whitespace is also removed.
+By default, if there's more than one header field named HEADER,
+all the values are returned as one concatenated string, and
+values are comma-separated.
+
+If FIRST is non-nil, only the first value is returned.
+
The buffer is expected to be narrowed to just the header of the message;
see `message-narrow-to-headers-or-head'."
(let* ((inhibit-point-motion-hooks t)
- (value (mail-fetch-field header nil (not not-all))))
+ (value (mail-fetch-field header nil (not first))))
(when value
(while (string-match "\n[\t ]+" value)
(setq value (replace-match " " t t value)))
@@ -2105,12 +2112,12 @@ see `message-narrow-to-headers-or-head'."
;; we have initial or trailing white space; remove it.
(string-trim value))))
-(defun message-field-value (header &optional not-all)
+(defun message-field-value (header &optional first)
"The same as `message-fetch-field', only narrow to the headers first."
(save-excursion
(save-restriction
(message-narrow-to-headers-or-head)
- (message-fetch-field header not-all))))
+ (message-fetch-field header first))))
(defun message-narrow-to-field ()
"Narrow the buffer to the header on the current line."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master bf43bcb: Fix the message-fetch-field doc string,
Lars Ingebrigtsen <=