Gnus development mailing list
 help / color / mirror / Atom feed
* equivalent of (vm-subject-of msg) etc
@ 2005-05-17  9:28 Uwe Brauer
  2005-05-17  9:55 ` Katsumi Yamaoka
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Brauer @ 2005-05-17  9:28 UTC (permalink / raw)


Hello

In the vm mail reader there are functions like (vm-subject-of msg) etc
does there exist anything like this in gnus?

Thanks

Uwe Brauer




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

* Re: equivalent of (vm-subject-of msg) etc
  2005-05-17  9:28 equivalent of (vm-subject-of msg) etc Uwe Brauer
@ 2005-05-17  9:55 ` Katsumi Yamaoka
  2005-05-17 15:19   ` Uwe Brauer
  0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2005-05-17  9:55 UTC (permalink / raw)


>>>>> In <871x86ryl8.fsf@mat.ucm.es> Uwe Brauer wrote:

> In the vm mail reader there are functions like (vm-subject-of msg) etc
> does there exist anything like this in gnus?

For example, the following form returns the subject string in
the summary buffer.

(mail-header-subject gnus-current-headers)

Besides this, there are mail-header-from, mail-header-date, etc.
Note that gnus-current-headers is buffer-local in the summary
buffer; see gnus-summary-local-variables.



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

* Re: equivalent of (vm-subject-of msg) etc
  2005-05-17  9:55 ` Katsumi Yamaoka
@ 2005-05-17 15:19   ` Uwe Brauer
  2005-05-17 22:49     ` Katsumi Yamaoka
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Brauer @ 2005-05-17 15:19 UTC (permalink / raw)


>>>>> "Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:


    Katsumi> For example, the following form returns the subject string in
    Katsumi> the summary buffer.

    Katsumi> (mail-header-subject gnus-current-headers)

    Katsumi> Besides this, there are mail-header-from, mail-header-date, etc.
    Katsumi> Note that gnus-current-headers is buffer-local in the summary
    Katsumi> buffer; see gnus-summary-local-variables.


Thanks very much for this, that was what I was looking for.
I question I would like to insert, the from, the subject and the date
into the diary file. However unfortunately  
(mail-header-date gnus-current-headers) returns
(insert (mail-header-date gnus-current-headers))
Tue, 17 May 2005 18:55:18 +0900
but the format for the diary, should be 
May 17, 2005 18:55:18

So I tried to change 
gnus-article-time-format to

: "%b, %d %Y %T "
but it did not help, the date of the current msg (yours) did not
change.

Is there any way to get that date format I need?

Thanks

Uwe 



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

* Re: equivalent of (vm-subject-of msg) etc
  2005-05-17 15:19   ` Uwe Brauer
@ 2005-05-17 22:49     ` Katsumi Yamaoka
  2005-05-18  9:27       ` Uwe Brauer
  0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2005-05-17 22:49 UTC (permalink / raw)


>>>>> In <87psvpg9se.fsf@mat.ucm.es> Uwe Brauer wrote:

> I question I would like to insert, the from, the subject and the date
> into the diary file. However unfortunately
> (mail-header-date gnus-current-headers) returns
> (insert (mail-header-date gnus-current-headers))
> Tue, 17 May 2005 18:55:18 +0900
> but the format for the diary, should be
> May 17, 2005 18:55:18

> So I tried to change
> gnus-article-time-format to

> : "%b, %d %Y %T "
> but it did not help, the date of the current msg (yours) did not
> change.

> Is there any way to get that date format I need?

gnus-article-time-format is used only when displaying date in
the article buffer.  In this case, perhaps you'd better use
general functions like the following:

(format-time-string
 "%b %d, %Y %T"
 (apply 'encode-time
	(parse-time-string
	 (mail-header-date gnus-current-headers))))

This form returns the string of the date in the local timezone,
so "Tue, 17 May 2005 18:55:18 +0900" will be expressed as
"May 17, 2005 09:55:18" (if you are in the +0000 zone).




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

* Re: equivalent of (vm-subject-of msg) etc
  2005-05-17 22:49     ` Katsumi Yamaoka
