emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Gnus link bug
@ 2009-08-19 10:53 Leo
  2009-08-23 18:32 ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Leo @ 2009-08-19 10:53 UTC (permalink / raw)
  To: emacs-orgmode

Hi there,

I haven't used org to store links from Gnus for almost two years and
today I tried it again and found at least one annoying bug.

In the summary buffer, calling org-store-link will display the article
buffer which is uncalled for. It also causes visual disturbance as well
as asks Gnus to download the article while all the information required
is already available.

Possible solution (not real patch):

In Gnus summary buffer the header of each article is already downloaded
and can be obtained by (gnus-summary-article-header). To get the mid,
use (mail-header-id (gnus-summary-article-header)).

Could Carsten or Tassilo use that in org-gnus? Thank you.

Leo

-- 
Emacs uptime: 1 day, 20 hours, 32 minutes, 5 seconds

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus link bug
  2009-08-19 10:53 Gnus link bug Leo
@ 2009-08-23 18:32 ` Bastien
  2009-08-24 13:38   ` Leo
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2009-08-23 18:32 UTC (permalink / raw)
  To: Leo; +Cc: emacs-orgmode

Hi Leo,

Leo <sdl.web@gmail.com> writes:

> I haven't used org to store links from Gnus for almost two years and
> today I tried it again and found at least one annoying bug.
>
> In the summary buffer, calling org-store-link will display the article
> buffer which is uncalled for. It also causes visual disturbance as well
> as asks Gnus to download the article while all the information required
> is already available.

Should be fixed now in git, please try it.

> Possible solution (not real patch):
>
> In Gnus summary buffer the header of each article is already downloaded
> and can be obtained by (gnus-summary-article-header). To get the mid,
> use (mail-header-id (gnus-summary-article-header)).

I followed your suggestion, but only for when we are in the summary
buffer, as I found out that the output of `gnus-summary-article-header'
in the article buffer is not very reliable.

> Could Carsten or Tassilo use that in org-gnus? Thank you.

Please Gnus army test it!

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus link bug
  2009-08-23 18:32 ` Bastien
@ 2009-08-24 13:38   ` Leo
  2009-08-25  2:43     ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Leo @ 2009-08-24 13:38 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

On 2009-08-23 19:32 +0100, Bastien wrote:
> Hi Leo,
>
> Leo <sdl.web@gmail.com> writes:
>
>> I haven't used org to store links from Gnus for almost two years and
>> today I tried it again and found at least one annoying bug.
>>
>> In the summary buffer, calling org-store-link will display the article
>> buffer which is uncalled for. It also causes visual disturbance as well
>> as asks Gnus to download the article while all the information required
>> is already available.
>
> Should be fixed now in git, please try it.

I tried the git version and it worked as expected.

>
>> Possible solution (not real patch):
>>
>> In Gnus summary buffer the header of each article is already downloaded
>> and can be obtained by (gnus-summary-article-header). To get the mid,
>> use (mail-header-id (gnus-summary-article-header)).
>
> I followed your suggestion, but only for when we are in the summary
> buffer, as I found out that the output of `gnus-summary-article-header'
> in the article buffer is not very reliable.

I feel there's something we can simplify. Also the old code for handling
gnus-article-mode moves the cursor around.

So I simplified org-gnus-store-link as follows:

