emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Richard M. Stallman
Subject: [Emacs-diffs] emacs/lisp/mail pmailedit.el
Date: Tue, 23 Dec 2008 03:46:03 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       08/12/23 03:46:03

Modified files:
        lisp/mail      : pmailedit.el 

Log message:
        (pmailhdr): Don't require it.
        (pmail-edit-current-message): Don't call pmail-header-show-headers.
        (pmail-cease-edit): Force a blank line at end of edited message.
        Call pmail-set-attribute properly.
        Don't set buffer-read-only.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/pmailedit.el?cvsroot=emacs&r1=1.7&r2=1.8

Patches:
Index: pmailedit.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/pmailedit.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- pmailedit.el        4 Dec 2008 23:14:50 -0000       1.7
+++ pmailedit.el        23 Dec 2008 03:46:03 -0000      1.8
@@ -29,8 +29,6 @@
   (require 'pmail)
   (require 'pmailsum))
 
-(require 'pmailhdr)
-
 (defcustom pmail-edit-mode-hook nil
   "List of functions to call when editing an PMAIL message."
   :type 'hook
@@ -92,7 +90,6 @@
   (setq pmail-old-pruned (eq pmail-header-style 'normal))
   (make-local-variable 'pmail-edit-saved-coding-system)
   (setq pmail-edit-saved-coding-system save-buffer-coding-system)
-  (pmail-header-show-headers)
   (pmail-edit-mode)
   ;; As the local value of save-buffer-coding-system is deleted by
   ;; pmail-edit-mode, we restore the original value.
@@ -115,11 +112,13 @@
       (save-excursion
        (set-buffer pmail-summary-buffer)
        (pmail-summary-enable)))
-  ;; Make sure buffer ends with a newline.
+  ;; Make sure buffer ends with a blank line.
   (save-excursion
     (goto-char (point-max))
     (if (/= (preceding-char) ?\n)
        (insert "\n"))
+    (unless (looking-back "\n\n")
+      (insert "\n"))
     ;; Adjust the marker that points to the end of this message.
     (set-marker (aref pmail-message-vector (1+ pmail-current-message))
                (point)))
@@ -133,11 +132,10 @@
     ;; As the local value of save-buffer-coding-system is changed by
     ;; pmail-variables, we restore the original value.
     (setq save-buffer-coding-system pmail-edit-saved-coding-system)
-    (if (and (= (length old) (- (point-max) (point-min)))
+    (unless (and (= (length old) (- (point-max) (point-min)))
             (string= old (buffer-substring (point-min) (point-max))))
-       ()
       (setq old nil)
-      (pmail-set-attribute "edited" t)
+      (pmail-set-attribute pmail-edited-attr-index t)
       (if (boundp 'pmail-summary-vector)
          (progn
            (aset pmail-summary-vector (1- pmail-current-message) nil)
@@ -153,8 +151,7 @@
     (save-excursion
       (pmail-show-message)
       (pmail-toggle-header (if pmail-old-pruned 1 0))))
-  (run-hooks 'pmail-mode-hook)
-  (setq buffer-read-only t))
+  (run-hooks 'pmail-mode-hook))
 
 (defun pmail-abort-edit ()
   "Abort edit of current message; restore original contents."




reply via email to

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