diff options
| author | Katsumi Yamaoka | 2010-08-27 01:53:01 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-08-27 01:53:01 +0000 |
| commit | dc6de553630af92a6893c2438123efe4e327f57b (patch) | |
| tree | eedca26547159217f44ee32c2aa6007fa0bb8be3 | |
| parent | 4142607e2fb5acacc8d087fa581422df3459fc81 (diff) | |
| download | emacs-dc6de553630af92a6893c2438123efe4e327f57b.tar.gz 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.
| -rw-r--r-- | lisp/gnus/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 35 |
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 @@ | |||
| 1 | 2010-08-27 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-sum.el (gnus-summary-move-article, gnus-summary-delete-article): | ||
| 4 | Save excursion while copying, moving, and deleting articles in order to | ||
| 5 | prevent the cursor from jumping to unforeseen place. | ||
| 6 | |||
| 1 | 2010-08-17 Glenn Morris <rgm@gnu.org> | 7 | 2010-08-17 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * gnus-sync.el: Require gnus components whose functions are used. | 9 | * 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'." | |||
| 9848 | ;;;!!!Why is this necessary? | 9848 | ;;;!!!Why is this necessary? |
| 9849 | (set-buffer gnus-summary-buffer) | 9849 | (set-buffer gnus-summary-buffer) |
| 9850 | 9850 | ||
| 9851 | (gnus-summary-goto-subject article) | ||
| 9852 | (when (eq action 'move) | 9851 | (when (eq action 'move) |
| 9853 | (gnus-summary-mark-article article gnus-canceled-mark)))) | 9852 | (save-excursion |
| 9853 | (gnus-summary-goto-subject article) | ||
| 9854 | (gnus-summary-mark-article article gnus-canceled-mark))))) | ||
| 9854 | (push article articles-to-update-marks)) | 9855 | (push article articles-to-update-marks)) |
| 9855 | 9856 | ||
| 9856 | (apply 'gnus-summary-remove-process-mark articles-to-update-marks) | 9857 | (save-excursion |
| 9858 | (apply 'gnus-summary-remove-process-mark articles-to-update-marks)) | ||
| 9857 | ;; Re-activate all groups that have been moved to. | 9859 | ;; Re-activate all groups that have been moved to. |
| 9858 | (with-current-buffer gnus-group-buffer | 9860 | (with-current-buffer gnus-group-buffer |
| 9859 | (let ((gnus-group-marked to-groups)) | 9861 | (let ((gnus-group-marked to-groups)) |
| @@ -10109,19 +10111,20 @@ confirmation before the articles are deleted." | |||
| 10109 | ;; Delete the articles. | 10111 | ;; Delete the articles. |
| 10110 | (setq not-deleted (gnus-request-expire-articles | 10112 | (setq not-deleted (gnus-request-expire-articles |
| 10111 | articles gnus-newsgroup-name 'force)) | 10113 | articles gnus-newsgroup-name 'force)) |
| 10112 | (while articles | 10114 | (save-excursion |
| 10113 | (gnus-summary-remove-process-mark (car articles)) | 10115 | (while articles |
| 10114 | ;; The backend might not have been able to delete the article | 10116 | (gnus-summary-remove-process-mark (car articles)) |
| 10115 | ;; after all. | 10117 | ;; The backend might not have been able to delete the article |
| 10116 | (unless (memq (car articles) not-deleted) | 10118 | ;; after all. |
| 10117 | (gnus-summary-mark-article (car articles) gnus-canceled-mark)) | 10119 | (unless (memq (car articles) not-deleted) |
| 10118 | (let* ((article (car articles)) | 10120 | (gnus-summary-mark-article (car articles) gnus-canceled-mark)) |
| 10119 | (ghead (gnus-data-header | 10121 | (let* ((article (car articles)) |
| 10120 | (assoc article (gnus-data-list nil))))) | 10122 | (ghead (gnus-data-header |
| 10121 | (run-hook-with-args 'gnus-summary-article-delete-hook | 10123 | (assoc article (gnus-data-list nil))))) |
| 10122 | 'delete ghead gnus-newsgroup-name nil | 10124 | (run-hook-with-args 'gnus-summary-article-delete-hook |
| 10123 | nil)) | 10125 | 'delete ghead gnus-newsgroup-name nil |
| 10124 | (setq articles (cdr articles))) | 10126 | nil)) |
| 10127 | (setq articles (cdr articles)))) | ||
| 10125 | (when not-deleted | 10128 | (when not-deleted |
| 10126 | (gnus-message 4 "Couldn't delete articles %s" not-deleted))) | 10129 | (gnus-message 4 "Couldn't delete articles %s" not-deleted))) |
| 10127 | (gnus-summary-position-point) | 10130 | (gnus-summary-position-point) |