From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82016 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-summary-limit-to-author, can we change it? Date: Tue, 10 Jul 2012 16:34:33 +0800 Message-ID: <87bojonheu.fsf@ericabrahamsen.net> References: <871uklkz33.fsf@ericabrahamsen.net> <87629xf8c3.fsf@thinkpad.tsdh.de> <87ipdwjucw.fsf@ericabrahamsen.net> <874npgp2ls.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1341909371 1872 80.91.229.3 (10 Jul 2012 08:36:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2012 08:36:11 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M30286@lists.math.uh.edu Tue Jul 10 10:36:09 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 1SoVvU-0005tI-Is for ding-account@gmane.org; Tue, 10 Jul 2012 10:36:08 +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 1SoVuI-0007Mp-87; Tue, 10 Jul 2012 03:34:54 -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 1SoVuF-0007Mc-G8 for ding@lists.math.uh.edu; Tue, 10 Jul 2012 03:34:51 -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 1SoVuD-0000qM-J8 for ding@lists.math.uh.edu; Tue, 10 Jul 2012 03:34:50 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1SoVuB-0003N9-IJ for ding@gnus.org; Tue, 10 Jul 2012 10:34:47 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SoVu9-0004BP-8U for ding@gnus.org; Tue, 10 Jul 2012 10:34:45 +0200 Original-Received: from 221.216.161.175 ([221.216.161.175]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Jul 2012 10:34:45 +0200 Original-Received: from eric by 221.216.161.175 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Jul 2012 10:34:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 84 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 221.216.161.175 X-Pgp-Key: http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0xC98BAE7B99D0D373 X-Pgp-Fingerprint: 8E19 28A9 2B51 0C67 565D DB34 C98B AE7B 99D0 D373 User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:CvDi2AqNDNx2rp3Lm7Er5MtHS0E= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82016 Archived-At: On Tue, Jul 10 2012, Tassilo Horn wrote: > Eric Abrahamsen writes: > > Hi Eric, > >>>> "Limit to author (regexp, default from@under-point.com): " >>> >>> I've done exactly that right now. >> >> Patches! Excellent! This is exactly what I was telling myself I would eventually get around to doing. I vote this be accepted! I move? I petition? I supplicate? What sort of political structure do we have here anyway? > 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)) > >> 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 > > -- GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-07-08 on pellet Ma Gnus v0.6