Browse Source

Preserve position of point in gnus virtual group

* lisp/org-gnus.el: (org-gnus-store-link) Add a save-excursion to
  protect the position of point. Otherwise, when calling org-capture
  in an article with a virtual group, the point is moved and the
  region captured is incorrect.
Matt Lundin 7 months ago
parent
commit
84b329516e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org-gnus.el

+ 2 - 1
lisp/org-gnus.el

@@ -120,7 +120,8 @@ If `org-store-link' was called with a prefix arg the meaning of
      (let* ((group
 	     (pcase (gnus-find-method-for-group gnus-newsgroup-name)
 	       (`(nnvirtual . ,_)
-		(car (nnvirtual-map-article (gnus-summary-article-number))))
+		(save-excursion
+		  (car (nnvirtual-map-article (gnus-summary-article-number)))))
 	       (`(nnir . ,_)
 		(nnir-article-group (gnus-summary-article-number)))
 	       (_ gnus-newsgroup-name)))