(defun org-gnus-store-link ()
  "Store a link to a Gnus folder or message."
  (cond
   ((eq major-mode 'gnus-group-mode)
    (let* ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus
			 (gnus-group-group-name))         ; version
			((fboundp 'gnus-group-name)
			 (gnus-group-name))
			(t "???")))
	   desc link)
      (when group
	(org-store-link-props :type "gnus" :group group)
	(setq desc (org-gnus-group-link group)
	      link desc)
	(org-add-link-props :link link :description desc)
	link)))

   ((memq major-mode '(gnus-summary-mode gnus-article-mode))
    (let* ((group gnus-newsgroup-name)
    	   (header (with-current-buffer gnus-summary-buffer
                     (gnus-summary-article-header)))
           (extra (mail-header-extra header))
	   (from (mail-header-from header))
	   (message-id (org-remove-angle-brackets (mail-header-id header)))
	   (date (mail-header-date header))
	   (to (cdr (assoc 'To extra)))
	   (newsgroups (cdr (assoc 'newsgroup extra)))
	   (x-no-archive (cdr (assoc 'x-no-archive extra)))
	   (subject (mail-header-subject header))
	   desc link)
      (org-store-link-props :type "gnus" :from from :subject subject
			    :message-id message-id :group group :to to)
      (setq desc (org-email-link-description)
	    link (org-gnus-article-link group newsgroups message-id x-no-archive))
      (org-add-link-props :link link :description desc)
      link))))

I tested this in my Emacs 2009-08-10 with the default Gnus. It seems to
work nicely. Could you test it as well?

Thanks.

Leo

-- 
Emacs uptime: 6 days, 23 hours, 16 minutes, 38 seconds

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus link bug
  2009-08-24 13:38   ` Leo
@ 2009-08-25  2:43     ` Bastien
  2009-08-27 15:54       ` Leo
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2009-08-25  2:43 UTC (permalink / raw)
  To: Leo; +Cc: Tassilo Horn, emacs-orgmode

Hi Leo,

Leo <sdl.web@gmail.com> writes:

> I feel there's something we can simplify. Also the old code for handling
> gnus-article-mode moves the cursor around.
>
> So I simplified org-gnus-store-link as follows:

As long as 

  (header (with-current-buffer gnus-summary-buffer
           (gnus-summary-article-header)))

fetches the right header, I think it's okay to use your code.

Thanks for this!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus link bug
  2009-08-25  2:43     ` Bastien
@ 2009-08-27 15:54       ` Leo
  2009-08-27 23:10         ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Leo @ 2009-08-27 15:54 UTC (permalink / raw)
  To: Bastien; +Cc: Tassilo Horn, emacs-orgmode

Hi Bastien,

On 2009-08-25 03:43 +0100, Bastien wrote:
>> I feel there's something we can simplify. Also the old code for handling
>> gnus-article-mode moves the cursor around.
>>
>> So I simplified org-gnus-store-link as follows:
>
> As long as 
>
>   (header (with-current-buffer gnus-summary-buffer
>            (gnus-summary-article-header)))
>
> fetches the right header, I think it's okay to use your code.
>
> Thanks for this!

Could you install that in org.git?

Cheers,

Leo

-- 
Emacs uptime: 10 days, 1 hour, 37 minutes, 36 seconds

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus link bug
  2009-08-27 15:54       ` Leo
@ 2009-08-27 23:10         ` Bastien
  2009-08-28 20:12           ` Leo
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2009-08-27 23:10 UTC (permalink / raw)
  To: Leo; +Cc: Tassilo Horn, emacs-orgmode

Hi Leo,

Leo <sdl.web@gmail.com> writes:

> Could you install that in org.git?

Carsten already took care of this:

http://repo.or.cz/w/org-mode.git?a=commit;h=babb63a27fbd5c050670753c908d543b4f5d5978

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gnus link bug
  2009-08-27 23:10         ` Bastien
@ 2009-08-28 20:12           ` Leo
  0 siblings, 0 replies; 7+ messages in thread
From: Leo @ 2009-08-28 20:12 UTC (permalink / raw)
  To: emacs-orgmode

On 2009-08-28 00:10 +0100, Bastien wrote:
> Hi Leo,
>
> Leo <sdl.web@gmail.com> writes:
>
>> Could you install that in org.git?
>
> Carsten already took care of this:
>
> http://repo.or.cz/w/org-mode.git?a=commit;h=babb63a27fbd5c050670753c908d543b4f5d5978

Thanks. Sorry to miss this.

>
> Thanks!

-- 
Emacs uptime: 11 days, 5 hours, 55 minutes, 26 seconds

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-08-28 20:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-19 10:53 Gnus link bug Leo
2009-08-23 18:32 ` Bastien
2009-08-24 13:38   ` Leo
2009-08-25  2:43     ` Bastien
2009-08-27 15:54       ` Leo
2009-08-27 23:10         ` Bastien
2009-08-28 20:12           ` Leo

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).