emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rmail-message-filter


From: Glenn Morris
Subject: Re: rmail-message-filter
Date: Wed, 04 Mar 2009 17:18:24 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Richard M Stallman wrote:

> In other words, it was called whenever headers were pruned.

If only the documentation was this clear.

"a filter function for new messages"

> The analogous time to call it is whenever rmail-show-message
> displays a message (except when it displays the whole header).

The simple thing would be to call it at the end of rmail-copy-headers,
whenever rmail-header-style is not 'full. However

i) I don't see that this offers anything that rmail-show-message-hook
does not.

ii) This is not exactly the same as the old behaviour, since
previously pruning was not necessarily done every time a message was
shown (if the previous time it was shown it was pruned).

Also, it's documented to behave as:

   Called with region narrowed to the message, including headers,
   before obeying `rmail-ignored-headers'."

To recreate the "before obeying `rmail-ignored-headers'" part would
require something like the following. But it seems dangerous to me to
mess about with the real rmail buffer rather than the "view" copy.

Without knowing what this function was used for, it seems like
rmail-show-message-hook is a better thing to use.

***************
*** 2560,2565 ****
--- 2571,2581 ----
          (message "Showing message %d" msg))
        (narrow-to-region beg end)
        (goto-char beg)
+       (and rmail-message-filter
+            (not (eq rmail-header-style 'full))
+            (let ((inhibit-read-only t))
+              (funcall rmail-message-filter)
+              (goto-char beg)))
        (setq body-start (search-forward "\n\n" nil t))
        (narrow-to-region beg (point))
        (goto-char beg)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]