Gnus development mailing list
 help / color / mirror / Atom feed
* message-(news|mail)-p in (gnus-)?message-setup-hook
@ 2003-02-28 14:33 Vasily Korytov
  2003-03-31 17:59 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Vasily Korytov @ 2003-02-28 14:33 UTC (permalink / raw)


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

Hi,

I have two variants of a function. It's suited for signing only the
mail messages (as opposed to the news postings).

(defun mml-vk-maybe-sign ()
  (unless (message-news-p)
    (mml-secure-message-sign-pgpmime)))

(defun mml-vk-maybe-sign ()
  (if (message-mail-p)
      (mml-secure-message-sign-pgpmime)))

They both work for new and replied messages in message-setup-hook. But
not in gnus-message-setup-hook. Well, they both work OK when composing
replies and followups, when called from that hook too. But not when
composing new messages. The if/unless condition is always false then.

Actually, it's not surprising, because when I evaluate (message-mail-p)
or (message-news-p) in a new message buffer, they're both nil. But I
didn't get, why do they work in message-setup-hook. Can anyone help me?

-- 
       I accept RFC3156 and RFC1991-compatible encrypted mail.
PGP key fingerprint: 123A 7CCE 6E26 6233 0D87 E01A A0F8 3524 FCD8 1841

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: message-(news|mail)-p in (gnus-)?message-setup-hook
  2003-02-28 14:33 message-(news|mail)-p in (gnus-)?message-setup-hook Vasily Korytov
@ 2003-03-31 17:59 ` Lars Magne Ingebrigtsen
  2003-03-31 18:50   ` Vasily Korytov
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-03-31 17:59 UTC (permalink / raw)


deskpot@myrealbox.com (Vasily Korytov) writes:

> Actually, it's not surprising, because when I evaluate (message-mail-p)
> or (message-news-p) in a new message buffer, they're both nil. But I
> didn't get, why do they work in message-setup-hook. Can anyone help me?

The composing functions bind `message-this-is-mail' (etc.) before
calling the hook functions.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: message-(news|mail)-p in (gnus-)?message-setup-hook
  2003-03-31 17:59 ` Lars Magne Ingebrigtsen
@ 2003-03-31 18:50   ` Vasily Korytov
  2003-04-01  2:40     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Vasily Korytov @ 2003-03-31 18:50 UTC (permalink / raw)


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

On 31 Mar 2003, Lars Magne Ingebrigtsen wrote:

> deskpot@myrealbox.com (Vasily Korytov) writes:
>
>> Actually, it's not surprising, because when I evaluate (message-mail-p)
>> or (message-news-p) in a new message buffer, they're both nil. But I
>> didn't get, why do they work in message-setup-hook. Can anyone help me?
>
> The composing functions bind `message-this-is-mail' (etc.) before
> calling the hook functions.

Maybe we should also bind it in gnus-message-setup-hook then?

-- 
       I accept RFC3156 and RFC2440-compatible encrypted mail.
PGP key fingerprint: 123A 7CCE 6E26 6233 0D87 E01A A0F8 3524 FCD8 1841

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: message-(news|mail)-p in (gnus-)?message-setup-hook
  2003-03-31 18:50   ` Vasily Korytov
@ 2003-04-01  2:40     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-04-01  2:40 UTC (permalink / raw)


deskpot@despammed.com (Vasily Korytov) writes:

>> The composing functions bind `message-this-is-mail' (etc.) before
>> calling the hook functions.
>
> Maybe we should also bind it in gnus-message-setup-hook then?

It's a Message variable, so you can't really expect it to be bound in
Gnus hooks.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

end of thread, other threads:[~2003-04-01  2:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-28 14:33 message-(news|mail)-p in (gnus-)?message-setup-hook Vasily Korytov
2003-03-31 17:59 ` Lars Magne Ingebrigtsen
2003-03-31 18:50   ` Vasily Korytov
2003-04-01  2:40     ` Lars Magne Ingebrigtsen

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