[gnus git] branch master updated: m0-9-88-g2095aa6 =1= gnus-art.el (gnus-mm-display-part): Bugfix for the 2014-02-05 change

Katsumi Yamaoka <[email protected]> Wed, 30 Apr 2014 06:05:21 +0200
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  2095aa688cfe9a35e2b27c15e4226c3206e874fc (commit)
      from  18dc18f512e4bc1a934ac57ceb761de7ed176cff (commit)


- Log -----------------------------------------------------------------
commit 2095aa688cfe9a35e2b27c15e4226c3206e874fc
Author: Katsumi Yamaoka <[email protected]>
Date:   Wed Apr 30 04:05:15 2014 +0000

    gnus-art.el (gnus-mm-display-part): Bugfix for the 2014-02-05 change

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 95f48b9..f5d300b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-30  Katsumi Yamaoka  <[email protected]>
+
+	* gnus-art.el (gnus-mm-display-part): Don't move point while toggling
+	a part; redisplay a button (enbugged in 2014-03-23).
+
 2014-04-27  Teodor Zlatanov  <[email protected]>
 
 	* auth-source.el (auth-source-search, auth-source-search-backends):
diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el
index 0b552e7..7f987b8 100644
--- a/lisp/gnus-art.el
+++ b/lisp/gnus-art.el
@@ -5636,32 +5636,33 @@ all parts."
   "Display HANDLE and fix MIME button."
   (let ((id (get-text-property (point) 'gnus-part))
 	(point (point))
-	(inhibit-read-only t))
-    (forward-line 1)
-    (prog1
-	(let ((window (selected-window))
+	(inhibit-read-only t)
+	(window (selected-window))
 	(mail-parse-charset gnus-newsgroup-charset)
 	(mail-parse-ignored-charsets
 	 (if (gnus-buffer-live-p gnus-summary-buffer)
 	     (with-current-buffer gnus-summary-buffer
 	       gnus-newsgroup-ignored-charsets)
-		 nil)))
-	  (save-excursion
+	   nil))
+	retval)
     (unwind-protect
-		(let ((win (gnus-get-buffer-window (current-buffer) t))
-		      (beg (point)))
+	(progn
+	  (let ((win (gnus-get-buffer-window (current-buffer) t)))
 	    (when win
-		    (select-window win))
-		  (goto-char point)
+	      (select-window win)
+	      (goto-char point)))
 	  (forward-line)
 	  (if (mm-handle-displayed-p handle)
 	      ;; This will remove the part.
-		      (mm-display-part handle)
+	      (setq retval (mm-display-part handle))
 	    (save-window-excursion
 	      (save-restriction
+		;; FIXME: nothing is displayed in the article buffer
+		;; while prompting a user for a file name.
 		(narrow-to-region (point)
 				  (if (eobp) (point) (1+ (point))))
-			(gnus-bind-safe-url-regexp (mm-display-part handle))
+		(gnus-bind-safe-url-regexp
+		 (setq retval (mm-display-part handle)))
 		;; We narrow to the part itself and
 		;; then call the treatment functions.
 		(goto-char (point-min))
@@ -5672,7 +5673,16 @@ all parts."
 		 (gnus-article-mime-total-parts)
 		 (mm-handle-media-type handle))))))
       (if (window-live-p window)
-		  (select-window window))))))))
+	  (select-window window))
+      (goto-char point)
+      ;; Toggle the button appearance between `[button]...' and `[button]'.
+      (let ((end (next-single-property-change point 'gnus-data)))
+	(delete-region (previous-single-property-change end 'gnus-data) end))
+      (gnus-insert-mime-button
+       handle id (list (mm-handle-displayed-p handle)))
+      (delete-char -1)
+      (goto-char point))
+    retval))
 
 (defun gnus-article-goto-part (n)
   "Go to MIME part N."

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog   |    5 ++++
 lisp/gnus-art.el |   84 ++++++++++++++++++++++++++++++------------------------
 2 files changed, 52 insertions(+), 37 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project