Gnus development mailing list
 help / color / mirror / Atom feed
* Fancy completion
@ 2010-08-30  2:54 Lars Magne Ingebrigtsen
  2010-08-30  3:07 ` Leo
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30  2:54 UTC (permalink / raw)
  To: ding

Wouldn't it be nice if `j' in the Group buffer did completion in a
more...  sloppy manner?  I mean, I have a gazillion groups with names
that start with "nntp+news.gmane.org:...".  But I know I want the
boingboing group.  So if I wrote `j boingboing TAB', it would be nice if
it completed that to the group name.

Does Emacs have a built-in completion function that does stuff like that
now, given a collection?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Fancy completion
  2010-08-30  2:54 Fancy completion Lars Magne Ingebrigtsen
@ 2010-08-30  3:07 ` Leo
  2010-08-30  3:12   ` Lars Magne Ingebrigtsen
  2010-08-30  3:08 ` Leo
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 29+ messages in thread
From: Leo @ 2010-08-30  3:07 UTC (permalink / raw)
  To: ding

On 2010-08-30 03:54 +0100, Lars Magne Ingebrigtsen wrote:
> Wouldn't it be nice if `j' in the Group buffer did completion in a
> more...  sloppy manner?  I mean, I have a gazillion groups with names
> that start with "nntp+news.gmane.org:...".  But I know I want the
> boingboing group.  So if I wrote `j boingboing TAB', it would be nice if
> it completed that to the group name.
>
> Does Emacs have a built-in completion function that does stuff like that
> now, given a collection?

Check out completion-styles. I think it allows one to type *boingboing
and complete to candidates containing boingboing.

Leo




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

* Re: Fancy completion
  2010-08-30  2:54 Fancy completion Lars Magne Ingebrigtsen
  2010-08-30  3:07 ` Leo
@ 2010-08-30  3:08 ` Leo
  2010-08-30  8:01 ` Adam Sjøgren
  2010-08-30 12:19 ` Julien Danjou
  3 siblings, 0 replies; 29+ messages in thread
From: Leo @ 2010-08-30  3:08 UTC (permalink / raw)
  To: ding

On 2010-08-30 03:54 +0100, Lars Magne Ingebrigtsen wrote:
> Does Emacs have a built-in completion function that does stuff like that
> now, given a collection?

BTW, Stefan is very active in improving the new completion code. So you
can make feature request.

Leo




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

* Re: Fancy completion
  2010-08-30  3:07 ` Leo
@ 2010-08-30  3:12   ` Lars Magne Ingebrigtsen
  2010-08-30  3:18     ` Lars Magne Ingebrigtsen
  2010-08-30  3:44     ` Leo
  0 siblings, 2 replies; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30  3:12 UTC (permalink / raw)
  To: ding

Leo <sdl.web@gmail.com> writes:

> Check out completion-styles. I think it allows one to type *boingboing
> and complete to candidates containing boingboing.

That's awesome.  Is that something only users are supposed to meddle
with, or does it make sense just to add `substring' to the list just for
the `j' command?  Like thus? 

diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el
index 7a88773..f9f9707 100644
--- a/lisp/gnus-group.el
+++ b/lisp/gnus-group.el
@@ -2202,7 +2202,9 @@ be permanent."
 The arguments are the same as `completing-read' except that COLLECTION
 and HIST default to `gnus-active-hashtb' and `gnus-group-history'
 respectively if they are omitted."
