From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: [PATCH] Preserve point when calling org-capture in gnus virtual group Date: Wed, 29 Nov 2017 12:43:28 -0600 Message-ID: <874lpdrkmn.fsf@fastmail.fm> References: <87zi75f6rq.fsf@fastmail.fm> <874lpdotbz.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK7KX-0007jg-QG for emacs-orgmode@gnu.org; Wed, 29 Nov 2017 13:43:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eK7KU-00055C-Ls for emacs-orgmode@gnu.org; Wed, 29 Nov 2017 13:43:33 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:56721) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eK7KU-00054G-87 for emacs-orgmode@gnu.org; Wed, 29 Nov 2017 13:43:30 -0500 In-Reply-To: <874lpdotbz.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Wed, 29 Nov 2017 19:03:44 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: Org Mode --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > Matt Lundin writes: > >> When calling org-capture in gnus virtual groups (for instance, groups >> created through searches), I found that the region captured was >> different than the region I had selected. This is because one of the >> functions called in org-gnus-store-link moves the point to the end of >> the buffer. The attached patch fixes the issue. > > Applied. Thank you. Thanks! And here is another patch to fix the same issue in temporary nnir search groups in gnus. Best, Matt --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Preserve-point-when-storing-link-in-Gnus-nnir-groups.patch >From 87299d4646b5c3895332e63b5c0419e8a1b7d027 Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Wed, 29 Nov 2017 12:37:07 -0600 Subject: [PATCH] Preserve point when storing link in Gnus nnir groups * lisp/org-gnus.el: (org-gnus-store-link) This fixes a similar issue as commit 84b329516efbe92ea5385f2aa2ad2779ab44b427, but for nnir search groups in gnus. --- lisp/org-gnus.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el index 27a968f75..f0f5ca2fa 100644 --- a/lisp/org-gnus.el +++ b/lisp/org-gnus.el @@ -123,7 +123,8 @@ If `org-store-link' was called with a prefix arg the meaning of (save-excursion (car (nnvirtual-map-article (gnus-summary-article-number))))) (`(nnir . ,_) - (nnir-article-group (gnus-summary-article-number))) + (save-excursion + (nnir-article-group (gnus-summary-article-number)))) (_ gnus-newsgroup-name))) (header (with-current-buffer gnus-summary-buffer (gnus-summary-article-header))) -- 2.15.0 --=-=-=--