diff options
| author | Katsumi Yamaoka | 2014-05-15 06:53:44 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2014-05-15 06:53:44 +0000 |
| commit | 27f13b21fd11706158da57e0daab4fc5651cd47f (patch) | |
| tree | 8a82ae51a99c826d640038cea8fb0d589ca2db53 | |
| parent | c269148bf9a039edff92b1dd7a415d30c21d3087 (diff) | |
| download | emacs-27f13b21fd11706158da57e0daab4fc5651cd47f.tar.gz emacs-27f13b21fd11706158da57e0daab4fc5651cd47f.zip | |
lisp/gnus/gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part): Don't delete next part button; keep spacing between buttons
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 89 |
2 files changed, 53 insertions, 41 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 275aa91eaeb..2d905164807 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-05-15 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part): Don't | ||
| 4 | delete next part button; keep spacing between buttons. | ||
| 5 | |||
| 1 | 2014-05-14 Katsumi Yamaoka <yamaoka@jpl.org> | 6 | 2014-05-14 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 7 | ||
| 3 | * gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part): | 8 | * gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part): |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index ccf7984c595..7924d911a4d 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -5311,14 +5311,14 @@ Compressed files like .gz and .bz2 are decompressed." | |||
| 5311 | (text-property-any (point-min) (point) 'gnus-data handle))) | 5311 | (text-property-any (point-min) (point) 'gnus-data handle))) |
| 5312 | (setq handle (get-text-property b 'gnus-data)) | 5312 | (setq handle (get-text-property b 'gnus-data)) |
| 5313 | b)) | 5313 | b)) |
| 5314 | contents charset coding-system) | 5314 | start contents charset coding-system) |
| 5315 | (when handle | 5315 | (when handle |
| 5316 | (when (= b (prog1 | 5316 | (when (= b (prog1 |
| 5317 | btn | 5317 | btn |
| 5318 | (setq btn (previous-single-property-change | 5318 | (setq start (next-single-property-change btn 'gnus-data |
| 5319 | (or (next-single-property-change btn 'gnus-data) | 5319 | nil (point-max)) |
| 5320 | (point-max)) | 5320 | btn (previous-single-property-change start |
| 5321 | 'gnus-data)))) | 5321 | 'gnus-data)))) |
| 5322 | (setq b btn)) | 5322 | (setq b btn)) |
| 5323 | (if (and (not arg) (mm-handle-undisplayer handle)) | 5323 | (if (and (not arg) (mm-handle-undisplayer handle)) |
| 5324 | (mm-remove-part handle) | 5324 | (mm-remove-part handle) |
| @@ -5345,25 +5345,29 @@ Compressed files like .gz and .bz2 are decompressed." | |||
| 5345 | (mm-read-coding-system "Charset: ")))) | 5345 | (mm-read-coding-system "Charset: ")))) |
| 5346 | ((mm-handle-undisplayer handle) | 5346 | ((mm-handle-undisplayer handle) |
| 5347 | (mm-remove-part handle))) | 5347 | (mm-remove-part handle))) |
| 5348 | (forward-line 1) | 5348 | (goto-char start) |
| 5349 | (mm-display-inline handle)) | 5349 | (mm-display-inline handle)) |
| 5350 | ;; Toggle the button appearance between `[button]...' and `[button]'. | 5350 | ;; Toggle the button appearance between `[button]...' and `[button]'. |
| 5351 | (goto-char btn) | 5351 | (goto-char btn) |
| 5352 | (gnus-insert-mime-button handle (get-text-property btn 'gnus-part) | 5352 | (let ((displayed-p (mm-handle-displayed-p handle))) |
| 5353 | (list (mm-handle-displayed-p handle))) | 5353 | (gnus-insert-mime-button handle (get-text-property btn 'gnus-part) |
| 5354 | (if (featurep 'emacs) | 5354 | (list displayed-p)) |
| 5355 | (delete-region | 5355 | (if (featurep 'emacs) |
| 5356 | (point) | 5356 | (delete-region |
| 5357 | (or (text-property-any (point) (point-max) 'gnus-data nil) | 5357 | (point) |
| 5358 | (point-max))) | 5358 | (next-single-property-change (point) 'gnus-data nil (point-max))) |
| 5359 | (let* ((end (text-property-any (point) (point-max) 'gnus-data nil)) | 5359 | (let* ((end (next-single-property-change (point) 'gnus-data)) |
| 5360 | (annots (annotations-at end))) | 5360 | (annots (annotations-at (or end (point-max))))) |
| 5361 | (delete-region (point) | 5361 | (delete-region (point) |
| 5362 | (if end | 5362 | (if end |
| 5363 | (if annots (1+ end) end) | 5363 | (if annots (1+ end) end) |
| 5364 | (point-max))) | 5364 | (point-max))) |
| 5365 | (dolist (annot annots) | 5365 | (dolist (annot annots) |
| 5366 | (set-extent-endpoints annot (point) (point))))) | 5366 | (set-extent-endpoints annot (point) (point))))) |
| 5367 | (unless (or displayed-p (eolp)) | ||
| 5368 | ;; Add extra newline. | ||
| 5369 | (insert (propertize (buffer-substring (1- (point)) (point)) | ||
| 5370 | 'gnus-undeletable t)))) | ||
| 5367 | (unless (search-backward "\n\n" nil t) | 5371 | (unless (search-backward "\n\n" nil t) |
| 5368 | ;; We're in the article header. | 5372 | ;; We're in the article header. |
| 5369 | (delete-char -1) | 5373 | (delete-char -1) |
| @@ -5686,17 +5690,16 @@ all parts." | |||
| 5686 | (with-current-buffer gnus-summary-buffer | 5690 | (with-current-buffer gnus-summary-buffer |
| 5687 | gnus-newsgroup-ignored-charsets) | 5691 | gnus-newsgroup-ignored-charsets) |
| 5688 | nil)) | 5692 | nil)) |
| 5689 | retval) | 5693 | start retval) |
| 5690 | (unwind-protect | 5694 | (unwind-protect |
| 5691 | (progn | 5695 | (progn |
| 5692 | (let ((win (gnus-get-buffer-window (current-buffer) t))) | 5696 | (let ((win (gnus-get-buffer-window (current-buffer) t))) |
| 5693 | (when win | 5697 | (when win |
| 5694 | (select-window win) | 5698 | (select-window win) |
| 5695 | (goto-char point))) | 5699 | (goto-char point))) |
| 5696 | (setq point (previous-single-property-change | 5700 | (setq start (next-single-property-change point 'gnus-data |
| 5697 | (or (next-single-property-change point 'gnus-data) | 5701 | nil (point-max)) |
| 5698 | (point-max)) | 5702 | point (previous-single-property-change start 'gnus-data)) |
| 5699 | 'gnus-data)) | ||
| 5700 | (if (mm-handle-displayed-p handle) | 5703 | (if (mm-handle-displayed-p handle) |
| 5701 | ;; This will remove the part. | 5704 | ;; This will remove the part. |
| 5702 | (setq retval (mm-display-part handle)) | 5705 | (setq retval (mm-display-part handle)) |
| @@ -5708,7 +5711,7 @@ all parts." | |||
| 5708 | (setq retval (mm-display-part handle))) | 5711 | (setq retval (mm-display-part handle))) |
| 5709 | (unless (zerop (buffer-size)) | 5712 | (unless (zerop (buffer-size)) |
| 5710 | (buffer-string)))))) | 5713 | (buffer-string)))))) |
| 5711 | (forward-line) | 5714 | (goto-char start) |
| 5712 | (cond ((stringp part) | 5715 | (cond ((stringp part) |
| 5713 | (save-restriction | 5716 | (save-restriction |
| 5714 | (narrow-to-region (point) | 5717 | (narrow-to-region (point) |
| @@ -5729,20 +5732,24 @@ all parts." | |||
| 5729 | (mm-display-inline handle)))))) | 5732 | (mm-display-inline handle)))))) |
| 5730 | (goto-char point) | 5733 | (goto-char point) |
| 5731 | ;; Toggle the button appearance between `[button]...' and `[button]'. | 5734 | ;; Toggle the button appearance between `[button]...' and `[button]'. |
| 5732 | (gnus-insert-mime-button handle id (list (mm-handle-displayed-p handle))) | 5735 | (let ((displayed-p (mm-handle-displayed-p handle))) |
| 5733 | (if (featurep 'emacs) | 5736 | (gnus-insert-mime-button handle id (list displayed-p)) |
| 5734 | (delete-region | 5737 | (if (featurep 'emacs) |
| 5735 | (point) | 5738 | (delete-region |
| 5736 | (or (text-property-any (point) (point-max) 'gnus-data nil) | 5739 | (point) |
| 5737 | (point-max))) | 5740 | (next-single-property-change (point) 'gnus-data nil (point-max))) |
| 5738 | (let* ((end (text-property-any (point) (point-max) 'gnus-data nil)) | 5741 | (let* ((end (next-single-property-change (point) 'gnus-data)) |
| 5739 | (annots (annotations-at end))) | 5742 | (annots (annotations-at (or end (point-max))))) |
| 5740 | (delete-region (point) | 5743 | (delete-region (point) |
| 5741 | (if end | 5744 | (if end |
| 5742 | (if annots (1+ end) end) | 5745 | (if annots (1+ end) end) |
| 5743 | (point-max))) | 5746 | (point-max))) |
| 5744 | (dolist (annot annots) | 5747 | (dolist (annot annots) |
| 5745 | (set-extent-endpoints annot (point) (point))))) | 5748 | (set-extent-endpoints annot (point) (point))))) |
| 5749 | (unless (or displayed-p (eolp)) | ||
| 5750 | ;; Add extra newline. | ||
| 5751 | (insert (propertize (buffer-substring (1- (point)) (point)) | ||
| 5752 | 'gnus-undeletable t)))) | ||
| 5746 | (unless (search-backward "\n\n" nil t) | 5753 | (unless (search-backward "\n\n" nil t) |
| 5747 | ;; We're in the article header. | 5754 | ;; We're in the article header. |
| 5748 | (delete-char -1) | 5755 | (delete-char -1) |