summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2010-08-27 01:53:01 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-08-27 01:53:01 +0000
commitdc6de553630af92a6893c2438123efe4e327f57b (patch)
treeeedca26547159217f44ee32c2aa6007fa0bb8be3 /lisp
parent4142607e2fb5acacc8d087fa581422df3459fc81 (diff)
downloademacs-dc6de553630af92a6893c2438123efe4e327f57b.tar.gz
emacs-dc6de553630af92a6893c2438123efe4e327f57b.tar.bz2
emacs-dc6de553630af92a6893c2438123efe4e327f57b.zip
gnus-summary-(move,delete)-article: Save excursion while copying, moving,
and deleting articles in order to prevent the cursor from jumping to unforeseen place.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog6
-rw-r--r--lisp/gnus/gnus-sum.el35
2 files changed, 25 insertions, 16 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 5db2c3fa98e..356cf952850 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,9 @@
+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>
* gnus-sync.el: Require gnus components whose functions are used.
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index b04166f0de4..0db499eb17f 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -9848,12 +9848,14 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
;;;!!!Why is this necessary?
(set-buffer gnus-summary-buffer)
- (gnus-summary-goto-subject article)
(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))
- (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.
(with-current-buffer gnus-group-buffer
(let ((gnus-group-marked to-groups))
@@ -10109,19 +10111,20 @@ confirmation before the articles are deleted."
;; Delete the articles.
(setq not-deleted (gnus-request-expire-articles
articles gnus-newsgroup-name 'force))
- (while articles
- (gnus-summary-remove-process-mark (car articles))
- ;; The backend might not have been able to delete the article
- ;; after all.
- (unless (memq (car articles) not-deleted)
- (gnus-summary-mark-article (car articles) gnus-canceled-mark))
- (let* ((article (car articles))
- (ghead (gnus-data-header
- (assoc article (gnus-data-list nil)))))
- (run-hook-with-args 'gnus-summary-article-delete-hook
- 'delete ghead gnus-newsgroup-name nil
- nil))
- (setq articles (cdr articles)))
+ (save-excursion
+ (while articles
+ (gnus-summary-remove-process-mark (car articles))
+ ;; The backend might not have been able to delete the article
+ ;; after all.
+ (unless (memq (car articles) not-deleted)
+ (gnus-summary-mark-article (car articles) gnus-canceled-mark))
+ (let* ((article (car articles))
+ (ghead (gnus-data-header
+ (assoc article (gnus-data-list nil)))))
+ (run-hook-with-args 'gnus-summary-article-delete-hook
+ 'delete ghead gnus-newsgroup-name nil
+ nil))
+ (setq articles (cdr articles))))
(when not-deleted
(gnus-message 4 "Couldn't delete articles %s" not-deleted)))
(gnus-summary-position-point)