all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Info index completion in Emacs 21
@ 2006-11-24  8:49 spamfilteraccount
  2006-11-24 18:06 ` Drew Adams
       [not found] ` <mailman.1064.1164424546.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: spamfilteraccount @ 2006-11-24  8:49 UTC (permalink / raw)


This bothered me for a long a time, so I came up with a quick solution.
Naturally, I only checked afterwards if someone posted a solution for
this already. Sigh.

Anyway, here it is if anyone's interested. I tested it with Elisp info
and it seemed to work correctly:



(add-hook 'Info-mode-hook (lambda ()
                            (define-key Info-mode-map "i"
'my-info-index)))


(defun my-info-index ()
  "Go to an index item in info with completion."
  (interactive)
  (Info-index "")
  (let ((pattern "\\* +\\([^:]*\\):.")
        completions)
    (goto-char (point-min))
    (while (re-search-forward pattern nil t)
      (push (list (match-string 1)) completions))
    (Info-index (completing-read "Index topic: " completions nil t))))

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

* RE: Info index completion in Emacs 21
  2006-11-24  8:49 Info index completion in Emacs 21 spamfilteraccount
@ 2006-11-24 18:06 ` Drew Adams
       [not found] ` <mailman.1064.1164424546.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2006-11-24 18:06 UTC (permalink / raw)


> (defun my-info-index ()
>   "Go to an index item in info with completion."
>   (interactive)
>   (Info-index "")
>   (let ((pattern "\\* +\\([^:]*\\):.")
>         completions)
>     (goto-char (point-min))
>     (while (re-search-forward pattern nil t)
>       (push (list (match-string 1)) completions))
>     (Info-index (completing-read "Index topic: " completions nil t))))

In a related vein, in Icicle (minor) mode, `i' in Info gives you both regexp
(e.g. substring) and prefix completion. It is also a multi-command, so you
can easily browse multiple matches, selectively or in any order. See
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Info_Enhancements.

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

* Re: Info index completion in Emacs 21
       [not found] ` <mailman.1064.1164424546.2155.help-gnu-emacs@gnu.org>
@ 2006-11-26 10:51   ` spamfilteraccount
  2006-11-26 16:47     ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: spamfilteraccount @ 2006-11-26 10:51 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 923 bytes --]


Drew Adams írta:
> > (defun my-info-index ()
> >   "Go to an index item in info with completion."
> >   (interactive)
> >   (Info-index "")
> >   (let ((pattern "\\* +\\([^:]*\\):.")
> >         completions)
> >     (goto-char (point-min))
> >     (while (re-search-forward pattern nil t)
> >       (push (list (match-string 1)) completions))
> >     (Info-index (completing-read "Index topic: " completions nil t))))
>
> In a related vein, in Icicle (minor) mode, `i' in Info gives you both regexp
> (e.g. substring) and prefix completion. It is also a multi-command, so you
> can easily browse multiple matches, selectively or in any order. See
> http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Info_Enhancements.

Isn't it true only for Emacs 22? I have Emacs 21 and I use Icicles, but
there `i' doesn't offer any completion, that's why I had to wrote the
above snippet.

Am I missing something?

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

* RE: Info index completion in Emacs 21
  2006-11-26 10:51   ` spamfilteraccount
@ 2006-11-26 16:47     ` Drew Adams
  2006-11-26 18:47       ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2006-11-26 16:47 UTC (permalink / raw)


> > In a related vein, in Icicle (minor) mode, `i' in Info gives 
> > you both regexp (e.g. substring) and prefix completion.
> > It is also a multi-command, so you can easily browse multiple
> > matches, selectively or in any order. See
> > http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Info_Enhancements.
> 
> Isn't it true only for Emacs 22? I have Emacs 21 and I use Icicles, but
> there `i' doesn't offer any completion, that's why I had to wrote the
> above snippet.

Correct. I forgot to mention that, but the URL above mentions it.

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

* RE: Info index completion in Emacs 21
  2006-11-26 16:47     ` Drew Adams
@ 2006-11-26 18:47       ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2006-11-26 18:47 UTC (permalink / raw)


> > > In a related vein, in Icicle (minor) mode, `i' in Info gives
> > > you both regexp (e.g. substring) and prefix completion.
> > > It is also a multi-command, so you can easily browse multiple
> > > matches, selectively or in any order. See
> > > http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Info_Enhancements.
> >
> > Isn't it true only for Emacs 22? I have Emacs 21 and I use Icicles, but
> > there `i' doesn't offer any completion, that's why I had to wrote the
> > above snippet.
>
> Correct. I forgot to mention that, but the URL above mentions it.

FYI - With Tamas's permission, I've incorporated his command into Icicles,
so users of Emacs < version 22 can also use multi-command completion to
navigate Info indexes:
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Info_Enhancements.

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

end of thread, other threads:[~2006-11-26 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-24  8:49 Info index completion in Emacs 21 spamfilteraccount
2006-11-24 18:06 ` Drew Adams
     [not found] ` <mailman.1064.1164424546.2155.help-gnu-emacs@gnu.org>
2006-11-26 10:51   ` spamfilteraccount
2006-11-26 16:47     ` Drew Adams
2006-11-26 18:47       ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.