aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/gnus/gnus-art.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <[email protected]>2011-01-29 02:29:38 +0000
committerKatsumi Yamaoka <[email protected]>2011-01-29 02:29:38 +0000
commitbc68bd3998b317499fb5df713470f78fbdf3a78d (patch)
treeeb40aa06bb6848dc8c5dace4bb0c3eb9c2d744ba /lisp/gnus/gnus-art.el
parent9bfe578343f60afa1a3b19856f90190bf74dcebb (diff)
gnus-art.el (article-update-date-lapsed): Try a better way to really keep point at the "same place".
Diffstat (limited to 'lisp/gnus/gnus-art.el')
-rw-r--r--lisp/gnus/gnus-art.el26
1 files changed, 10 insertions, 16 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index bde599c5f0..0a9446a061 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."
(lambda (w)
(set-buffer (window-buffer w))
(when (eq major-mode 'gnus-article-mode)
- (let ((mark (point-marker))
- (old-point (point)))
+ (let ((old-line (count-lines (point-min) (point)))
+ (old-column (current-column)))
(goto-char (point-min))
(when (re-search-forward "^X-Sent:\\|^Date:" nil t)
- ;; If the point is on the Date line, then use that
- ;; absolute position. Otherwise, use the mark.
- ;; This will ensure that point stays at the "same
- ;; place".
- (when (or (< old-point (match-beginning 0))
- (> old-point (progn
- (forward-line 1)
- (while (and (not (eobp))
- (looking-at "X-Sent:\\|Date:"))
- (forward-line))
- (point))))
- (setq old-point nil))
(when gnus-treat-date-combined-lapsed
(article-date-combined-lapsed t))
(when gnus-treat-date-lapsed
(article-date-lapsed t)))
- (goto-char (or old-point (marker-position mark)))
- (move-marker mark nil))))
+ (goto-char (point-min))
+ (when (> old-column 0)
+ (setq old-line (1- old-line)))
+ (forward-line old-line)
+ (end-of-line)
+ (when (> (current-column) old-column)
+ (beginning-of-line)
+ (forward-char old-column)))))
nil 'visible))))))
(defun gnus-start-date-timer (&optional n)