diff options
| author | Katsumi Yamaoka | 2014-04-30 04:05:27 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2014-04-30 04:05:27 +0000 |
| commit | 853095568a0d692ee43ab4dc06537dbb46901d57 (patch) | |
| tree | 4f3ffa5023b155622e84fb38d83cc2ee03a1e496 | |
| parent | 4d89ee379aae4a0d087fa6734524e59e37b9cbc5 (diff) | |
| download | emacs-853095568a0d692ee43ab4dc06537dbb46901d57.tar.gz emacs-853095568a0d692ee43ab4dc06537dbb46901d57.zip | |
lisp/gnus/gnus-art.el (gnus-mm-display-part): Bugfix for the 2014-03-23 change
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 84 |
2 files changed, 52 insertions, 37 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index f766dd539cf..7d880016ad7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-04-30 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-art.el (gnus-mm-display-part): Don't move point while toggling | ||
| 4 | a part; redisplay a button (enbugged in 2014-02-05). | ||
| 5 | |||
| 1 | 2014-04-27 Teodor Zlatanov <tzz@lifelogs.com> | 6 | 2014-04-27 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 7 | ||
| 3 | * auth-source.el (auth-source-search, auth-source-search-backends): | 8 | * auth-source.el (auth-source-search, auth-source-search-backends): |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 0d68c5442f9..ef50a0064ae 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -5635,43 +5635,53 @@ all parts." | |||
| 5635 | "Display HANDLE and fix MIME button." | 5635 | "Display HANDLE and fix MIME button." |
| 5636 | (let ((id (get-text-property (point) 'gnus-part)) | 5636 | (let ((id (get-text-property (point) 'gnus-part)) |
| 5637 | (point (point)) | 5637 | (point (point)) |
| 5638 | (inhibit-read-only t)) | 5638 | (inhibit-read-only t) |
| 5639 | (forward-line 1) | 5639 | (window (selected-window)) |
| 5640 | (prog1 | 5640 | (mail-parse-charset gnus-newsgroup-charset) |
| 5641 | (let ((window (selected-window)) | 5641 | (mail-parse-ignored-charsets |
| 5642 | (mail-parse-charset gnus-newsgroup-charset) | 5642 | (if (gnus-buffer-live-p gnus-summary-buffer) |
| 5643 | (mail-parse-ignored-charsets | 5643 | (with-current-buffer gnus-summary-buffer |
| 5644 | (if (gnus-buffer-live-p gnus-summary-buffer) | 5644 | gnus-newsgroup-ignored-charsets) |
| 5645 | (with-current-buffer gnus-summary-buffer | 5645 | nil)) |
| 5646 | gnus-newsgroup-ignored-charsets) | 5646 | retval) |
| 5647 | nil))) | 5647 | (unwind-protect |
| 5648 | (save-excursion | 5648 | (progn |
| 5649 | (unwind-protect | 5649 | (let ((win (gnus-get-buffer-window (current-buffer) t))) |
| 5650 | (let ((win (gnus-get-buffer-window (current-buffer) t)) | 5650 | (when win |
| 5651 | (beg (point))) | 5651 | (select-window win) |
| 5652 | (when win | 5652 | (goto-char point))) |
| 5653 | (select-window win)) | 5653 | (forward-line) |
| 5654 | (goto-char point) | 5654 | (if (mm-handle-displayed-p handle) |
| 5655 | (forward-line) | 5655 | ;; This will remove the part. |
| 5656 | (if (mm-handle-displayed-p handle) | 5656 | (setq retval (mm-display-part handle)) |
| 5657 | ;; This will remove the part. | 5657 | (save-window-excursion |
| 5658 | (mm-display-part handle) | 5658 | (save-restriction |
| 5659 | (save-window-excursion | 5659 | ;; FIXME: nothing is displayed in the article buffer |
| 5660 | (save-restriction | 5660 | ;; while prompting a user for a file name. |
| 5661 | (narrow-to-region (point) | 5661 | (narrow-to-region (point) |
| 5662 | (if (eobp) (point) (1+ (point)))) | 5662 | (if (eobp) (point) (1+ (point)))) |
| 5663 | (gnus-bind-safe-url-regexp (mm-display-part handle)) | 5663 | (gnus-bind-safe-url-regexp |
| 5664 | ;; We narrow to the part itself and | 5664 | (setq retval (mm-display-part handle))) |
| 5665 | ;; then call the treatment functions. | 5665 | ;; We narrow to the part itself and |
| 5666 | (goto-char (point-min)) | 5666 | ;; then call the treatment functions. |
| 5667 | (forward-line 1) | 5667 | (goto-char (point-min)) |
| 5668 | (narrow-to-region (point) (point-max)) | 5668 | (forward-line 1) |
| 5669 | (gnus-treat-article | 5669 | (narrow-to-region (point) (point-max)) |
| 5670 | nil id | 5670 | (gnus-treat-article |
| 5671 | (gnus-article-mime-total-parts) | 5671 | nil id |
| 5672 | (mm-handle-media-type handle)))))) | 5672 | (gnus-article-mime-total-parts) |
| 5673 | (if (window-live-p window) | 5673 | (mm-handle-media-type handle)))))) |
| 5674 | (select-window window)))))))) | 5674 | (if (window-live-p window) |
| 5675 | (select-window window)) | ||
| 5676 | (goto-char point) | ||
| 5677 | ;; Toggle the button appearance between `[button]...' and `[button]'. | ||
| 5678 | (let ((end (next-single-property-change point 'gnus-data))) | ||
| 5679 | (delete-region (previous-single-property-change end 'gnus-data) end)) | ||
| 5680 | (gnus-insert-mime-button | ||
| 5681 | handle id (list (mm-handle-displayed-p handle))) | ||
| 5682 | (delete-char -1) | ||
| 5683 | (goto-char point)) | ||
| 5684 | retval)) | ||
| 5675 | 5685 | ||
| 5676 | (defun gnus-article-goto-part (n) | 5686 | (defun gnus-article-goto-part (n) |
| 5677 | "Go to MIME part N." | 5687 | "Go to MIME part N." |