# HG changeset patch # User Alex Schroeder # Date 1138058385 0 # Node ID e664e2e2ae900b4700eb47060bb4a9c6ece89762 # Parent c4875198e2771bcdb929b3d8bb2eadbec85d8bf3 (rmail-header-get-header): Accept more arguments and pass them to mail-fetch-field unchanged. Bind inhibit-point-motion-hooks to t. diff -r c4875198e277 -r e664e2e2ae90 lisp/mail/rmailhdr.el --- 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.