From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Reply-To -> CC? Date: Sun, 20 Dec 2020 09:47:25 -0800 Message-ID: <87im8w8j4i.fsf@ericabrahamsen.net> References: <87pn352ogh.fsf@web.de> <87ft41dt3z.fsf@codeisgreat.org> <87k0tdqcl7.fsf@web.de> <87h7ohnj7y.fsf@codeisgreat.org> <878s9tqbo7.fsf@web.de> <87lfdtnemb.fsf@ericabrahamsen.net> <87pn34narx.fsf@codeisgreat.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3261"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:JB3Ek5O571vAm796PZ2cIZgA1c0= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 20 18:47:53 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kr2oD-0000lq-Ij for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Dec 2020 18:47:53 +0100 Original-Received: from localhost ([::1]:32826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kr2oC-0002Ch-MH for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Dec 2020 12:47:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kr2nu-0002Ca-0i for help-gnu-emacs@gnu.org; Sun, 20 Dec 2020 12:47:34 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:51224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kr2ns-0002r4-KD for help-gnu-emacs@gnu.org; Sun, 20 Dec 2020 12:47:33 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kr2nq-0000LN-LZ for help-gnu-emacs@gnu.org; Sun, 20 Dec 2020 18:47:30 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126654 Archived-At: Pankaj Jangid writes: > Eric Abrahamsen writes: > >>>> >> This is possible with ‘Posting Styles’. Something like this, >>>> >> >>>> >> (message-to-A-p ;; A function predicate >>>> >> (CC "B ")) >>>> > >>>> > Does this also work when composing a new mail, or only when replying? >>>> >>>> Yes. It should work with all the messages. >>> >>> And Gnus modifies the header silently before sending? Without >>> additional setup? >> >> I don't think so: posting styles only work when replying to a message in >> a particular group, or composing a new message "from" a group using "C-u >> m" or "C-u a" while point is on that particular group. > > It works for a group if the fist element is a regexp. Quoting from the > doc: > > The first element in each style is called the ‘match’. If it’s a > string, then Gnus will try to regexp match it against the group name. > If it is the form ‘(header MATCH REGEXP)’, then Gnus will look in the > original article for a header whose name is MATCH and compare that > REGEXP. MATCH and REGEXP are strings. (The original article is the one > you are replying or following up to. If you are not composing a reply > or a followup, then there is nothing to match against.) If the ‘match’ > is a function symbol, that function will be called with no arguments. > If it’s a variable symbol, then the variable will be referenced. If > it’s a list, then that list will be ‘eval’ed. In any case, if this > returns a non-‘nil’ value, then the style is said to “match”. > > See “If the ‘match’ is a function symbol”. Right, that's pretty much what I was saying.