From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54177 Path: main.gmane.org!not-for-mail From: Denis Dzyubenko Newsgroups: gmane.emacs.gnus.general Subject: Re: get header value when replying Date: Mon, 06 Oct 2003 22:35:46 +0400 Sender: ding-owner@lists.math.uh.edu Message-ID: <87k77ii58d.fsf@mail.kubtelecom.ru> References: <87isn3qrrm.fsf@mail.kubtelecom.ru> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1065465657 23527 80.91.224.253 (6 Oct 2003 18:40:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Oct 2003 18:40:57 +0000 (UTC) Original-X-From: ding-owner+M2718@lists.math.uh.edu Mon Oct 06 20:40:55 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A6aHv-0008GX-00 for ; Mon, 06 Oct 2003 20:40:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1A6aHf-0004d8-00; Mon, 06 Oct 2003 13:40:39 -0500 Original-Received: from justine.libertine.org ([66.139.78.221]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1A6aHa-0004d3-00 for ding@lists.math.uh.edu; Mon, 06 Oct 2003 13:40:35 -0500 Original-Received: from mail.kubtelecom.ru (pro.kubtelecom.ru [213.132.64.82]) by justine.libertine.org (Postfix) with SMTP id 59E393A0062 for ; Mon, 6 Oct 2003 13:40:31 -0500 (CDT) Original-Received: (qmail 60180 invoked from network); 6 Oct 2003 22:40:16 +0400 (MSD) Original-Received: from unknown (HELO station) (213.132.67.164) by pro.kubtelecom.ru with SMTP; 6 Oct 2003 22:40:16 +0400 (MSD) Original-Received: from shad by station with local (Exim 3.35 #1 (Debian)) id 1A6aCw-0002WI-00 for ; Mon, 06 Oct 2003 22:35:46 +0400 Original-To: ding@gnus.org In-Reply-To: <87isn3qrrm.fsf@mail.kubtelecom.ru> (Denis Dzyubenko's message of "Mon, 06 Oct 2003 01:49:33 +0400") User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Common Lisp, linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:54177 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:54177 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.