diff options
| author | Juri Linkov | 2013-01-08 02:11:51 +0200 |
|---|---|---|
| committer | Juri Linkov | 2013-01-08 02:11:51 +0200 |
| commit | c6a22ce23dad655c84f95bad1ed5191c2682f74e (patch) | |
| tree | 0f7172911cee10b0c86a2fe53a8cc5874ffe2c2b | |
| parent | acfe10b71c260718f72445cd984327c1d96063ab (diff) | |
| download | emacs-c6a22ce23dad655c84f95bad1ed5191c2682f74e.tar.gz emacs-c6a22ce23dad655c84f95bad1ed5191c2682f74e.zip | |
* lisp/info.el (Info-read-node-name-1): Allow empty node name in (FILENAME)
that defaults to the Top node.
(Info-goto-node, Info-read-node-name): Doc fix to mention that
the short format (FILENAME) goes to the Top node.
(Info-build-node-completions): Rename arg `file' to `filename'.
* doc/misc/info.texi (Go to node): Mention the abbreviated format
`(FILENAME)' equal to `(FILENAME)Top'.
Fixes: debbugs:13365
| -rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/misc/info.texi | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/info.el | 41 |
4 files changed, 40 insertions, 18 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 79214acc102..91a328198a2 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-08 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * info.texi (Go to node): Mention the abbreviated format | ||
| 4 | `(FILENAME)' equal to `(FILENAME)Top'. (Bug#13365) | ||
| 5 | |||
| 1 | 2013-01-06 Andreas Schwab <schwab@linux-m68k.org> | 6 | 2013-01-06 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 7 | ||
| 3 | * autotype.texi: Remove undefined command @subtitlefont. | 8 | * autotype.texi: Remove undefined command @subtitlefont. |
diff --git a/doc/misc/info.texi b/doc/misc/info.texi index 70dfffde393..d17a65571f1 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi | |||
| @@ -1079,7 +1079,8 @@ partial node name. | |||
| 1079 | node name by putting it at the front, in parentheses. Thus, | 1079 | node name by putting it at the front, in parentheses. Thus, |
| 1080 | @kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is | 1080 | @kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is |
| 1081 | the node @samp{Top} in the Info file @file{dir}. Likewise, | 1081 | the node @samp{Top} in the Info file @file{dir}. Likewise, |
| 1082 | @kbd{g(emacs)Top@key{RET}} goes to the top node of the Emacs manual. | 1082 | @kbd{g(emacs)Top@key{RET}} (or just @kbd{g(emacs)@key{RET}}) goes to the |
| 1083 | top node of the Emacs manual. | ||
| 1083 | 1084 | ||
| 1084 | The node name @samp{*} specifies the whole file. So you can look at | 1085 | The node name @samp{*} specifies the whole file. So you can look at |
| 1085 | all of the current file by typing @kbd{g*@key{RET}} or all of any | 1086 | all of the current file by typing @kbd{g*@key{RET}} or all of any |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 185bf74bc05..9b30294e65a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-01-08 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * info.el (Info-read-node-name-1): Allow empty node name in (FILENAME) | ||
| 4 | that defaults to the Top node. | ||
| 5 | (Info-goto-node, Info-read-node-name): Doc fix to mention that | ||
| 6 | the short format (FILENAME) goes to the Top node. | ||
| 7 | (Info-build-node-completions): Rename arg `file' to `filename'. | ||
| 8 | (Bug#13365) | ||
| 9 | |||
| 1 | 2013-01-07 Bastien Guerry <bzg@gnu.org> | 10 | 2013-01-07 Bastien Guerry <bzg@gnu.org> |
| 2 | 11 | ||
| 3 | * menu-bar.el (menu-bar-search-documentation-menu): Use | 12 | * menu-bar.el (menu-bar-search-documentation-menu): Use |
diff --git a/lisp/info.el b/lisp/info.el index 8408e01efb5..9bce39a6d3a 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -1703,7 +1703,9 @@ escaped (\\\",\\\\)." | |||
| 1703 | If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file | 1703 | If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file |
| 1704 | FILENAME; otherwise, NODENAME should be in the current Info file (or one of | 1704 | FILENAME; otherwise, NODENAME should be in the current Info file (or one of |
| 1705 | its sub-files). | 1705 | its sub-files). |
| 1706 | Completion is available, but only for node names in the current Info file. | 1706 | Completion is available for node names in the current Info file as well as |
| 1707 | in the Info file FILENAME after the closing parenthesis in (FILENAME). | ||
| 1708 | Empty NODENAME in (FILENAME) defaults to the Top node. | ||
| 1707 | If FORK is non-nil (interactively with a prefix arg), show the node in | 1709 | If FORK is non-nil (interactively with a prefix arg), show the node in |
| 1708 | a new Info buffer. | 1710 | a new Info buffer. |
| 1709 | If FORK is a string, it is the name to use for the new buffer." | 1711 | If FORK is a string, it is the name to use for the new buffer." |
| @@ -1784,16 +1786,19 @@ See `completing-read' for a description of arguments and usage." | |||
| 1784 | ((string-match "\\`(\\([^)]+\\))" string) | 1786 | ((string-match "\\`(\\([^)]+\\))" string) |
| 1785 | (let ((file0 (match-string 0 string)) | 1787 | (let ((file0 (match-string 0 string)) |
| 1786 | (file1 (match-string 1 string)) | 1788 | (file1 (match-string 1 string)) |
| 1787 | (node (substring string (match-end 0)))) | 1789 | (nodename (substring string (match-end 0)))) |
| 1788 | (completion-table-with-context | 1790 | (if (and (equal nodename "") (eq code 'lambda)) |
| 1789 | file0 | 1791 | ;; Empty node name is permitted that means "Top". |
| 1790 | (apply-partially | 1792 | t |
| 1791 | (lambda (string pred action) | 1793 | (completion-table-with-context |
| 1792 | (complete-with-action | 1794 | file0 |
| 1793 | action | 1795 | (apply-partially |
| 1794 | (Info-build-node-completions (Info-find-file file1)) | 1796 | (lambda (string pred action) |
| 1795 | string pred))) | 1797 | (complete-with-action |
| 1796 | node predicate code))) | 1798 | action |
| 1799 | (Info-build-node-completions (Info-find-file file1)) | ||
| 1800 | string pred))) | ||
| 1801 | nodename predicate code)))) | ||
| 1797 | ;; Otherwise use Info-read-node-completion-table. | 1802 | ;; Otherwise use Info-read-node-completion-table. |
| 1798 | (t (complete-with-action | 1803 | (t (complete-with-action |
| 1799 | code Info-read-node-completion-table string predicate)))) | 1804 | code Info-read-node-completion-table string predicate)))) |
| @@ -1802,7 +1807,9 @@ See `completing-read' for a description of arguments and usage." | |||
| 1802 | (defun Info-read-node-name (prompt) | 1807 | (defun Info-read-node-name (prompt) |
| 1803 | "Read an Info node name with completion, prompting with PROMPT. | 1808 | "Read an Info node name with completion, prompting with PROMPT. |
| 1804 | A node name can have the form \"NODENAME\", referring to a node | 1809 | A node name can have the form \"NODENAME\", referring to a node |
| 1805 | in the current Info file, or \"(FILENAME)NODENAME\"." | 1810 | in the current Info file, or \"(FILENAME)NODENAME\", referring to |
| 1811 | a node in FILENAME. \"(FILENAME)\" is a short format to go to | ||
| 1812 | the Top node in FILENAME." | ||
| 1806 | (let* ((completion-ignore-case t) | 1813 | (let* ((completion-ignore-case t) |
| 1807 | (Info-read-node-completion-table (Info-build-node-completions)) | 1814 | (Info-read-node-completion-table (Info-build-node-completions)) |
| 1808 | (nodename (completing-read prompt 'Info-read-node-name-1 nil t))) | 1815 | (nodename (completing-read prompt 'Info-read-node-name-1 nil t))) |
| @@ -1810,14 +1817,14 @@ in the current Info file, or \"(FILENAME)NODENAME\"." | |||
| 1810 | (Info-read-node-name prompt) | 1817 | (Info-read-node-name prompt) |
| 1811 | nodename))) | 1818 | nodename))) |
| 1812 | 1819 | ||
| 1813 | (defun Info-build-node-completions (&optional file) | 1820 | (defun Info-build-node-completions (&optional filename) |
| 1814 | (if file | 1821 | (if filename |
| 1815 | (or (cdr (assoc file Info-file-completions)) | 1822 | (or (cdr (assoc filename Info-file-completions)) |
| 1816 | (with-temp-buffer | 1823 | (with-temp-buffer |
| 1817 | (Info-mode) | 1824 | (Info-mode) |
| 1818 | (Info-goto-node (format "(%s)Top" file)) | 1825 | (Info-goto-node (format "(%s)Top" filename)) |
| 1819 | (Info-build-node-completions-1) | 1826 | (Info-build-node-completions-1) |
| 1820 | (push (cons file Info-current-file-completions) Info-file-completions) | 1827 | (push (cons filename Info-current-file-completions) Info-file-completions) |
| 1821 | Info-current-file-completions)) | 1828 | Info-current-file-completions)) |
| 1822 | (or Info-current-file-completions | 1829 | (or Info-current-file-completions |
| 1823 | (Info-build-node-completions-1)))) | 1830 | (Info-build-node-completions-1)))) |