[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Info index completion in Emacs 21
From: |
address@hidden |
Subject: |
Info index completion in Emacs 21 |
Date: |
24 Nov 2006 00:49:17 -0800 |
User-agent: |
G2/1.0 |
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))))
- Info index completion in Emacs 21,
address@hidden <=