gnus-util.el (gnus-message-with-timestamp-1): Add a major-mode for the *Messages...
authorGlenn Morris <rgm@gnu.org>
Tue, 17 Sep 2013 08:21:29 +0000 (08:21 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 17 Sep 2013 08:21:29 +0000 (08:21 +0000)
lisp/ChangeLog
lisp/gnus-util.el

index 70c133a..d8b0a8f 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-17  Glenn Morris  <rgm@gnu.org>
+
+       * gnus-util.el (gnus-message-with-timestamp-1):
+       Use `messages-buffer' function if available.  Ignore read-only.
+
 2013-09-16  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * message.el (message-expand-group, message-completion-in-region):
index 1d2ab2d..4f63f4b 100644 (file)
@@ -514,11 +514,14 @@ but also to the ones displayed in the echo area."
                             (> message-log-max 0)
                             (/= (length str) 0))
                    (setq time (current-time))
-                   (with-current-buffer (get-buffer-create "*Messages*")
+                   (with-current-buffer (if (fboundp 'messages-buffer)
+                                            (messages-buffer)
+                                          (get-buffer-create "*Messages*"))
                      (goto-char (point-max))
-                     (insert ,timestamp str "\n")
-                     (forward-line (- message-log-max))
-                     (delete-region (point-min) (point))
+                     (let ((inhibit-read-only t))
+                       (insert ,timestamp str "\n")
+                       (forward-line (- message-log-max))
+                       (delete-region (point-min) (point)))
                      (goto-char (point-max))))
                  str)
                 (gnus-add-timestamp-to-message