X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-art.el;h=c72c2fe1f124ac393140a634a81bd900ce47b8ba;hb=ab577a732d12f8d80ea12ae7d60b62fc451334c0;hp=327250e327bee084cd5e5b5387795f5d8d7724ce;hpb=b45aca7c770b410e86cdd2840abd31bdb56620a4;p=gnus diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 327250e32..c72c2fe1f 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -3674,19 +3674,27 @@ function and want to see what the date was before converting." "Function to be run from a timer to update the lapsed time line." (save-match-data (let (deactivate-mark) - (save-excursion + (save-window-excursion (ignore-errors (walk-windows (lambda (w) (set-buffer (window-buffer w)) (when (eq major-mode 'gnus-article-mode) - (let ((mark (point-marker))) + (let ((mark (point-marker)) + (old-point (point))) (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 (line-end-position))) + (setq old-point nil)) (if gnus-treat-date-combined-lapsed (article-date-combined-lapsed t) (article-date-lapsed t))) - (goto-char (marker-position mark)) + (goto-char (or old-point (marker-position mark))) (move-marker mark nil)))) nil 'visible))))))