Commit dc6de553 authored by Katsumi Yamaoka's avatar Katsumi Yamaoka
Browse files

gnus-summary-(move,delete)-article: Save excursion while copying, moving,

 and deleting articles in order to prevent the cursor from jumping to
 unforeseen place.
parent 4142607e
2010-08-27 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-sum.el (gnus-summary-move-article, gnus-summary-delete-article):
Save excursion while copying, moving, and deleting articles in order to
prevent the cursor from jumping to unforeseen place.
2010-08-17 Glenn Morris <rgm@gnu.org> 2010-08-17 Glenn Morris <rgm@gnu.org>
* gnus-sync.el: Require gnus components whose functions are used. * gnus-sync.el: Require gnus components whose functions are used.
......
...@@ -9848,12 +9848,14 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." ...@@ -9848,12 +9848,14 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
;;;!!!Why is this necessary? ;;;!!!Why is this necessary?
(set-buffer gnus-summary-buffer) (set-buffer gnus-summary-buffer)
(gnus-summary-goto-subject article)
(when (eq action 'move) (when (eq action 'move)
(gnus-summary-mark-article article gnus-canceled-mark)))) (save-excursion
(gnus-summary-goto-subject article)
(gnus-summary-mark-article article gnus-canceled-mark)))))
(push article articles-to-update-marks)) (push article articles-to-update-marks))
(apply 'gnus-summary-remove-process-mark articles-to-update-marks) (save-excursion
(apply 'gnus-summary-remove-process-mark articles-to-update-marks))
;; Re-activate all groups that have been moved to. ;; Re-activate all groups that have been moved to.
(with-current-buffer gnus-group-buffer (with-current-buffer gnus-group-buffer
(let ((gnus-group-marked to-groups)) (let ((gnus-group-marked to-groups))
...@@ -10109,6 +10111,7 @@ confirmation before the articles are deleted." ...@@ -10109,6 +10111,7 @@ confirmation before the articles are deleted."
;; Delete the articles. ;; Delete the articles.
(setq not-deleted (gnus-request-expire-articles (setq not-deleted (gnus-request-expire-articles
articles gnus-newsgroup-name 'force)) articles gnus-newsgroup-name 'force))
(save-excursion
(while articles (while articles
(gnus-summary-remove-process-mark (car articles)) (gnus-summary-remove-process-mark (car articles))
;; The backend might not have been able to delete the article ;; The backend might not have been able to delete the article
...@@ -10121,7 +10124,7 @@ confirmation before the articles are deleted." ...@@ -10121,7 +10124,7 @@ confirmation before the articles are deleted."
(run-hook-with-args 'gnus-summary-article-delete-hook (run-hook-with-args 'gnus-summary-article-delete-hook
'delete ghead gnus-newsgroup-name nil 'delete ghead gnus-newsgroup-name nil
nil)) nil))
(setq articles (cdr articles))) (setq articles (cdr articles))))
(when not-deleted (when not-deleted
(gnus-message 4 "Couldn't delete articles %s" not-deleted))) (gnus-message 4 "Couldn't delete articles %s" not-deleted)))
(gnus-summary-position-point) (gnus-summary-position-point)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment