GNU bug report logs - #18044
24.3; `info-display-manual' should use completing input for manual name

Previous Next

Package: emacs;

Reported by: Samuel Bronson <naesten <at> gmail.com>

Date: Fri, 18 Jul 2014 02:28:02 UTC

Severity: wishlist

Tags: moreinfo

Found in version 24.3

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Samuel Bronson <naesten <at> gmail.com>, 18044 <at> debbugs.gnu.org
Subject: bug#18044: 24.3; `info-display-manual' should use completing input for manual name
Date: Thu, 17 Jul 2014 20:47:45 -0700 (PDT)
> I think it would be possible to extract the necessary machinery from the
> function `Info-read-node-name' and its -1/-2 friends, but I don't grok
> completion well enough to do it myself, and one of the core
> (not-info-specific) completion functions involved isn't even documented.

Righto.  info+.el has done that for a long time, with this defun:

;; REPLACE ORIGINAL in `info.el':
;;
;; Use completion for inputting the manual name.
;;
(defun info-display-manual (manual)
  "Go to Info buffer that displays MANUAL, creating if it does not exist."
  ;;  (interactive "sManual name: ")
  (interactive
   (let ((manuals  ()))
     (condition-case nil
         (with-temp-buffer
           (Info-mode)
           (Info-directory)
           (goto-char (point-min))
           (re-search-forward "\\* Menu: *\n" nil t)
           (let (manual)
             (while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t)
               (setq manual  (match-string 1))
               (set-text-properties 0 (length manual) nil manual)
               (add-to-list 'manuals (list manual)))))
       (error nil))
     (list (completing-read "Display manual: " manuals))))
  (let ((blist (buffer-list))
        (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
        (case-fold-search t)
        found)
    (dolist (buffer blist)
      (with-current-buffer buffer
        (when (and (eq major-mode 'Info-mode)
                   (stringp Info-current-file)
                   (string-match manual-re Info-current-file))
          (setq found  buffer
                blist  ()))))
    (if found
        (switch-to-buffer found)
      (info-initialize)
      (info (Info-find-file manual)))))

http://www.emacswiki.org/InfoPlus
http://www.emacswiki.org/emacs-en/download/info%2b.el




This bug report was last modified 3 years and 316 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.