* gnus-art.el (gnus-sticky-article): Don't perform gnus-configure-windows here;
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 14 Aug 2007 09:02:15 +0000 (09:02 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 14 Aug 2007 09:02:15 +0000 (09:02 +0000)
 reuse existing sticky article buffer.

* gnus-sum.el (gnus-summary-display-article): Setup article buffer if it doesn't
 exist in gnus-article-mode.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-sum.el

index 95f2ba0..99f0e35 100644 (file)
@@ -1,3 +1,13 @@
+2007-08-14  Tassilo Horn  <tassilo@member.fsf.org>
+
+       * gnus-art.el (gnus-sticky-article): Fixed problems described in
+       <b4mps1qitio.fsf@jpl.org> on ding.  Thanks to Katsumi.
+       Don't perform gnus-configure-windows here; reuse existing sticky
+       article buffer.
+
+       * gnus-sum.el (gnus-summary-display-article): Setup article buffer if
+       it doesn't exist in gnus-article-mode.
+
 2007-08-13  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-agent.el (gnus-agent-decoded-group-names): New variable.
 2007-08-13  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-agent.el (gnus-agent-decoded-group-names): New variable.
index 372b66c..da17dd8 100644 (file)
@@ -4371,46 +4371,46 @@ If ALL-HEADERS is non-nil, no headers are hidden."
 
 (defun gnus-sticky-article (arg)
   "Make the current article sticky.
 
 (defun gnus-sticky-article (arg)
   "Make the current article sticky.
-If a prefix ARG is given, ask for a name for this sticky article
-buffer."
+If a prefix ARG is given, ask for a name for this sticky article buffer."
   (interactive "P")
   (interactive "P")
-  (gnus-configure-windows 'article)
   (gnus-summary-show-thread)
   (gnus-summary-select-article nil nil 'pseudo)
   (let (new-art-buf-name)
     (gnus-eval-in-buffer-window gnus-article-buffer
       (setq new-art-buf-name
   (gnus-summary-show-thread)
   (gnus-summary-select-article nil nil 'pseudo)
   (let (new-art-buf-name)
     (gnus-eval-in-buffer-window gnus-article-buffer
       (setq new-art-buf-name
-            (rename-buffer
-             (concat
-              "*Sticky Article: "
-              (if arg
-                  (read-from-minibuffer "Sticky article buffer name: ")
-                (gnus-with-article-headers
-                  (gnus-article-goto-header "subject")
-                  (setq new-art-buf-name
-                        (buffer-substring-no-properties
-                         (line-beginning-position) (line-end-position)))
-                  (goto-char (point-min))
-                  (gnus-article-goto-header "from")
-                  (setq new-art-buf-name
-                        (concat
-                         new-art-buf-name ", "
-                         (buffer-substring-no-properties
-                          (line-beginning-position) (line-end-position))))
-                  (goto-char (point-min))
-                  (gnus-article-goto-header "date")
-                  (setq new-art-buf-name
-                        (concat
-                         new-art-buf-name ", "
-                         (buffer-substring-no-properties
-                          (line-beginning-position) (line-end-position))))))
-              "*")
-             t)))
+           (concat
+            "*Sticky Article: "
+            (if arg
+                (read-from-minibuffer "Sticky article buffer name: ")
+              (gnus-with-article-headers
+                (gnus-article-goto-header "subject")
+                (setq new-art-buf-name
+                      (buffer-substring-no-properties
+                       (line-beginning-position) (line-end-position)))
+                (goto-char (point-min))
+                (gnus-article-goto-header "from")
+                (setq new-art-buf-name
+                      (concat
+                       new-art-buf-name ", "
+                       (buffer-substring-no-properties
+                        (line-beginning-position) (line-end-position))))
+                (goto-char (point-min))
+                (gnus-article-goto-header "date")
+                (setq new-art-buf-name
+                      (concat
+                       new-art-buf-name ", "
+                       (buffer-substring-no-properties
+                        (line-beginning-position) (line-end-position))))))
+            "*"))
+      (if (and (gnus-buffer-live-p new-art-buf-name)
+              (with-current-buffer new-art-buf-name
+                (eq major-mode 'gnus-sticky-article-mode)))
+         (switch-to-buffer new-art-buf-name)
+       (setq new-art-buf-name (rename-buffer new-art-buf-name t)))
+      (gnus-sticky-article-mode))
     (setq gnus-article-buffer new-art-buf-name))
   (gnus-summary-recenter)
     (setq gnus-article-buffer new-art-buf-name))
   (gnus-summary-recenter)
-  (gnus-summary-position-point)
-  (set-buffer gnus-article-buffer)
-  (gnus-sticky-article-mode))
+  (gnus-summary-position-point))
 
 (defun gnus-kill-sticky-article-buffer (&optional buffer)
   "Kill the given sticky article BUFFER.
 
 (defun gnus-kill-sticky-article-buffer (&optional buffer)
   "Kill the given sticky article BUFFER.
index baae58e..a3e2c9a 100644 (file)
@@ -7413,15 +7413,15 @@ Given a prefix, will force an `article' buffer configuration."
 
 (defun gnus-summary-display-article (article &optional all-header)
   "Display ARTICLE in article buffer."
 
 (defun gnus-summary-display-article (article &optional all-header)
   "Display ARTICLE in article buffer."
-  (when (gnus-buffer-live-p gnus-article-buffer)
-    (with-current-buffer gnus-article-buffer
-      (mm-enable-multibyte)))
+  (unless (and (gnus-buffer-live-p gnus-article-buffer)
+              (with-current-buffer gnus-article-buffer
+                (eq major-mode 'gnus-article-mode)))
+    (gnus-article-setup-buffer))
   (gnus-set-global-variables)
   (gnus-set-global-variables)
-  (when (gnus-buffer-live-p gnus-article-buffer)
-    (with-current-buffer gnus-article-buffer
-      (setq gnus-article-charset gnus-newsgroup-charset)
-      (setq gnus-article-ignored-charsets gnus-newsgroup-ignored-charsets)
-      (mm-enable-multibyte)))
+  (with-current-buffer gnus-article-buffer
+    (setq gnus-article-charset gnus-newsgroup-charset)
+    (setq gnus-article-ignored-charsets gnus-newsgroup-ignored-charsets)
+    (mm-enable-multibyte))
   (if (null article)
       nil
     (prog1
   (if (null article)
       nil
     (prog1