Gnus development mailing list
 help / color / mirror / Atom feed
From: Denis Dzyubenko <shad@mail.kubtelecom.ru>
Subject: Re: get header value when replying
Date: Mon, 06 Oct 2003 22:35:46 +0400	[thread overview]
Message-ID: <87k77ii58d.fsf@mail.kubtelecom.ru> (raw)
In-Reply-To: <87isn3qrrm.fsf@mail.kubtelecom.ru> (Denis Dzyubenko's message of "Mon, 06 Oct 2003 01:49:33 +0400")

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.




  reply	other threads:[~2003-10-06 18:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-05 21:49 Denis Dzyubenko
2003-10-06 18:35 ` Denis Dzyubenko [this message]
2003-10-16 14:42   ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k77ii58d.fsf@mail.kubtelecom.ru \
    --to=shad@mail.kubtelecom.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).