From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82015 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-summary-limit-to-author, can we change it? Date: Tue, 10 Jul 2012 08:11:27 +0200 Message-ID: <874npgp2ls.fsf@thinkpad.tsdh.de> References: <871uklkz33.fsf@ericabrahamsen.net> <87629xf8c3.fsf@thinkpad.tsdh.de> <87ipdwjucw.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1341900782 4873 80.91.229.3 (10 Jul 2012 06:13:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2012 06:13:02 +0000 (UTC) Cc: ding@gnus.org To: Eric Abrahamsen Original-X-From: ding-owner+M30285@lists.math.uh.edu Tue Jul 10 08:13:01 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SoTgx-0006Rz-Fz for ding-account@gmane.org; Tue, 10 Jul 2012 08:12:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1SoTfg-0006hY-5v; Tue, 10 Jul 2012 01:11:40 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1SoTfc-0006hN-AA for ding@lists.math.uh.edu; Tue, 10 Jul 2012 01:11:36 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1SoTfa-0000SK-FV for ding@lists.math.uh.edu; Tue, 10 Jul 2012 01:11:35 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1SoTfY-0008Jt-Om for ding@gnus.org; Tue, 10 Jul 2012 08:11:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 5D2E81A4056; Tue, 10 Jul 2012 08:11:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sbT-V6gN10Jr; Tue, 10 Jul 2012 08:11:30 +0200 (CEST) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from thinkpad.tsdh.de (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id AA7C41A4046; Tue, 10 Jul 2012 08:11:30 +0200 (CEST) In-Reply-To: <87ipdwjucw.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 10 Jul 2012 09:08:31 +0800") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82015 Archived-At: Eric Abrahamsen writes: Hi Eric, >>> "Limit to author (regexp, default from@under-point.com): " >> >> I've done exactly that right now. > > Patches! --8<---------------cut here---------------start------------->8--- diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index afc0231..b7711da 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -8239,14 +8239,17 @@ If NOT-MATCHING, excluding articles that have subjects that match a regexp." "Limit the summary buffer to articles that have authors that match a regexp. If NOT-MATCHING, excluding articles that have authors that match a regexp." (interactive - (list (read-string (if current-prefix-arg - "Exclude author (regexp): " - "Limit to author (regexp): ") - (let ((header (gnus-summary-article-header))) - (if (not header) - "" - (car (mail-header-parse-address - (mail-header-from header)))))) + (list (let* ((header (gnus-summary-article-header)) + (default (and header (car (mail-header-parse-address + (mail-header-from header)))))) + (read-string (concat (if current-prefix-arg + "Exclude author (regexp" + "Limit to author (regexp") + (if default + (concat ", default \"" default "\"): ") + "): ")) + nil nil + default)) current-prefix-arg)) (gnus-summary-limit-to-subject from "from" not-matching)) --8<---------------cut here---------------end--------------->8--- > What did you do specifically? I made the default email address show up in the prompt instead of having it prefilled. Or more technically, I've switched the INITIAL-INPUT with DEFAULT-VALUE in the call to `read-string' and adapted the prompt to show the default. ,----[ C-h f read-string RET ] | read-string is a built-in function in `C source code'. | | (read-string PROMPT &optional INITIAL-INPUT HISTORY DEFAULT-VALUE | INHERIT-INPUT-METHOD) | | Read a string from the minibuffer, prompting with string PROMPT. | If non-nil, second arg INITIAL-INPUT is a string to insert before reading. | This argument has been superseded by DEFAULT-VALUE and should normally | be nil in new code. It behaves as in `read-from-minibuffer'. See the | documentation string of that function for details. | The third arg HISTORY, if non-nil, specifies a history list | and optionally the initial position in the list. | See `read-from-minibuffer' for details of HISTORY argument. | Fourth arg DEFAULT-VALUE is the default value or the list of default values. | If non-nil, it is used for history commands, and as the value (or the first | element of the list of default values) to return if the user enters the | empty string. | Fifth arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | the current input method and the setting of `enable-multibyte-characters'. `---- Bye, Tassilo