@ 2005-05-18  9:27       ` Uwe Brauer
  2005-05-18 10:01         ` Katsumi Yamaoka
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Brauer @ 2005-05-18  9:27 UTC (permalink / raw)


>>>>> "Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>> In <87psvpg9se.fsf@mat.ucm.es> Uwe Brauer wrote:

    Katsumi> gnus-article-time-format is used only when displaying date in
    Katsumi> the article buffer.  In this case, perhaps you'd better use
    Katsumi> general functions like the following:

    Katsumi> (format-time-string
    Katsumi>  "%b %d, %Y %T"
    Katsumi>  (apply 'encode-time
    Katsumi> 	(parse-time-string
    Katsumi> 	 (mail-header-date gnus-current-headers))))

    Katsumi> This form returns the string of the date in the local timezone,
    Katsumi> so "Tue, 17 May 2005 18:55:18 +0900" will be expressed as
    Katsumi> "May 17, 2005 09:55:18" (if you are in the +0000 zone).


Thanks very much, and sorry to bother you, but I presume I should put
that function into an appropriate hook?
I tried

(add-hook 'gnus-article-mode-hook 'my-set-gnus-time)

(defun my-set-gnus-time ()
(interactive)
(format-time-string
 "%b %d, %Y %T"
 (apply 'encode-time
	(parse-time-string
	 (mail-header-date gnus-current-headers)))))


But that did not work out, what is my mistake?

Thanks

Uwe 





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

* Re: equivalent of (vm-subject-of msg) etc
  2005-05-18  9:27       ` Uwe Brauer
@ 2005-05-18 10:01         ` Katsumi Yamaoka
  2005-05-18 13:31           ` Uwe Brauer
  0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2005-05-18 10:01 UTC (permalink / raw)


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

>>>>> In <87hdh06fzr.fsf@mat.ucm.es> Uwe Brauer wrote:

> I tried

> (add-hook 'gnus-article-mode-hook 'my-set-gnus-time)

> (defun my-set-gnus-time ()
> (interactive)
> (format-time-string
>  "%b %d, %Y %T"
>  (apply 'encode-time
> 	(parse-time-string
> 	 (mail-header-date gnus-current-headers)))))

> But that did not work out, what is my mistake?

The function only returns a string but it is never inserted or
displayed anywhere.  Furthermore, gnus-article-mode-hook is
evaluated only when the article buffer is created (Gnus keeps
using it for all articles as long as it is not deleted).

Well, while I don't know what you'd like to do, how about the
following?


[-- Attachment #2: Type: application/emacs-lisp, Size: 335 bytes --]

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

* Re: equivalent of (vm-subject-of msg) etc
  2005-05-18 10:01         ` Katsumi Yamaoka
@ 2005-05-18 13:31           ` Uwe Brauer
  0 siblings, 0 replies; 7+ messages in thread
From: Uwe Brauer @ 2005-05-18 13:31 UTC (permalink / raw)


>>>>> "Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>> In <87hdh06fzr.fsf@mat.ucm.es> Uwe Brauer wrote:
    >> I tried

    >> (add-hook 'gnus-article-mode-hook 'my-set-gnus-time)

    >> (defun my-set-gnus-time ()
    >> (interactive)
    >> (format-time-string
    >> "%b %d, %Y %T"
    >> (apply 'encode-time
    >> (parse-time-string
    >> (mail-header-date gnus-current-headers)))))

    >> But that did not work out, what is my mistake?

    Katsumi> The function only returns a string but it is never inserted or

Right, and I now realize this is precisely what I need for my main
talk to insert a string in my diary, together with the appropriate
(diary compatible)  date string.

Your other solution is also appreciated, thanks


Uwe 



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

end of thread, other threads:[~2005-05-18 13:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-17  9:28 equivalent of (vm-subject-of msg) etc Uwe Brauer
2005-05-17  9:55 ` Katsumi Yamaoka
2005-05-17 15:19   ` Uwe Brauer
2005-05-17 22:49     ` Katsumi Yamaoka
2005-05-18  9:27       ` Uwe Brauer
2005-05-18 10:01         ` Katsumi Yamaoka
2005-05-18 13:31           ` Uwe Brauer

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