diff options
| author | Lars Ingebrigtsen | 2011-01-29 02:29:38 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-01-29 02:29:38 +0000 |
| commit | bc68bd3998b317499fb5df713470f78fbdf3a78d (patch) | |
| tree | eb40aa06bb6848dc8c5dace4bb0c3eb9c2d744ba | |
| parent | 9bfe578343f60afa1a3b19856f90190bf74dcebb (diff) | |
| download | emacs-bc68bd3998b317499fb5df713470f78fbdf3a78d.tar.gz emacs-bc68bd3998b317499fb5df713470f78fbdf3a78d.zip | |
gnus-art.el (article-update-date-lapsed): Try a better way to really keep point at the "same place".
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 26 |
2 files changed, 15 insertions, 16 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2f272e89ee3..40aa931e62f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-01-29 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * gnus-art.el (article-update-date-lapsed): Try a better way to really | ||
| 4 | keep point at the "same place". | ||
| 5 | |||
| 1 | 2011-01-28 Lars Ingebrigtsen <larsi@gnus.org> | 6 | 2011-01-28 Lars Ingebrigtsen <larsi@gnus.org> |
| 2 | 7 | ||
| 3 | * gnus-sum.el (gnus-select-newsgroup): Don't try to alter the active | 8 | * gnus-sum.el (gnus-select-newsgroup): Don't try to alter the active |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index bde599c5f04..0a9446a061c 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -3692,28 +3692,22 @@ function and want to see what the date was before converting." | |||
| 3692 | (lambda (w) | 3692 | (lambda (w) |
| 3693 | (set-buffer (window-buffer w)) | 3693 | (set-buffer (window-buffer w)) |
| 3694 | (when (eq major-mode 'gnus-article-mode) | 3694 | (when (eq major-mode 'gnus-article-mode) |
| 3695 | (let ((mark (point-marker)) | 3695 | (let ((old-line (count-lines (point-min) (point))) |
| 3696 | (old-point (point))) | 3696 | (old-column (current-column))) |
| 3697 | (goto-char (point-min)) | 3697 | (goto-char (point-min)) |
| 3698 | (when (re-search-forward "^X-Sent:\\|^Date:" nil t) | 3698 | (when (re-search-forward "^X-Sent:\\|^Date:" nil t) |
| 3699 | ;; If the point is on the Date line, then use that | ||
| 3700 | ;; absolute position. Otherwise, use the mark. | ||
| 3701 | ;; This will ensure that point stays at the "same | ||
| 3702 | ;; place". | ||
| 3703 | (when (or (< old-point (match-beginning 0)) | ||
| 3704 | (> old-point (progn | ||
| 3705 | (forward-line 1) | ||
| 3706 | (while (and (not (eobp)) | ||
| 3707 | (looking-at "X-Sent:\\|Date:")) | ||
| 3708 | (forward-line)) | ||
| 3709 | (point)))) | ||
| 3710 | (setq old-point nil)) | ||
| 3711 | (when gnus-treat-date-combined-lapsed | 3699 | (when gnus-treat-date-combined-lapsed |
| 3712 | (article-date-combined-lapsed t)) | 3700 | (article-date-combined-lapsed t)) |
| 3713 | (when gnus-treat-date-lapsed | 3701 | (when gnus-treat-date-lapsed |
| 3714 | (article-date-lapsed t))) | 3702 | (article-date-lapsed t))) |
| 3715 | (goto-char (or old-point (marker-position mark))) | 3703 | (goto-char (point-min)) |
| 3716 | (move-marker mark nil)))) | 3704 | (when (> old-column 0) |
| 3705 | (setq old-line (1- old-line))) | ||
| 3706 | (forward-line old-line) | ||
| 3707 | (end-of-line) | ||
| 3708 | (when (> (current-column) old-column) | ||
| 3709 | (beginning-of-line) | ||
| 3710 | (forward-char old-column))))) | ||
| 3717 | nil 'visible)))))) | 3711 | nil 'visible)))))) |
| 3718 | 3712 | ||
| 3719 | (defun gnus-start-date-timer (&optional n) | 3713 | (defun gnus-start-date-timer (&optional n) |