1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-19 18:13:55 +00:00

Fix point motion when removing displayed MIME part

* gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part):
Fix point motion when removing displayed MIME part.
This commit is contained in:
Katsumi Yamaoka 2015-02-26 06:39:11 +00:00
parent 8ae2142555
commit 48598095b3
2 changed files with 19 additions and 4 deletions

View File

@ -1,7 +1,9 @@
2015-02-26 Katsumi Yamaoka <yamaoka@jpl.org> 2015-02-26 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (gnus-article-edit-part): Make jumping to the next part * gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part):
really work when deleting or stripping. Fix point motion when removing displayed MIME part.
(gnus-article-edit-part): Make jumping to the next part really work
when deleting or stripping.
(gnus-mime-buttonize-attachments-in-header): Make header attachment (gnus-mime-buttonize-attachments-in-header): Make header attachment
buttons identical to the ones in the article body so as to work deleting buttons identical to the ones in the article body so as to work deleting
and stripping. and stripping.

View File

@ -5360,7 +5360,10 @@ Compressed files like .gz and .bz2 are decompressed."
'gnus-data)))) 'gnus-data))))
(setq b btn)) (setq b btn))
(if (and (not arg) (mm-handle-undisplayer handle)) (if (and (not arg) (mm-handle-undisplayer handle))
(mm-remove-part handle) (progn
(setq b (copy-marker b)
btn (copy-marker btn))
(mm-remove-part handle))
(cond (cond
((not arg) nil) ((not arg) nil)
((numberp arg) ((numberp arg)
@ -5374,6 +5377,9 @@ Compressed files like .gz and .bz2 are decompressed."
(forward-line 1)) (forward-line 1))
(mm-display-inline handle)) (mm-display-inline handle))
;; Toggle the button appearance between `[button]...' and `[button]'. ;; Toggle the button appearance between `[button]...' and `[button]'.
(when (markerp btn)
(setq btn (prog1 (marker-position btn)
(set-marker btn nil))))
(goto-char btn) (goto-char btn)
(let ((displayed-p (mm-handle-displayed-p handle))) (let ((displayed-p (mm-handle-displayed-p handle)))
(gnus-insert-mime-button handle (get-text-property btn 'gnus-part) (gnus-insert-mime-button handle (get-text-property btn 'gnus-part)
@ -5409,6 +5415,9 @@ Compressed files like .gz and .bz2 are decompressed."
'((gnus-treat-highlight-headers '((gnus-treat-highlight-headers
gnus-article-highlight-headers)))) gnus-article-highlight-headers))))
(gnus-treat-article 'head))))) (gnus-treat-article 'head)))))
(when (markerp b)
(setq b (prog1 (marker-position b)
(set-marker b nil))))
(goto-char b)))) (goto-char b))))
(defun gnus-mime-set-charset-parameters (handle charset) (defun gnus-mime-set-charset-parameters (handle charset)
@ -5731,7 +5740,8 @@ all parts."
point (previous-single-property-change start 'gnus-data)) point (previous-single-property-change start 'gnus-data))
(if (mm-handle-displayed-p handle) (if (mm-handle-displayed-p handle)
;; This will remove the part. ;; This will remove the part.
(setq retval (mm-display-part handle)) (setq point (copy-marker point)
retval (mm-display-part handle))
(let ((part (or (and (mm-inlinable-p handle) (let ((part (or (and (mm-inlinable-p handle)
(mm-inlined-p handle) (mm-inlined-p handle)
t) t)
@ -5762,6 +5772,9 @@ all parts."
,(point-max-marker))))))) ,(point-max-marker)))))))
(part (part
(mm-display-inline handle)))))) (mm-display-inline handle))))))
(when (markerp point)
(setq point (prog1 (marker-position point)
(set-marker point nil))))
(goto-char point) (goto-char point)
;; Toggle the button appearance between `[button]...' and `[button]'. ;; Toggle the button appearance between `[button]...' and `[button]'.
(let ((displayed-p (mm-handle-displayed-p handle))) (let ((displayed-p (mm-handle-displayed-p handle)))