]> git.eshelyaron.com Git - emacs.git/commitdiff
Tweak point placement in gnus-summary-select-article-buffer
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 17 Apr 2018 18:02:26 +0000 (20:02 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 17 Apr 2018 18:02:26 +0000 (20:02 +0200)
* lisp/gnus/gnus-sum.el (gnus-summary-select-article-buffer):
Ensure that point is where it's supposed to be after switching to
the article buffer.

lisp/gnus/gnus-sum.el

index 234d527cd10afd930e67d1e8e11cf70df6af3b14..596afd155251039d94ace5da53b772a454d8aba8 100644 (file)
@@ -7063,17 +7063,20 @@ buffer."
     (or (get-buffer-window gnus-article-buffer)
        (eq gnus-current-article (gnus-summary-article-number))
        (gnus-summary-show-article))
-    (gnus-configure-windows
-     (if gnus-widen-article-window
-        'only-article
-       'article)
-     t)
-    (select-window (get-buffer-window gnus-article-buffer))
-    ;; If we've just selected the message, place point at the start of
-    ;; the body because that's probably where we want to be.
-    (when (bobp)
-      (article-goto-body)
-      (forward-char -1))))
+    (let ((point (with-current-buffer gnus-article-buffer
+                  (point))))
+      (gnus-configure-windows
+       (if gnus-widen-article-window
+          'only-article
+        'article)
+       t)
+      (select-window (get-buffer-window gnus-article-buffer))
+      ;; If we've just selected the message, place point at the start of
+      ;; the body because that's probably where we want to be.
+      (if (not (bobp))
+         (goto-char point)
+       (article-goto-body)
+       (forward-char -1)))))
 
 (defun gnus-summary-universal-argument (arg)
   "Perform any operation on all articles that are process/prefixed."