changeset 88288:e664e2e2ae90

(rmail-header-get-header): Accept more arguments and pass them to mail-fetch-field unchanged. Bind inhibit-point-motion-hooks to t.
author Alex Schroeder <alex@gnu.org>
date Mon, 23 Jan 2006 23:19:45 +0000
parents c4875198e277
children 2d481143eb08
files lisp/mail/rmailhdr.el
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmailhdr.el	Mon Jan 23 23:17:58 2006 +0000
+++ b/lisp/mail/rmailhdr.el	Mon Jan 23 23:19:45 2006 +0000
@@ -87,14 +87,20 @@
           (if (re-search-forward (concat "\\(" keyword ",\\|" keyword "$\\)"))
               t)))))
 
-(defun rmail-header-get-header (header)
-  "Return the text value for HEADER, nil if no such header exists.
-The current buffer, possibly narrowed, contains a single message."
+(defun rmail-header-get-header (&rest args)
+  "Return the text value for a header or nil if no such header exists.
+The arguments ARGS are passed to `mail-fetch-field'.  The first
+argument is the header to get.
+
+The current buffer, possibly narrowed, contains a single message.
+Note that it is not necessary to call `rmail-header-show-headers'
+because `inhibit-point-motion-hooks' is locally bound to t."
   (save-excursion
     (save-restriction
-      (let ((limit (rmail-header-get-limit)))
+      (let* ((inhibit-point-motion-hooks t)
+	     (limit (rmail-header-get-limit)))
 	(narrow-to-region (point-min) limit)
-	(mail-fetch-field header)))))
+	(apply 'mail-fetch-field args)))))
 
 (defun rmail-header-get-keywords ()
   "Return the keywords in the current message.