From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs 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) Message-ID: References: <87tx6f766x.fsf@naesten.mooo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1405655307 21282 80.91.229.3 (18 Jul 2014 03:48:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jul 2014 03:48:27 +0000 (UTC) To: Samuel Bronson , 18044@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 18 05:48:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X7z9h-000776-2k for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 Jul 2014 05:48:21 +0200 Original-Received: from localhost ([::1]:47799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7z9g-0004Wi-L1 for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Jul 2014 23:48:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7z9W-0004Vl-8w for bug-gnu-emacs@gnu.org; Thu, 17 Jul 2014 23:48:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7z9O-00040Q-MD for bug-gnu-emacs@gnu.org; Thu, 17 Jul 2014 23:48:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7z9O-00040M-Ii for bug-gnu-emacs@gnu.org; Thu, 17 Jul 2014 23:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X7z9O-0006ZJ-A9 for bug-gnu-emacs@gnu.org; Thu, 17 Jul 2014 23:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Jul 2014 03:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18044 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18044-submit@debbugs.gnu.org id=B18044.140565527825240 (code B ref 18044); Fri, 18 Jul 2014 03:48:02 +0000 Original-Received: (at 18044) by debbugs.gnu.org; 18 Jul 2014 03:47:58 +0000 Original-Received: from localhost ([127.0.0.1]:57761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X7z9J-0006Z1-TV for submit@debbugs.gnu.org; Thu, 17 Jul 2014 23:47:58 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:46647) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X7z9I-0006Yo-8F for 18044@debbugs.gnu.org; Thu, 17 Jul 2014 23:47:57 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s6I3llD4014460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Jul 2014 03:47:48 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s6I3lkX8023386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Jul 2014 03:47:47 GMT Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6I3lk4i006256; Fri, 18 Jul 2014 03:47:46 GMT In-Reply-To: <87tx6f766x.fsf@naesten.mooo.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91616 Archived-At: > 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