all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sebastian Tennant <sebyte@smolny.plus.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Opening an info page by command name, take 2
Date: Thu, 13 Dec 2007 12:56:43 +0200	[thread overview]
Message-ID: <87fxy6dfro.fsf@moley.moleskin.org> (raw)
In-Reply-To: 877ijj9d12.fsf@escher.local.home

Quoth Stephen Berman <Stephen.Berman@gmx.net>:
> Here's something that may help you.
>
> (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)))

A handy function that provides completion on a sensible subset of the
files actually found in the info directory, but the OP was interested in
opening info (in emacs) directly from the command line.

Sebastian

  reply	other threads:[~2007-12-13 10:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-11 20:49 Opening an info page by command name, take 2 rdiezmail-emacs
2007-12-11 21:30 ` Sebastian Tennant
2007-12-11 21:48   ` Lennart Borgman (gmail)
2007-12-12  4:12 ` Eli Zaretskii
2007-12-13  9:09 ` Stephen Berman
2007-12-13 10:56   ` Sebastian Tennant [this message]
2007-12-13 12:34     ` Stephen Berman
     [not found] <mailman.4893.1197406212.18990.help-gnu-emacs@gnu.org>
2007-12-11 23:09 ` David Kastrup
2007-12-12 17:11   ` Harald Hanche-Olsen
2007-12-13 11:16 ` 方旭亮

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fxy6dfro.fsf@moley.moleskin.org \
    --to=sebyte@smolny.plus.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.