From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Make `r` and `F` behave as `S L` when replying to a message from a mailing list Date: Sat, 15 Nov 2014 14:20:40 +0100 Organization: Aioe.org NNTP Server Message-ID: <87zjbszjkn.fsf__40503.4803240143$1416057626$gmane$org@debian.uxu> References: <545b8f0a$0$2898$426a34cc@news.free.fr> <545c8c5b$0$1989$426a74cc@news.free.fr> <87k336eru8.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1416057626 20897 80.91.229.3 (15 Nov 2014 13:20:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2014 13:20:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 15 14:20:19 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XpdH0-0002UG-JM for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Nov 2014 14:20:18 +0100 Original-Received: from localhost ([::1]:40375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpdH0-0002LN-6v for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Nov 2014 08:20:18 -0500 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.gnus,gnu.emacs.help Original-Followup-To: gnu.emacs.gnus Original-Lines: 62 Original-NNTP-Posting-Host: feB02bRejf23rfBm51Mt7Q.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:fY6QPMhjffhXRmeMW2iAei0Tu+A= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.gnus:88364 gnu.emacs.help:208653 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100931 Archived-At: Denis Bitouzé writes: > Meanwhile, I noticed that `R` gives the expected > result (To: is the mailing address). But what is > still annoying me is to be careful to the keybinding > I have to use depending on whether I'm answering a > mail or a usenet article. Yes, I agree that isn't good. In terms of programming, it is super-easy to fix as well. It is more an issue of knowing the domains (mails, listbots, news, and Gnus), which might not be that easy... like, at all! > Unfortunately, elisp is not my mother tongue. > Suppose I'd like to use `R` as unique keybinding > both in `debian.user` group (mailing list) and in > `nntp+gmane:gmane.emacs.gnus.user` group (usenet > forum), what would be the corresponding code? Again, Elisp doesn't have to be your mother tongue for this. However, if you are a perfectionist (as I am, so I'm not criticizing) perhaps you should make it your mother tongue... But try this: (require 'gnus-msg) (defun gnus-article-reply-dwim () (interactive) (if (gnus-article-header-value "X-Mailing-List") (gnus-summary-reply-to-list-with-original 1) (gnus-article-followup-with-original) )) (defun gnus-article-header-value (header) "Get the value of HEADER for the current article." (with-current-buffer gnus-original-article-buffer (gnus-fetch-field header) )) I just wrote and tried it, and it worked for debian.user (mailing list), alt.test (newsgroup), and a couple of inbox love letters (ordinary mail). It will work for ordinary mails and newsgroups, because that is the plain old `gnus-article-followup-with-original'. However I'm not sure if all mailing lists respect the X-Mailing-List header...? (Could be a place to add more such tests and OR them.) Also, I don't know what the 1 argument to `gnus-summary-reply-to-list-with-original' means because that isn't in the documentation, and I didn't feel like tracing it. It probably (?) has to do with doing things to several messages. I don't know if that should be 0 or 1 in this case. Last, `gnus-summary-reply-to-list-with-original' is in gnus-msg, and not gnus-sum. Just mentioning it as it looks a bit confusing :) -- underground experts united