-  (let (group)
+  (let ((completion-styles completion-styles)
+	group)
+    (push 'substring completion-styles)
     (mapatoms (lambda (symbol)
 		(setq group (symbol-name symbol))
 		(set (intern (if (string-match "[^\000-\177]" group)


-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Fancy completion
  2010-08-30  3:12   ` Lars Magne Ingebrigtsen
@ 2010-08-30  3:18     ` Lars Magne Ingebrigtsen
  2010-08-30  3:44     ` Leo
  1 sibling, 0 replies; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30  3:18 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> +    (push 'substring completion-styles)

Hm.

If I type "boing" and then TAB, then I get the group I want.

On the other hand, if I type "linux.kernel", and then TAB, I get:

nntp+news.gmane.org:gmane..linux.kernel

And then if I TAB again, I'm told that there are no matches.

That can't be right.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Fancy completion
  2010-08-30  3:12   ` Lars Magne Ingebrigtsen
  2010-08-30  3:18     ` Lars Magne Ingebrigtsen
@ 2010-08-30  3:44     ` Leo
  2010-08-30 16:25       ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 29+ messages in thread
From: Leo @ 2010-08-30  3:44 UTC (permalink / raw)
  To: ding

On 2010-08-30 04:12 +0100, Lars Magne Ingebrigtsen wrote:
> That's awesome.  Is that something only users are supposed to meddle
> with, or does it make sense just to add `substring' to the list just for
> the `j' command?  Like thus? 

I think the idea is users customise completion-styles and get the kind
of completions they like everywhere. For example I set it to (basic
initials partial-completion). (substring is a new addition to Emacs 24).
But if you want to force certain type of completion you probably need to
meddle with completion-styles although I don't know if it will work.

There are also completion-at-point-functions and
completion-in-region-functions offering complete control of how
completion works.

completion-at-point-functions is usually set by modes for example
emacs-lisp-mode sets completion-at-point-functions.

The code is new so it may have bugs and missing features. But Stefan
Monnier is committed to making this completion code a default in as many
places as possible which is a good thing in my view.

Cheers,
Leo




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

* Re: Fancy completion
  2010-08-30  2:54 Fancy completion Lars Magne Ingebrigtsen
  2010-08-30  3:07 ` Leo
  2010-08-30  3:08 ` Leo
@ 2010-08-30  8:01 ` Adam Sjøgren
  2010-08-30 19:54   ` Andreas Schwab
  2010-08-31  6:13   ` Reiner Steib
  2010-08-30 12:19 ` Julien Danjou
  3 siblings, 2 replies; 29+ messages in thread
From: Adam Sjøgren @ 2010-08-30  8:01 UTC (permalink / raw)
  To: ding

On Mon, 30 Aug 2010 04:54:40 +0200, Lars wrote:

> Wouldn't it be nice if `j' in the Group buffer did completion in a
> more...  sloppy manner?

It certainly would; I have skipped using j many times, because I was too
lazy to type nntp+blahblah before getting to the part that I cared
about.

(My fallback was to show all groups in the *Summary* and isearch there...)

> So if I wrote `j boingboing TAB', it would be nice if it completed
> that to the group name.

I think that would be perfect. Having to write '*' somewhere is less
desirable in my opinion, but I guess one can get used to that.

Whatsitcalled, fuzzy matching, or is that something else?


  Best regards,

     Adam

-- 
 "Gravity is arbitrary!"                                      Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: Fancy completion
  2010-08-30  2:54 Fancy completion Lars Magne Ingebrigtsen
                   ` (2 preceding siblings ...)
  2010-08-30  8:01 ` Adam Sjøgren
@ 2010-08-30 12:19 ` Julien Danjou
  2010-08-30 16:26   ` Lars Magne Ingebrigtsen
  3 siblings, 1 reply; 29+ messages in thread
From: Julien Danjou @ 2010-08-30 12:19 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

On Mon, Aug 30 2010, Lars Magne Ingebrigtsen wrote: 

> Wouldn't it be nice if `j' in the Group buffer did completion in 
> a more...  sloppy manner?  I mean, I have a gazillion groups 
> with names that start with "nntp+news.gmane.org:...".  But I 
> know I want the boingboing group.  So if I wrote `j boingboing 
> TAB', it would be nice if it completed that to the group name. 

Being able to use ido would be great too. :-)

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Fancy completion
  2010-08-30  3:44     ` Leo
@ 2010-08-30 16:25       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30 16:25 UTC (permalink / raw)
  To: ding

Leo <sdl.web@gmail.com> writes:

> But if you want to force certain type of completion you probably need to
> meddle with completion-styles although I don't know if it will work.

It does work, so I checked it in.  

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Fancy completion
  2010-08-30 12:19 ` Julien Danjou
@ 2010-08-30 16:26   ` Lars Magne Ingebrigtsen
  2010-08-30 16:33     ` Julien Danjou
  0 siblings, 1 reply; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30 16:26 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> Being able to use ido would be great too. :-)

Yes, that's true.  Is ido easy to interface with?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Fancy completion
  2010-08-30 16:26   ` Lars Magne Ingebrigtsen
@ 2010-08-30 16:33     ` Julien Danjou
  2010-08-30 16:43       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 29+ messages in thread
From: Julien Danjou @ 2010-08-30 16:33 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 370 bytes --]

On Mon, Aug 30 2010, Lars Magne Ingebrigtsen wrote: 

> Yes, that's true.  Is ido easy to interface with?

It really is.

Using `ido-completing-read' instead of `completing-read' if a user 
set `gnus-use-ido' to t would be a good solution.
It seems org-mode is doing this that way.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Fancy completion
  2010-08-30 16:33     ` Julien Danjou
@ 2010-08-30 16:43       ` Lars Magne Ingebrigtsen
  2010-08-30 17:03         ` Leo
  2010-08-30 17:16         ` Adam Sjøgren
  0 siblings, 2 replies; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30 16:43 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

Julien Danjou <julien@danjou.info> writes:

> Using `ido-completing-read' instead of `completing-read' if a user set
> gnus-use-ido' to t would be a good solution.

Hm...  I just tried replacing completing-read with the ido method, and
I got a backtrace.  So it wants a list instead of an obarray, but that's
easily enough fixed:

Debugger entered--Lisp error: (wrong-type-argument listp [nntp+news\.gmane\.org:gmane\.comp\...
  reverse([nntp+news\.gmane\.org:gmane\.comp\.ide\.anjuta\.us/...
  ido-set-matches()
  ido-read-internal(list "Group: " gnus-group-history nil nil nil)
  ido-completing-read("Group: " [nnt...

> It seems org-mode is doing this that way.

But I wonder if that's the wrong way to do it.  Wouldn't it make more
sense for the user to say

(ido-mode '(buffer file gnus org))

and then for Gnus to look at the ido-mode variable?  This requires a
change in ido-mode, of course, but doesn't it seem like a more clean way
for all the various packages to integrate with ido?

I've crossposted this to the Emacs list for feedback.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Fancy completion
  2010-08-30 16:43       ` Lars Magne Ingebrigtsen
@ 2010-08-30 17:03         ` Leo
  2010-08-30 17:16         ` Adam Sjøgren
  1 sibling, 0 replies; 29+ messages in thread
From: Leo @ 2010-08-30 17:03 UTC (permalink / raw)
  To: ding

On 2010-08-30 17:43 +0100, Lars Magne Ingebrigtsen wrote:
> Julien Danjou <julien@danjou.info> writes:
>
>> Using `ido-completing-read' instead of `completing-read' if a user set
>> gnus-use-ido' to t would be a good solution.
>
> Hm...  I just tried replacing completing-read with the ido method, and
> I got a backtrace.  So it wants a list instead of an obarray, but that's
> easily enough fixed:
>
> Debugger entered--Lisp error: (wrong-type-argument listp [nntp+news\.gmane\.org:gmane\.comp\...
>   reverse([nntp+news\.gmane\.org:gmane\.comp\.ide\.anjuta\.us/...
>   ido-set-matches()
>   ido-read-internal(list "Group: " gnus-group-history nil nil nil)
>   ido-completing-read("Group: " [nnt...

ido-completing-read doesn't support obarray etc. The doc-string says:

   CHOICES is a list of strings which are the possible completions.

Leo



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

* Re: Fancy completion
  2010-08-30 16:43       ` Lars Magne Ingebrigtsen
  2010-08-30 17:03         ` Leo
@ 2010-08-30 17:16         ` Adam Sjøgren
  2010-08-30 17:19           ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 29+ messages in thread
From: Adam Sjøgren @ 2010-08-30 17:16 UTC (permalink / raw)
  To: ding

When I press j now (1b1f1cd), I get:

  "Symbol's value as variable is void: completion-styles"


  Best regards,

    Adam

-- 
 "Are you talking to us from yesterday?"                      Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: Fancy completion
  2010-08-30 17:16         ` Adam Sjøgren
@ 2010-08-30 17:19           ` Lars Magne Ingebrigtsen
  2010-08-30 17:21             ` Leo
  2010-08-30 17:38             ` Adam Sjøgren
  0 siblings, 2 replies; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30 17:19 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> When I press j now (1b1f1cd), I get:
>
>   "Symbol's value as variable is void: completion-styles"

Oh, I guess XEmacs doesn't have `completion-styles'...  *sigh*

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Fancy completion
  2010-08-30 17:19           ` Lars Magne Ingebrigtsen
@ 2010-08-30 17:21             ` Leo
  2010-08-30 17:42               ` Adam Sjøgren
  2010-08-30 17:38             ` Adam Sjøgren
  1 sibling, 1 reply; 29+ messages in thread
From: Leo @ 2010-08-30 17:21 UTC (permalink / raw)
  To: ding

On 2010-08-30 18:19 +0100, Lars Magne Ingebrigtsen wrote:
> Oh, I guess XEmacs doesn't have `completion-styles'...  *sigh*

Can XEmacs use GPLv3 code?

Leo




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

* Re: Fancy completion
  2010-08-30 17:19           ` Lars Magne Ingebrigtsen
  2010-08-30 17:21             ` Leo
@ 2010-08-30 17:38             ` Adam Sjøgren
  2010-08-30 17:45               ` Leo
  1 sibling, 1 reply; 29+ messages in thread
From: Adam Sjøgren @ 2010-08-30 17:38 UTC (permalink / raw)
  To: ding

On Mon, 30 Aug 2010 19:19:36 +0200, Lars wrote:

> asjo@koldfront.dk (Adam Sjøgren) writes:
>> When I press j now (1b1f1cd), I get:
>> 
>> "Symbol's value as variable is void: completion-styles"

> Oh, I guess XEmacs doesn't have `completion-styles'...  *sigh*

I feel I am edging closer and closer to trying to switch...


  Yeah, *sigh*,

     Adam

-- 
 "Vegetarian progressive grindcore"                           Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: Fancy completion
  2010-08-30 17:21             ` Leo
@ 2010-08-30 17:42               ` Adam Sjøgren
  0 siblings, 0 replies; 29+ messages in thread
From: Adam Sjøgren @ 2010-08-30 17:42 UTC (permalink / raw)
  To: ding

On Mon, 30 Aug 2010 18:21:25 +0100, Leo wrote:

> On 2010-08-30 18:19 +0100, Lars Magne Ingebrigtsen wrote:
>> Oh, I guess XEmacs doesn't have `completion-styles'...  *sigh*

> Can XEmacs use GPLv3 code?

I think they have been working on going v3 for a while, and the current
status is "almost there", but...


  Best regards,

    Adam

-- 
 "Vegetarian progressive grindcore"                           Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: Fancy completion
  2010-08-30 17:38             ` Adam Sjøgren
@ 2010-08-30 17:45               ` Leo
  2010-08-30 17:53                 ` Lars Magne Ingebrigtsen
  2010-08-30 18:22                 ` Adam Sjøgren
  0 siblings, 2 replies; 29+ messages in thread
From: Leo @ 2010-08-30 17:45 UTC (permalink / raw)
  To: ding

On 2010-08-30 18:38 +0100, Adam Sjøgren wrote:
> I feel I am edging closer and closer to trying to switch...
>
>
>   Yeah, *sigh*,
>
>      Adam

It looks like the best way forward for the XEmacs project is to re-fork.
I think a huge amount of work has been merged into Emacs while XEmacs
stands still.

Leo




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

* Re: Fancy completion
  2010-08-30 17:45               ` Leo
@ 2010-08-30 17:53                 ` Lars Magne Ingebrigtsen
  2010-08-30 18:22                 ` Adam Sjøgren
  1 sibling, 0 replies; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30 17:53 UTC (permalink / raw)
  To: ding

Leo <sdl.web@gmail.com> writes:

> It looks like the best way forward for the XEmacs project is to re-fork.
> I think a huge amount of work has been merged into Emacs while XEmacs
> stands still.

Yeah...  since the Emacs maintainership changed a few years back, Emacs
development has really proceeded very quickly, while XEmacs has slowed
way down.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Fancy completion
  2010-08-30 17:45               ` Leo
  2010-08-30 17:53                 ` Lars Magne Ingebrigtsen
@ 2010-08-30 18:22                 ` Adam Sjøgren
  1 sibling, 0 replies; 29+ messages in thread
From: Adam Sjøgren @ 2010-08-30 18:22 UTC (permalink / raw)
  To: ding

On Mon, 30 Aug 2010 18:45:38 +0100, Leo wrote:

> It looks like the best way forward for the XEmacs project is to re-fork.

I don't think that makes sense.

> I think a huge amount of work has been merged into Emacs while XEmacs
> stands still.

More or less, yes.

I still like a lot of things about XEmacs better than GNU Emacs, so it
won't be easy for me to switch.


  :-),

   Adam

-- 
 "Vegetarian progressive grindcore"                           Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: Fancy completion
  2010-08-30  8:01 ` Adam Sjøgren
@ 2010-08-30 19:54   ` Andreas Schwab
  2010-08-30 19:59     ` Adam Sjøgren
  2010-08-31  6:13   ` Reiner Steib
  1 sibling, 1 reply; 29+ messages in thread
From: Andreas Schwab @ 2010-08-30 19:54 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> On Mon, 30 Aug 2010 04:54:40 +0200, Lars wrote:
>
>> Wouldn't it be nice if `j' in the Group buffer did completion in a
>> more...  sloppy manner?
>
> It certainly would; I have skipped using j many times, because I was too
> lazy to type nntp+blahblah before getting to the part that I cared
> about.

Have you tried gnus-group-jump-to-group-prompt?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: Fancy completion
  2010-08-30 19:54   ` Andreas Schwab
@ 2010-08-30 19:59     ` Adam Sjøgren
  2010-08-30 20:45       ` Andreas Schwab
  0 siblings, 1 reply; 29+ messages in thread
From: Adam Sjøgren @ 2010-08-30 19:59 UTC (permalink / raw)
  To: ding

On Mon, 30 Aug 2010 21:54:45 +0200, Andreas wrote:

> Have you tried gnus-group-jump-to-group-prompt?

No; I don't think it does what I want? (Completion on any substring).


  Best regards,

    Adam

-- 
 "Sunday morning when the rain begins to fall                 Adam Sjøgren
  I believe I have seen the end of it all"               asjo@koldfront.dk




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

* Re: Fancy completion
  2010-08-30 19:59     ` Adam Sjøgren
@ 2010-08-30 20:45       ` Andreas Schwab
  2010-08-31  2:07         ` Eric Abrahamsen
  0 siblings, 1 reply; 29+ messages in thread
From: Andreas Schwab @ 2010-08-30 20:45 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> On Mon, 30 Aug 2010 21:54:45 +0200, Andreas wrote:
>
>> Have you tried gnus-group-jump-to-group-prompt?
>
> No; I don't think it does what I want? (Completion on any substring).

No, but you can pre-fill the minibuffer with a prefix, and
partial-completion can do the rest.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: Fancy completion
  2010-08-30 20:45       ` Andreas Schwab
@ 2010-08-31  2:07         ` Eric Abrahamsen
  0 siblings, 0 replies; 29+ messages in thread
From: Eric Abrahamsen @ 2010-08-31  2:07 UTC (permalink / raw)
  To: ding

On Tue, Aug 31 2010, Andreas Schwab wrote:

> asjo@koldfront.dk (Adam Sjøgren) writes:
>
>> On Mon, 30 Aug 2010 21:54:45 +0200, Andreas wrote:
>>
>>> Have you tried gnus-group-jump-to-group-prompt?
>>
>> No; I don't think it does what I want? (Completion on any substring).
>
> No, but you can pre-fill the minibuffer with a prefix, and
> partial-completion can do the rest.
>
> Andreas.


I've been using this happily for a while, makes use of
ido-completing-read:

http://paste.lisp.org/display/36095,1/raw

hth,

Eric




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

* Re: Fancy completion
  2010-08-30  8:01 ` Adam Sjøgren
  2010-08-30 19:54   ` Andreas Schwab
@ 2010-08-31  6:13   ` Reiner Steib
  2010-08-31 21:12     ` Adam Sjøgren
  1 sibling, 1 reply; 29+ messages in thread
From: Reiner Steib @ 2010-08-31  6:13 UTC (permalink / raw)
  To: ding

On Mon, Aug 30 2010, Adam Sjøgren wrote:

> It certainly would; I have skipped using j many times, because I was too
> lazy to type nntp+blahblah before getting to the part that I cared
> about.

Did you try `gnus-group-jump-to-group-prompt'?

,----[ <f1> f gnus-group-jump-to-group RET ]
| gnus-group-jump-to-group is an interactive compiled Lisp function in
| `gnus-group.el'.
| (gnus-group-jump-to-group GROUP &optional PROMPT)
| 
| Jump to newsgroup GROUP.
| 
| If PROMPT (the prefix) is a number, use the prompt specified in
| `gnus-group-jump-to-group-prompt'.
`----

,----[ <f1> v gnus-group-jump-to-group-prompt RET ]
| gnus-group-jump-to-group-prompt is a variable defined in `gnus-group.el'.
| Its value is shown below.
| 
| Documentation:
| Default prompt for `gnus-group-jump-to-group'.
| 
| If non-nil, the value should be a string or an alist.  If it is a string,
| e.g. "nnml:", in which case `gnus-group-jump-to-group' offers "Group:
| nnml:" in the minibuffer prompt.
| 
| If it is an alist, it must consist of (NUMBER .  PROMPT) pairs, for example:
| ((1 .  "") (2 .  "nnfolder+archive:")).  The element with number 0 is
| used when no prefix argument is given to `gnus-group-jump-to-group'.
| 
| You can customize this variable.
| 
| Value: 
| ((0 "")
|  (1 "nnml+personal:")
|  (2 "nnml+news:")
|  (3 "nnml+archive:")
|  (11 "nnimap+foo:")
|  (12 "nnimap+bar:INBOX")
|  (21 "gmane."))
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Fancy completion
  2010-08-31  6:13   ` Reiner Steib
@ 2010-08-31 21:12     ` Adam Sjøgren
  2010-08-31 23:19       ` Andreas Schwab
  0 siblings, 1 reply; 29+ messages in thread
From: Adam Sjøgren @ 2010-08-31 21:12 UTC (permalink / raw)
  To: ding

On Tue, 31 Aug 2010 08:13:24 +0200, Reiner wrote:

> On Mon, Aug 30 2010, Adam Sjøgren wrote:
>> It certainly would; I have skipped using j many times, because I was too
>> lazy to type nntp+blahblah before getting to the part that I cared
>> about.

> Did you try `gnus-group-jump-to-group-prompt'?

No, and it does something slightly different from what I think I want.

I may be able to configure "nntp+news.gmane.org:" as a standard prefix,
but then I can't remember if the group is
"gmane.comp.emacs.gnus.general", "gmane.emacs.gnus.general" or
"gmane.gnu.emacs.gnus.general", and so it isn't of much help.

I'd rather just type "gnus TAB" and have completion return all groups that
matches that string anywhere. (Which is what I "emulate" with l C-s gnus).

On news.gwene.org the examples are even worse - I want to find the Boing
Boing feed, but is it com, org or maybe net? I wouldn't know.


  Best regards,

    Adam

-- 
 "Jabba the Hutt meets Rudolf the Reindeer. I                 Adam Sjøgren
  dunno, Mom."                                           asjo@koldfront.dk




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

* Re: Fancy completion
  2010-08-31 21:12     ` Adam Sjøgren
@ 2010-08-31 23:19       ` Andreas Schwab
  2010-08-31 23:29         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 29+ messages in thread
From: Andreas Schwab @ 2010-08-31 23:19 UTC (permalink / raw)
  To: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> I may be able to configure "nntp+news.gmane.org:" as a standard prefix,
> but then I can't remember if the group is
> "gmane.comp.emacs.gnus.general", "gmane.emacs.gnus.general" or
> "gmane.gnu.emacs.gnus.general", and so it isn't of much help.
>
> I'd rather just type "gnus TAB" and have completion return all groups that
> matches that string anywhere. (Which is what I "emulate" with l C-s gnus).

partial-completion should be able to provide that, as long as you start
with "nntp+news.gmane.org:gmane." as the initial input.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: Fancy completion
  2010-08-31 23:19       ` Andreas Schwab
@ 2010-08-31 23:29         ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 29+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-31 23:29 UTC (permalink / raw)
  To: ding

Andreas Schwab <schwab@linux-m68k.org> writes:

> partial-completion should be able to provide that, as long as you start
> with "nntp+news.gmane.org:gmane." as the initial input.

Yeah, but substring completion (in git Gnus now) is way, way nicer.  You
don't have to configure anything, and you just type what you seem to
half-remember, and most times, you get what you want.

ido-completion would be even better (since you get all the matches
listed after point), but I think that should be done with
(ido-mode 'gnus) and not the other way around.  Haven't gotten any
feedback on that, though...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

end of thread, other threads:[~2010-08-31 23:29 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-30  2:54 Fancy completion Lars Magne Ingebrigtsen
2010-08-30  3:07 ` Leo
2010-08-30  3:12   ` Lars Magne Ingebrigtsen
2010-08-30  3:18     ` Lars Magne Ingebrigtsen
2010-08-30  3:44     ` Leo
2010-08-30 16:25       ` Lars Magne Ingebrigtsen
2010-08-30  3:08 ` Leo
2010-08-30  8:01 ` Adam Sjøgren
2010-08-30 19:54   ` Andreas Schwab
2010-08-30 19:59     ` Adam Sjøgren
2010-08-30 20:45       ` Andreas Schwab
2010-08-31  2:07         ` Eric Abrahamsen
2010-08-31  6:13   ` Reiner Steib
2010-08-31 21:12     ` Adam Sjøgren
2010-08-31 23:19       ` Andreas Schwab
2010-08-31 23:29         ` Lars Magne Ingebrigtsen
2010-08-30 12:19 ` Julien Danjou
2010-08-30 16:26   ` Lars Magne Ingebrigtsen
2010-08-30 16:33     ` Julien Danjou
2010-08-30 16:43       ` Lars Magne Ingebrigtsen
2010-08-30 17:03         ` Leo
2010-08-30 17:16         ` Adam Sjøgren
2010-08-30 17:19           ` Lars Magne Ingebrigtsen
2010-08-30 17:21             ` Leo
2010-08-30 17:42               ` Adam Sjøgren
2010-08-30 17:38             ` Adam Sjøgren
2010-08-30 17:45               ` Leo
2010-08-30 17:53                 ` Lars Magne Ingebrigtsen
2010-08-30 18:22                 ` 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).