all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <Stephen.Berman@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Opening an info page by command name, take 2
Date: Thu, 13 Dec 2007 10:09:29 +0100	[thread overview]
Message-ID: <877ijj9d12.fsf@escher.local.home> (raw)
In-Reply-To: 840625.36398.qm@web25412.mail.ukl.yahoo.com

On Tue, 11 Dec 2007 21:49:59 +0100 (CET) <rdiezmail-emacs@yahoo.de> wrote:

> Hi all:
>
> I recently posted in this list about opening an Info page in emacs by
> command name, and I did get some replies, thanks a lot.
>
> Unfortunately, I'm still missing one piece of the equation: how do I
> know the Info page name beforehand?
>
> Say I want to get help about grep and also about gzip. With man I would
> just type "man grep" and "man gzip". From the command line I can type
> "info grep" and "info gzip" and get similar pages. With emacs, if I
> only now the words "grep" and "gzip", I cannot open those pages.
>
> For example, these are two suggestions I got on my last post:
>
>   emacs -Q --eval '(info "(bash3ref)Arrays")'
>
>   emacsclientw -e "(info \"(elisp) Lists\")"
>
> The question is, where did "(bash3ref)Arrays" and "(elisp) Lists" come
> from? You would have to browse the Info pages beforehand, wouldn't you?
> But that defeats the purpose. I would want to call some (info "bash")
> routine and get the same page as with "info bash" from the command
> line, but the info routine in emacs does not find the same page, it
> doesn't find anything under "bash" or "grep" or "gzip" alone.

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)))

Steve Berman

  parent reply	other threads:[~2007-12-13  9:09 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 [this message]
2007-12-13 10:56   ` Sebastian Tennant
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=877ijj9d12.fsf@escher.local.home \
    --to=stephen.berman@gmx.net \
    --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.