Gnus development mailing list
 help / color / mirror / Atom feed
* couple of questions about api
@ 2012-11-23 13:05 Nikola Pajkovsky
  2012-11-26  2:06 ` Dave Goldberg
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Nikola Pajkovsky @ 2012-11-23 13:05 UTC (permalink / raw)
  To: ding

Hey folks,

Let's say I have these mails in summary

   [  31: Mark Brown  ] [PATCH 0/5] mfd: arizona: Updates for v3.7
       [ 553: Mark Brown  ] [PATCH 1/5] mfd: wm5102: Update register patch for latest evaluation
           [  27: Mark Brown  ] [PATCH 2/5] mfd: wm5110: Disable control interface error report for WM5110 rev B
           [  34: Mark Brown  ] [PATCH 3/5] mfd: arizona: Use correct array for ARRAY_SIZE in mfd_add_devices call
           [  37: Mark Brown  ] [PATCH 4/5] mfd: arizona: Correctly report when AIF2/AIF1 is underclocked
           [  45: Mark Brown  ] [PATCH 5/5] mfd: arizona: Sync regcache after reset

I found the function gnus-fetch-field which works fine in Article
buffer, but not in Summary buffer. See code

(global-set-key (kbd "\C-xpg") 'get-message-id)

(defun get-message-id ()
  (car (nthcdr 1 (mail-extract-address-components
		  (gnus-fetch-field "message-id")))))


What do I have to call to get message-id from mail header from Summary
buffer?

And how to make it work with process markers? I'd like to mark some mail
and get message-id one by one.

Thanks
-- 
Nikola



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

* Re: couple of questions about api
  2012-11-23 13:05 couple of questions about api Nikola Pajkovsky
@ 2012-11-26  2:06 ` Dave Goldberg
  2012-11-26 20:26   ` Andreas Schwab
  2012-11-26  2:46 ` Eric Abrahamsen
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Dave Goldberg @ 2012-11-26  2:06 UTC (permalink / raw)
  To: ding

> I found the function gnus-fetch-field which works fine in Article
> buffer, but not in Summary buffer. See code

