Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-summary-limit-to-author, can we change it?
@ 2012-07-09 10:28 Eric Abrahamsen
  2012-07-09 12:05 ` Tassilo Horn
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Abrahamsen @ 2012-07-09 10:28 UTC (permalink / raw)
  To: ding

Commit c79df675b50e367e228dde5f417fca33e60814d8 inserts the "from"
address of the message under point as the default address to use when
filtering with `gnus-summary-limit-to-author'.

I use this function all the time, and so far this behavior has not once
been what I want -- having to delete the default address adds a
cumbersome step to what was once my speediest method of finding recent
messages.

More user-friendly might be to use the "From" address of the message
under point as a default only if a blank string is given at the prompt.
So you hit `/ a', and you see:

"Limit to author (regexp, default from@under-point.com): "

Hit enter directly to limit to "from@under-point.com", or type a string
and enter to limit to that.

I'd be happy to submit a patch to this effect if the above sounds
acceptable. Might as well do it for all "limit-to" functions that
operate on a specific header too, right?

Yours,
Eric

-- 
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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-09 10:28 gnus-summary-limit-to-author, can we change it? Eric Abrahamsen
@ 2012-07-09 12:05 ` Tassilo Horn
  2012-07-10  1:08   ` Eric Abrahamsen
  0 siblings, 1 reply; 10+ messages in thread
From: Tassilo Horn @ 2012-07-09 12:05 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Commit c79df675b50e367e228dde5f417fca33e60814d8 inserts the "from"
> address of the message under point as the default address to use when
> filtering with `gnus-summary-limit-to-author'.
>
> I use this function all the time, and so far this behavior has not once
> been what I want -- having to delete the default address adds a
> cumbersome step to what was once my speediest method of finding recent
> messages.

Indeed, initial input is frequently annoying.

> More user-friendly might be to use the "From" address of the message
> under point as a default only if a blank string is given at the prompt.
> So you hit `/ a', and you see:
>
> "Limit to author (regexp, default from@under-point.com): "

I've done exactly that right now.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-09 12:05 ` Tassilo Horn
@ 2012-07-10  1:08   ` Eric Abrahamsen
  2012-07-10  6:11     ` Tassilo Horn
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Abrahamsen @ 2012-07-10  1:08 UTC (permalink / raw)
  To: ding

On Mon, Jul 09 2012, Tassilo Horn wrote:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Commit c79df675b50e367e228dde5f417fca33e60814d8 inserts the "from"
>> address of the message under point as the default address to use when
>> filtering with `gnus-summary-limit-to-author'.
>>
>> I use this function all the time, and so far this behavior has not once
>> been what I want -- having to delete the default address adds a
>> cumbersome step to what was once my speediest method of finding recent
>> messages.
>
> Indeed, initial input is frequently annoying.
>
>> More user-friendly might be to use the "From" address of the message
>> under point as a default only if a blank string is given at the prompt.
>> So you hit `/ a', and you see:
>>
>> "Limit to author (regexp, default from@under-point.com): "
>
> I've done exactly that right now.

Patches! What did you do specifically?

-- 
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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-10  1:08   ` Eric Abrahamsen
@ 2012-07-10  6:11     ` Tassilo Horn
  2012-07-10  8:34       ` Eric Abrahamsen
  0 siblings, 1 reply; 10+ messages in thread
From: Tassilo Horn @ 2012-07-10  6:11 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> 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



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-10  6:11     ` Tassilo Horn
@ 2012-07-10  8:34       ` Eric Abrahamsen
  2012-07-10 10:17         ` Tassilo Horn
  2012-07-10 12:54         ` Adam Sjøgren
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Abrahamsen @ 2012-07-10  8:34 UTC (permalink / raw)
  To: ding

On Tue, Jul 10 2012, Tassilo Horn wrote:

> Eric Abrahamsen <eric@ericabrahamsen.net> 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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-10  8:34       ` Eric Abrahamsen
@ 2012-07-10 10:17         ` Tassilo Horn
  2012-07-10 11:52           ` Eric Abrahamsen
  2012-07-10 12:54         ` Adam Sjøgren
  1 sibling, 1 reply; 10+ messages in thread
From: Tassilo Horn @ 2012-07-10 10:17 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

>>>>> "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?

Anarchy, what else!?!  Thus, I've already committed and pushed this
yesterday shortly before sending the "I've done exactly that right now"
mail. ;-)

  http://git.gnus.org/cgit/gnus.git/commit/?id=206e383b9779521052d9ac3f98c9acfe415275c1

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-10 10:17         ` Tassilo Horn
@ 2012-07-10 11:52           ` Eric Abrahamsen
  2012-07-10 12:07             ` Tassilo Horn
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Abrahamsen @ 2012-07-10 11:52 UTC (permalink / raw)
  To: ding

On Tue, Jul 10 2012, Tassilo Horn wrote:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>>>>>> "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?
>
> Anarchy, what else!?!  Thus, I've already committed and pushed this
> yesterday shortly before sending the "I've done exactly that right now"
> mail. ;-)
>
>   http://git.gnus.org/cgit/gnus.git/commit/?id=206e383b9779521052d9ac3f98c9acfe415275c1

Oh, I didn't realize I was talking to one of the inner circle! Hence my
demand for patches. Going to pull now…

And thank you!

Eric


-- 
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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-10 11:52           ` Eric Abrahamsen
@ 2012-07-10 12:07             ` Tassilo Horn
  2012-07-18 13:58               ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Tassilo Horn @ 2012-07-10 12:07 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Oh, I didn't realize I was talking to one of the inner circle!

I've said anarchy, not satanic lodge. ;-)

> And thank you!

You're very welcome.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-10  8:34       ` Eric Abrahamsen
  2012-07-10 10:17         ` Tassilo Horn
@ 2012-07-10 12:54         ` Adam Sjøgren
  1 sibling, 0 replies; 10+ messages in thread
From: Adam Sjøgren @ 2012-07-10 12:54 UTC (permalink / raw)
  To: ding

On Tue, 10 Jul 2012 16:34:33 +0800, Eric wrote:

> 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?

The person who commits first gets to fix any broken pieces?


  :-),

   Adam

-- 
 "I came from a household that showed as much                 Adam Sjøgren
  knowledge or interest in sport as hedgehogs show in    asjo@koldfront.dk
  embroidery."




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnus-summary-limit-to-author, can we change it?
  2012-07-10 12:07             ` Tassilo Horn
@ 2012-07-18 13:58               ` Ted Zlatanov
  0 siblings, 0 replies; 10+ messages in thread
From: Ted Zlatanov @ 2012-07-18 13:58 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: Eric Abrahamsen, ding

On Tue, 10 Jul 2012 14:07:21 +0200 Tassilo Horn <tassilo@member.fsf.org> wrote: 

TH> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>> Oh, I didn't realize I was talking to one of the inner circle!

TH> I've said anarchy, not satanic lodge. ;-)

It's the Gnus Cabal.  HTH.

Ted



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-07-18 13:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-09 10:28 gnus-summary-limit-to-author, can we change it? Eric Abrahamsen
2012-07-09 12:05 ` Tassilo Horn
2012-07-10  1:08   ` Eric Abrahamsen
2012-07-10  6:11     ` Tassilo Horn
2012-07-10  8:34       ` Eric Abrahamsen
2012-07-10 10:17         ` Tassilo Horn
2012-07-10 11:52           ` Eric Abrahamsen
2012-07-10 12:07             ` Tassilo Horn
2012-07-18 13:58               ` Ted Zlatanov
2012-07-10 12:54         ` Adam Sjøgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).