emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103016: gnus-art.el (article-update-


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103016: gnus-art.el (article-update-date-lapsed): Try a better way to really keep point at the "same place".
Date: Sat, 29 Jan 2011 02:29:38 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103016
author: Lars Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Sat 2011-01-29 02:29:38 +0000
message:
  gnus-art.el (article-update-date-lapsed): Try a better way to really keep 
point at the "same place".
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-art.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-01-28 23:07:38 +0000
+++ b/lisp/gnus/ChangeLog       2011-01-29 02:29:38 +0000
@@ -1,3 +1,8 @@
+2011-01-29  Lars Ingebrigtsen  <address@hidden>
+
+       * gnus-art.el (article-update-date-lapsed): Try a better way to really
+       keep point at the "same place".
+
 2011-01-28  Lars Ingebrigtsen  <address@hidden>
 
        * gnus-sum.el (gnus-select-newsgroup): Don't try to alter the active

=== modified file 'lisp/gnus/gnus-art.el'
--- a/lisp/gnus/gnus-art.el     2011-01-28 01:41:15 +0000
+++ b/lisp/gnus/gnus-art.el     2011-01-29 02:29:38 +0000
@@ -3692,28 +3692,22 @@
          (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]