emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Issues in ol-gnus when storing links in nnvirtual and nnselect articles [9.7-pre (release_9.6.7-570-gd6f3ae.dirty @ /home/jschmidt/work/org-mode/lisp/)]
Date: Sun, 30 Jul 2023 17:57:58 +0200	[thread overview]
Message-ID: <dd5981df-e129-f43f-d896-5554f809d107@vodafonemail.de> (raw)
In-Reply-To: <87sf97p5ao.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

On 2023-07-29  09:04, Ihor Radchenko wrote:

> Thanks for checking!
> Updated our records.

And thanks for doing the paperworks.

Attached is a patch and commit message with:

- patch payload unchanged,

- email address in commit message fixed

- link to this thread in commit message added.

Does look right now?

[-- Attachment #2: 0001-ol-gnus.el-Fix-issue-when-storing-links-from-Gnus-ar.patch --]
[-- Type: text/x-patch, Size: 2536 bytes --]

From 74d5c1f5caf4ce425eb888340c2115276b4ddf8a Mon Sep 17 00:00:00 2001
From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Date: Sun, 30 Jul 2023 17:51:27 +0200
Subject: [PATCH] ol-gnus.el: Fix issue when storing links from Gnus article
 buffers

* lisp/ol-gnus.el (org-gnus-store-link): Switch to
`gnus-summary-buffer' when calling functions that are intended to be
called only there.

Link: https://list.orgmode.org/orgmode/2fa5914d-2cbf-f41f-8be6-e79e77794140@vodafonemail.de
---
 lisp/ol-gnus.el | 34 +++++++++++++++-------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/lisp/ol-gnus.el b/lisp/ol-gnus.el
index 7c07ce045..f0e04ce66 100644
--- a/lisp/ol-gnus.el
+++ b/lisp/ol-gnus.el
@@ -137,27 +137,23 @@ 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 . ,_)
-		(save-excursion
-		  (car (nnvirtual-map-article (gnus-summary-article-number)))))
+		(with-current-buffer gnus-summary-buffer
+		  (save-excursion
+		    (car (nnvirtual-map-article (gnus-summary-article-number))))))
 	       (`(,(or `nnselect `nnir) . ,_)  ; nnir is for Emacs < 28.
-		(save-excursion
-		  (cond
-		   ((fboundp 'nnselect-article-group)
-		    (nnselect-article-group (gnus-summary-article-number)))
-		   ((fboundp 'nnir-article-group)
-		    (nnir-article-group (gnus-summary-article-number)))
-		   (t
-		    (error "No article-group variant bound")))))
+		(with-current-buffer gnus-summary-buffer
+		  (save-excursion
+		    (cond
+		     ((fboundp 'nnselect-article-group)
+		      (nnselect-article-group (gnus-summary-article-number)))
+		     ((fboundp 'nnir-article-group)
+		      (nnir-article-group (gnus-summary-article-number)))
+		     (t
+		      (error "No article-group variant bound"))))))
 	       (_ gnus-newsgroup-name)))
-	    (header (if (eq major-mode 'gnus-article-mode)
-			;; When in an article, first move to summary
-			;; buffer, with point on the summary of the
-			;; current article before extracting headers.
-			(save-window-excursion
-			  (save-excursion
-			    (gnus-article-show-summary)
-			    (gnus-summary-article-header)))
-		      (gnus-summary-article-header)))
+	    (header (with-current-buffer gnus-summary-buffer
+		      (save-excursion
+			(gnus-summary-article-header))))
 	    (from (mail-header-from header))
 	    (message-id (org-unbracket-string "<" ">" (mail-header-id header)))
 	    (date (org-trim (mail-header-date header)))
-- 
2.30.2


  reply	other threads:[~2023-07-30 16:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-22  9:06 [BUG] Issues in ol-gnus when storing links in nnvirtual and nnselect articles [9.7-pre (release_9.6.7-570-gd6f3ae.dirty @ /home/jschmidt/work/org-mode/lisp/)] Jens Schmidt
2023-07-22 13:48 ` Ihor Radchenko
2023-07-22 15:37   ` Jens Schmidt
2023-07-22 21:09     ` Eric Abrahamsen
2023-07-23  6:45       ` Ihor Radchenko
2023-07-24  1:55         ` Eric Abrahamsen
2023-07-24  7:17           ` Ihor Radchenko
2023-07-24 20:23     ` Jens Schmidt
2023-07-25  7:16       ` Ihor Radchenko
2023-07-27 16:10       ` Eric Abrahamsen
2023-07-23 10:26 ` Max Nikulin
2023-07-23 14:13   ` Jens Schmidt
2023-07-24 14:54     ` Max Nikulin
2023-07-26 16:04 ` Ihor Radchenko
2023-07-26 19:36   ` Jens Schmidt
2023-07-27  7:56     ` Ihor Radchenko
2023-07-28 11:27       ` Bastien Guerry
2023-07-29  7:04         ` Ihor Radchenko
2023-07-30 15:57           ` Jens Schmidt [this message]
2023-07-30 16:35             ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd5981df-e129-f43f-d896-5554f809d107@vodafonemail.de \
    --to=jschmidt4gnu@vodafonemail.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).