Re: Reading the article/message in elisp

2023-07-28 Thread Michael Heerdegen
Emanuel Berg writes: > We would like an arbitrary header access function where the > header is provided as an argument, as in > > (defun gnus-article-header-value (hdr) > "Get the value of HDR for the current article." > (with-current-buffer gnus-original-article-buffer > (gnus-fetch-fiel

Re: Reading the article/message in elisp

2023-07-16 Thread Emanuel Berg
Michael Heerdegen wrote: >>> It will then be the summary buffer article at point, not >>> the selected one. If one is selected, it would make more >>> sense to operate on that. >> >> Probably, but how that works I don't know, this >> >> (gnus-summary-article-number) >> >> is 20086 in the summary b

Re: Reading the article/message in elisp

2023-07-16 Thread Emanuel Berg
Michael Heerdegen wrote: The function `mail-header-subject' works but then you don't get to select the header. >>> >>> What does "you don't get to select the header" mean? >> >> You only get the Subject header. > > With this accessor function, yes. And with the others, you > get the othe

Re: Reading the article/message in elisp

2023-07-15 Thread Michael Heerdegen
Emanuel Berg writes: > Michael Heerdegen wrote: > > >> The function `mail-header-subject' works but then you don't > >> get to select the header. > > > > What does "you don't get to select the header" mean? > > You only get the Subject header. With this accessor function, yes. And with the othe

Re: Reading the article/message in elisp

2023-07-15 Thread Michael Heerdegen
Emanuel Berg writes: > > (gnus-data-header (gnus-data-find (gnus-summary-article-number))) > > > > It will then be the summary buffer article at point, not the > > selected one. If one is selected, it would make more sense > > to operate on that. > > Probably, but how that works I don't know, t

Re: Reading the article/message in elisp

2023-07-14 Thread Emanuel Berg
> (gnus-data-header (gnus-data-find (gnus-summary-article-number))) > > It will then be the summary buffer article at point, not the > selected one. If one is selected, it would make more sense > to operate on that. Probably, but how that works I don't know, this (gnus-summary-article-number)

Re: Reading the article/message in elisp

2023-07-14 Thread Emanuel Berg
Michael Heerdegen wrote: >> The function `mail-header-subject' works but then you don't >> get to select the header. > > What does "you don't get to select the header" mean? You only get the Subject header. -- underground experts united https://dataswamp.org/~incal

Re: Reading the article/message in elisp

2023-07-14 Thread Michael Heerdegen
Emanuel Berg writes: > The function `mail-header-subject' works but then you don't > get to select the header. What does "you don't get to select the header" mean? Michael.

Re: Reading the article/message in elisp

2023-07-14 Thread Emanuel Berg
Michael Heerdegen wrote: However, how will you get the specific header data out of the result? Don't know ... >>> >>> I think the header object is a struct of type >>> `mail-header' ("nnheader.el"). >> >> But try to extract with `mail-header', it complains about >> the data not being a l

Re: Reading the article/message in elisp

2023-07-14 Thread Michael Heerdegen
Emanuel Berg writes: > >> However, how will you get the specific header data out of > >> the result? Don't know ... > > > > I think the header object is a struct of type `mail-header' > > ("nnheader.el"). > > But try to extract with `mail-header', it complains about the > data not being a list.

Re: Reading the article/message in elisp

2023-07-13 Thread Emanuel Berg
Michael Heerdegen wrote: >> However, how will you get the specific header data out of >> the result? Don't know ... > > I think the header object is a struct of type `mail-header' > ("nnheader.el"). But try to extract with `mail-header', it complains about the data not being a list. -- undergro

Re: Reading the article/message in elisp

2023-07-13 Thread Michael Heerdegen
Emanuel Berg writes: > However, how will you get the specific header data out of > the result? Don't know ... I think the header object is a struct of type `mail-header' ("nnheader.el"). Michael.

Re: Reading the article/message in elisp

2023-07-13 Thread Emanuel Berg
Get data like this: (gnus-data-header (gnus-data-find (gnus-summary-article-number))) It will then be the summary buffer article at point, not the selected one. If one is selected, it would make more sense to operate on that. However, how will you get the specific header data out of the resul

Re: Reading the article/message in elisp

2023-07-13 Thread Michael Heerdegen
Husain Alshehhi writes: > I suppose that gnus-with-article-buffer works, almost. In the case that > I am in gnus summary page [...] I'm not sure what information is known by Gnus at that moment. In the summary, internally each article is identified with a number. This should be more or less (c

Re: Reading the article/message in elisp

2023-07-13 Thread Emanuel Berg
Husain Alshehhi wrote: >> In a temp buffer, no, but you can access the article buffer >> using eg `gnus-with-article' or `gnus-with-article-buffer', >> or even `gnus-with-article-headers' if you only care about >> the headers. > > I suppose that gnus-with-article-buffer works, almost. > In the cas

Re: Reading the article/message in elisp

2023-07-13 Thread Husain Alshehhi
Robert Pluim writes: > > In a temp buffer, no, but you can access the article buffer using eg > `gnus-with-article' or `gnus-with-article-buffer', or even > `gnus-with-article-headers' if you only care about the headers. I suppose that gnus-with-article-buffer works, almost. In the case that I a

Re: Reading the article/message in elisp

2023-07-12 Thread Michael Heerdegen
Robert Pluim writes: > Husain> (defun husain--test-message-subject-yank () > Husain> (interactive) > Husain> (save-excursion > Husain> (let ((subj (message-fetch-field "Subject"))) > Husain> (if subj > Husain>

Re: Reading the article/message in elisp

2023-07-12 Thread Emanuel Berg
Robert Pluim wrote: > In a temp buffer, no, but you can access the article buffer > using eg `gnus-with-article' or `gnus-with-article-buffer', > or even `gnus-with-article-headers' if you only care about > the headers. You mean like this? (defun gnus-article-header-value (hdr) "Get the value

Re: Reading the article/message in elisp

2023-07-12 Thread Robert Pluim
> On Wed, 12 Jul 2023 04:59:08 +, Husain Alshehhi > said: Husain> Emanuel Berg writes: >> You can use `message-fetch-field' to get headers, as in: >> >> (defun message-yank-subject () >> (interactive) >> (save-excursion >> (let ((subj (message-fetch-fiel

Re: Reading the article/message in elisp

2023-07-11 Thread Husain Alshehhi
Emanuel Berg writes: > You can use `message-fetch-field' to get headers, as in: > > (defun message-yank-subject () > (interactive) > (save-excursion > (let ((subj (message-fetch-field "Subject"))) > (when subj > (message-goto-body) > (insert (format "%s\n" subj)) )))

Re: Reading the article/message in elisp

2023-07-11 Thread Emanuel Berg
husain wrote: > I would like to be able to read the article content in elisp > and execute processes based on that. For example, if the > message has TO:per...@work.xyz, or CC:per...@work.xyz, then > I would like to open the person's profile page. You can use `message-fetch-field' to get headers,

Reading the article/message in elisp

2023-07-10 Thread husain
Hello, If I am in - the summary page, with the cursor on an unopen article line, or in - the summary page, with an open article, or in - an article I would like to be able to read the article content in elisp and execute processes based on that. For example, if the message has TO:per...@wo