(article-update-date-lapsed): Make sure the window start doesn't move, either.
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 3 Feb 2011 05:13:12 +0000 (21:13 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 3 Feb 2011 05:13:12 +0000 (21:13 -0800)
lisp/ChangeLog
lisp/gnus-art.el

index 6706676..31dc090 100644 (file)
@@ -4,6 +4,8 @@
        gnus-article-update-date-headers is nil.
        (gnus-article-date-headers): Rip out the old -treat-date-* stuff, since
        it didn't really work with defcustom.
        gnus-article-update-date-headers is nil.
        (gnus-article-date-headers): Rip out the old -treat-date-* stuff, since
        it didn't really work with defcustom.
+       (article-update-date-lapsed): Make sure the window start doesn't move,
+       either.
 
 2011-02-01  Julien Danjou  <julien@danjou.info>
 
 
 2011-02-01  Julien Danjou  <julien@danjou.info>
 
index 0155afe..e9a0261 100644 (file)
@@ -3628,15 +3628,25 @@ function and want to see what the date was before converting."
           (set-buffer (window-buffer w))
           (when (eq major-mode 'gnus-article-mode)
             (let ((old-line (count-lines (point-min) (point)))
           (set-buffer (window-buffer w))
           (when (eq major-mode 'gnus-article-mode)
             (let ((old-line (count-lines (point-min) (point)))
-                  (old-column (- (point) (line-beginning-position))))
+                  (old-column (- (point) (line-beginning-position)))
+                  (window-start
+                   (window-start (get-buffer-window (current-buffer)))))
               (goto-char (point-min))
               (while (re-search-forward "^Date:" nil t)
                 (let ((type (get-text-property (match-beginning 0)
                                                'gnus-date-type)))
                   (when (memq type '(lapsed combined-lapsed user-format))
               (goto-char (point-min))
               (while (re-search-forward "^Date:" nil t)
                 (let ((type (get-text-property (match-beginning 0)
                                                'gnus-date-type)))
                   (when (memq type '(lapsed combined-lapsed user-format))
+                    (unless (= window-start
+                               (save-excursion
+                                 (forward-line 1)
+                                 (point)))
+                      (setq window-start nil))
                     (save-excursion
                       (article-date-ut type t (match-beginning 0)))
                     (save-excursion
                       (article-date-ut type t (match-beginning 0)))
-                    (forward-line 1))))
+                    (forward-line 1)
+                    (when window-start
+                      (set-window-start (get-buffer-window (current-buffer))
+                                        (point))))))
               (goto-char (point-min))
               (when (> old-column 0)
                 (setq old-line (1- old-line)))
               (goto-char (point-min))
               (when (> old-column 0)
                 (setq old-line (1- old-line)))