[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1761: 23.0.60; Can't reach info nodes that aren't in TOC
From: |
Stephen Berman |
Subject: |
bug#1761: 23.0.60; Can't reach info nodes that aren't in TOC |
Date: |
Fri, 02 Jan 2009 15:48:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
On Fri, 02 Jan 2009 03:01:27 -0500 David Abrahams <dave@boostpro.com> wrote:
> This is arguably a feature request, but it seems so glaring that you
> might consider it a bug. If I'm in an xterm and type `info dbus' I get
> a nice info session about emacs/dbus integration. But there doesn't
> seem to be any way to visit the same page from within emacs using
> info-mode other than `M-: (info "dbus")'. This seems needlessly
> inconvenient. `C-u M-x info <RET> dbus <RET>' ought to get me to the
> same node if there's no info file named "dbus" in the current working
> directory. Also, there should be some syntax to disambiguate:
> `C-u M-x info <RET> :dbus <RET>' maybe
I also wanted something like that, so I wrote this as a start:
(defun srb-info ()
"Enter Info at the Info file the user chooses, tabbing for completion.
If you type parentheses around the Info file name and then type a
node name, e.g. `(emacs)Buffers', then Info enters the file at
that node (completion for nodes below the file level is not
provided)."
(interactive)
(require 'info)
(let (files idx info-files info-file)
(dolist (d Info-default-directory-list files)
(when (file-readable-p d)
(setq files (cons (directory-files d) files))))
(setq files (append (car files) (cadr files)))
(dolist (f files)
(setq idx (string-match "\\." f))
(setq info-files (cons (substring f 0 idx) info-files)))
(dolist (f info-files)
(when (string-match "-[1-9][0-9]?$" f)
(setq info-files (delete f info-files))))
(setq info-file (completing-read "Info file name: " info-files))
(unless (string-match "^\([^ ]+\)" info-file)
(setq info-file (concat "(" info-file ")")))
(Info-goto-node info-file)))
Steve Berman