Gnus development mailing list
 help / color / mirror / Atom feed
* get header value when replying
@ 2003-10-05 21:49 Denis Dzyubenko
  2003-10-06 18:35 ` Denis Dzyubenko
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Dzyubenko @ 2003-10-05 21:49 UTC (permalink / raw)


Hello,

Is it possible to get value of To: header in message-setup-hook ? In
the internet I found an example that uses message-reply-buffer
variable, but it is not documented, so I think it is not a good idea
to use it.

-- 
Denis.



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

* Re: get header value when replying
  2003-10-05 21:49 get header value when replying Denis Dzyubenko
@ 2003-10-06 18:35 ` Denis Dzyubenko
  2003-10-16 14:42   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Dzyubenko @ 2003-10-06 18:35 UTC (permalink / raw)


On Mon, 06 Oct 2003 01:49:33 +0400,
 Denis Dzyubenko(DD) wrote to ding:

DD> Hello,
DD> Is it possible to get value of To: header in message-setup-hook ? In
DD> the internet I found an example that uses message-reply-buffer
DD> variable, but it is not documented, so I think it is not a good idea
DD> to use it.

I found a solution - using message-narrow-to-headers and string-match functions:
=+==
(defun my-message-get-header (header)
  "Return header value from current message"
  (let (my-match-start header-value)
    (save-excursion
      (save-restriction
	(message-narrow-to-headers)
	(if (string-match (concat "^" (regexp-quote header) ":") (buffer-string))
	    (progn
	      (setq my-match-start (+ (match-end 0) 1))
	      (goto-char my-match-start)
	      (end-of-line)
	      (setq header-value (buffer-substring my-match-start (point)))))))
    header-value))
=+==


Please tell me - how can I check if current message is reply (or
followup) in message-setup-hook? Is it "correct" to check value of
message-reply-headers:

(if message-reply-headers
    (progn
; this is a followup
      (dosomething))
  (progn
; this is new message
    (dosomethingelse)))


-- 
Denis.




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

* Re: get header value when replying
  2003-10-06 18:35 ` Denis Dzyubenko
@ 2003-10-16 14:42   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-10-16 14:42 UTC (permalink / raw)


Denis Dzyubenko <shad@mail.kubtelecom.ru> writes:

> Please tell me - how can I check if current message is reply (or
> followup) in message-setup-hook? Is it "correct" to check value of
> message-reply-headers:

Yes, I think that's probably the easiest way to see whether it's a
new message or not.  Or you could check for "Re: " in the Subject.
:-)

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



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

end of thread, other threads:[~2003-10-16 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-05 21:49 get header value when replying Denis Dzyubenko
2003-10-06 18:35 ` Denis Dzyubenko
2003-10-16 14:42   ` 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).