> (global-set-key (kbd "\C-xpg") 'get-message-id)

> (defun get-message-id ()
>   (car (nthcdr 1 (mail-extract-address-components
> 		  (gnus-fetch-field "message-id")))))


> What do I have to call to get message-id from mail header from Summary
> buffer?

Perhaps there's something that feels cleaner but I've always used something like 

(save-excursion (set-buffer gnus-article-buffer) ...)

> And how to make it work with process markers? I'd like to mark some mail
> and get message-id one by one.

See the function gnus-summary-work-articles


-- 
Dave Goldberg
david.goldberg6@verizon.net



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

* Re: couple of questions about api
  2012-11-23 13:05 couple of questions about api Nikola Pajkovsky
  2012-11-26  2:06 ` Dave Goldberg
@ 2012-11-26  2:46 ` Eric Abrahamsen
  2012-11-27  8:24 ` Nikola Pajkovsky
  2012-12-21 19:48 ` Ted Zlatanov
  3 siblings, 0 replies; 7+ messages in thread
From: Eric Abrahamsen @ 2012-11-26  2:46 UTC (permalink / raw)
  To: ding

Nikola Pajkovsky <npajkovs@redhat.com> writes:

> Hey folks,
>
> Let's say I have these mails in summary
>
>    [  31: Mark Brown  ] [PATCH 0/5] mfd: arizona: Updates for v3.7
>        [ 553: Mark Brown  ] [PATCH 1/5] mfd: wm5102: Update register patch for latest evaluation
>            [  27: Mark Brown  ] [PATCH 2/5] mfd: wm5110: Disable control interface error report for WM5110 rev B
>            [  34: Mark Brown  ] [PATCH 3/5] mfd: arizona: Use correct array for ARRAY_SIZE in mfd_add_devices call
>            [  37: Mark Brown  ] [PATCH 4/5] mfd: arizona: Correctly report when AIF2/AIF1 is underclocked
>            [  45: Mark Brown  ] [PATCH 5/5] mfd: arizona: Sync regcache after reset
>
> I found the function gnus-fetch-field which works fine in Article
> buffer, but not in Summary buffer. See code
>
> (global-set-key (kbd "\C-xpg") 'get-message-id)
>
> (defun get-message-id ()
>   (car (nthcdr 1 (mail-extract-address-components
> 		  (gnus-fetch-field "message-id")))))
>
>
> What do I have to call to get message-id from mail header from Summary
> buffer?

You can use `(mail-header-id (gnus-summary-article-header))' from the
summary buffer to get the id. That's probably as clean as it gets...

When messing with articles in the summary buffer, I've found one of the
best approaches is to use the variable `gnus-newsgroup-data', which
contains a list of small data structures representing all the visible
messages. The data structures contain the article number and the basic
headers (including Message-Id) for each message, and there's a set of
`gnus-data-*' functions for working with those structures. Similar
structures show up repeatedly with different functions -- the
`gnus-summary-article-header' function I mentioned above returns
something very like a `gnus-newsgroup-data' entry for the message under
point, and many other functions know what to do with those entries.

Good to know about `gnus-summary-work-articles', I hadn't got that far
yet...

E




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

* Re: couple of questions about api
  2012-11-26  2:06 ` Dave Goldberg
@ 2012-11-26 20:26   ` Andreas Schwab
  2012-11-27 18:50     ` Reiner Steib
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2012-11-26 20:26 UTC (permalink / raw)
  To: Dave Goldberg; +Cc: ding

david.goldberg6@verizon.net (Dave Goldberg) writes:

> Perhaps there's something that feels cleaner but I've always used something like 
>
> (save-excursion (set-buffer gnus-article-buffer) ...)

Or (with-current-buffer gnus-article-buffer ...).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: couple of questions about api
  2012-11-23 13:05 couple of questions about api Nikola Pajkovsky
  2012-11-26  2:06 ` Dave Goldberg
  2012-11-26  2:46 ` Eric Abrahamsen
@ 2012-11-27  8:24 ` Nikola Pajkovsky
  2012-12-21 19:48 ` Ted Zlatanov
  3 siblings, 0 replies; 7+ messages in thread
From: Nikola Pajkovsky @ 2012-11-27  8:24 UTC (permalink / raw)
  To: ding

Many thanks for suggestions, I will try them today. btw, I'm not on CC?




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

* Re: couple of questions about api
  2012-11-26 20:26   ` Andreas Schwab
@ 2012-11-27 18:50     ` Reiner Steib
  0 siblings, 0 replies; 7+ messages in thread
From: Reiner Steib @ 2012-11-27 18:50 UTC (permalink / raw)
  To: ding

On Mon, Nov 26 2012, Andreas Schwab wrote:

> david.goldberg6@verizon.net (Dave Goldberg) writes:
>> (save-excursion (set-buffer gnus-article-buffer) ...)
> Or (with-current-buffer gnus-article-buffer ...).

(with-current-buffer gnus-original-article-buffer

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: couple of questions about api
  2012-11-23 13:05 couple of questions about api Nikola Pajkovsky
                   ` (2 preceding siblings ...)
  2012-11-27  8:24 ` Nikola Pajkovsky
@ 2012-12-21 19:48 ` Ted Zlatanov
  3 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2012-12-21 19:48 UTC (permalink / raw)
  To: ding

On Fri, 23 Nov 2012 14:05:01 +0100 Nikola Pajkovsky <npajkovs@redhat.com> wrote: 

NP> Hey folks,
NP> Let's say I have these mails in summary

NP>    [  31: Mark Brown  ] [PATCH 0/5] mfd: arizona: Updates for v3.7
NP>        [ 553: Mark Brown  ] [PATCH 1/5] mfd: wm5102: Update register patch for latest evaluation
NP>            [  27: Mark Brown  ] [PATCH 2/5] mfd: wm5110: Disable control interface error report for WM5110 rev B
NP>            [  34: Mark Brown  ] [PATCH 3/5] mfd: arizona: Use correct array for ARRAY_SIZE in mfd_add_devices call
NP>            [  37: Mark Brown  ] [PATCH 4/5] mfd: arizona: Correctly report when AIF2/AIF1 is underclocked
NP>            [  45: Mark Brown  ] [PATCH 5/5] mfd: arizona: Sync regcache after reset

NP> I found the function gnus-fetch-field which works fine in Article
NP> buffer, but not in Summary buffer. See code

NP> (global-set-key (kbd "\C-xpg") 'get-message-id)

NP> (defun get-message-id ()
NP>   (car (nthcdr 1 (mail-extract-address-components
NP> 		  (gnus-fetch-field "message-id")))))

NP> What do I have to call to get message-id from mail header from Summary
NP> buffer?

NP> And how to make it work with process markers? I'd like to mark some mail
NP> and get message-id one by one.

The gnus-registry needed these functions too, since it works with
message IDs primarily.  Take a look, especially at the registry mark
commands.

Ted




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

end of thread, other threads:[~2012-12-21 19:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-23 13:05 couple of questions about api Nikola Pajkovsky
2012-11-26  2:06 ` Dave Goldberg
2012-11-26 20:26   ` Andreas Schwab
2012-11-27 18:50     ` Reiner Steib
2012-11-26  2:46 ` Eric Abrahamsen
2012-11-27  8:24 ` Nikola Pajkovsky
2012-12-21 19:48 ` Ted Zlatanov

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 NNTP newsgroup(s).