emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/mail rmail.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp/mail rmail.el
Date: Thu, 29 Jan 2009 14:09:37 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/01/29 14:09:37

Modified files:
        lisp/mail      : rmail.el 

Log message:
        (rmail-toggle-header): Determine current header
        style using the buffer-local value of rmail-header-style in the
        view buffer.
        (rmail-show-message): Set a buffer-local value of
        rmail-header-style in the view buffer.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/rmail.el?cvsroot=emacs&r1=1.478&r2=1.479

Patches:
Index: rmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.478
retrieving revision 1.479
diff -u -b -r1.478 -r1.479
--- rmail.el    29 Jan 2009 03:41:57 -0000      1.478
+++ rmail.el    29 Jan 2009 14:09:36 -0000      1.479
@@ -2358,10 +2358,12 @@
 otherwise, show it in full."
   (interactive "P")
   (let ((rmail-header-style
-        (cond
-         ((and (numberp arg) (> arg 0)) 'normal)
-         ((eq rmail-header-style 'full) 'normal)
-         (t 'full))))
+        (if (numberp arg)
+            (if (> arg 0) 'normal 'full)
+          (with-current-buffer (if (rmail-buffers-swapped-p)
+                                   rmail-view-buffer
+                                 rmail-buffer)
+            (if (eq rmail-header-style 'full) 'normal 'full)))))
     (rmail-show-message-maybe)))
 
 (defun rmail-beginning-of-message ()
@@ -2475,7 +2477,8 @@
 The current mail message becomes the message displayed."
   (let ((mbox-buf rmail-buffer)
        (view-buf rmail-view-buffer)
-       blurb beg end body-start coding-system character-coding is-text-message)
+       blurb beg end body-start coding-system character-coding
+       is-text-message header-style)
     (if (not msg)
        (setq msg rmail-current-message))
     (unless (setq blurb (rmail-no-mail-p))
@@ -2489,6 +2492,7 @@
                   blurb "No following message"))
            (t (setq rmail-current-message msg)))
       (with-current-buffer rmail-buffer
+       (setq header-style rmail-header-style)
        ;; Mark the message as seen, bracket the message in the mail
        ;; buffer and determine the coding system the transfer encoding.
        (rmail-set-attribute rmail-unseen-attr-index nil)
@@ -2510,6 +2514,11 @@
        ;; unibyte temporary buffer where the character decoding takes
        ;; place.
        (with-current-buffer rmail-view-buffer
+         ;; We give the view buffer a buffer-local value of
+         ;; rmail-header-style based on the binding in effect when
+         ;; this function is called; `rmail-toggle-headers' can
+         ;; inspect this value to determine how to toggle.
+         (set (make-local-variable 'rmail-header-style) header-style)
          (erase-buffer))
        (if (null character-coding)
            ;; Do it directly since that is fast.




reply via email to

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