aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov2013-01-08 02:28:55 +0200
committerJuri Linkov2013-01-08 02:28:55 +0200
commit8a2e287c26d7bd115be088aa03a3a332b44c7e78 (patch)
tree040634858b662402d8030194812e37ec3d0b32f9 /lisp
parentc6a22ce23dad655c84f95bad1ed5191c2682f74e (diff)
downloademacs-8a2e287c26d7bd115be088aa03a3a332b44c7e78.tar.gz
emacs-8a2e287c26d7bd115be088aa03a3a332b44c7e78.zip
* lisp/info.el (Info-read-node-name-2): Don't duplicate suffixes for single completion.
(info--manual-names): Expand node completions into an explicit list before appending it to another list. Filter out internal buffers with the leading space in the buffer name. (Bug#10771) Fixes: debbugs:12456
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/info.el19
2 files changed, 23 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9b30294e65a..1a5a93861fb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,13 @@
12013-01-08 Juri Linkov <juri@jurta.org> 12013-01-08 Juri Linkov <juri@jurta.org>
2 2
3 * info.el (Info-read-node-name-2): Don't duplicate suffixes for
4 single completion. (Bug#12456)
5 (info--manual-names): Expand node completions into an explicit list
6 before appending it to another list. Filter out internal buffers
7 with the leading space in the buffer name. (Bug#10771)
8
92013-01-08 Juri Linkov <juri@jurta.org>
10
3 * info.el (Info-read-node-name-1): Allow empty node name in (FILENAME) 11 * info.el (Info-read-node-name-1): Allow empty node name in (FILENAME)
4 that defaults to the Top node. 12 that defaults to the Top node.
5 (Info-goto-node, Info-read-node-name): Doc fix to mention that 13 (Info-goto-node, Info-read-node-name): Doc fix to mention that
diff --git a/lisp/info.el b/lisp/info.el
index 9bce39a6d3a..48ad00c9f28 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1742,6 +1742,7 @@ list of valid filename suffixes for Info files. See
1742 (when (file-name-absolute-p string) 1742 (when (file-name-absolute-p string)
1743 (setq dirs (list (file-name-directory string)))) 1743 (setq dirs (list (file-name-directory string))))
1744 (let ((names nil) 1744 (let ((names nil)
1745 (names-sans-suffix nil)
1745 (suffix (concat (regexp-opt suffixes t) "\\'")) 1746 (suffix (concat (regexp-opt suffixes t) "\\'"))
1746 (string-dir (file-name-directory string))) 1747 (string-dir (file-name-directory string)))
1747 (dolist (dir dirs) 1748 (dolist (dir dirs)
@@ -1764,7 +1765,14 @@ list of valid filename suffixes for Info files. See
1764 ;; add the unsuffixed name as a completion option. 1765 ;; add the unsuffixed name as a completion option.
1765 (when (string-match suffix file) 1766 (when (string-match suffix file)
1766 (setq file (substring file 0 (match-beginning 0))) 1767 (setq file (substring file 0 (match-beginning 0)))
1767 (push (if string-dir (concat string-dir file) file) names))))) 1768 (push (if string-dir (concat string-dir file) file)
1769 names-sans-suffix)))))
1770 ;; If there is just one file, don't duplicate it with suffixes,
1771 ;; so `Info-read-node-name-1' will be able to complete a single
1772 ;; candidate and to add the terminating ")".
1773 (if (and (= (length names) 1) (= (length names-sans-suffix) 1))
1774 (setq names names-sans-suffix)
1775 (setq names (append names-sans-suffix names)))
1768 (complete-with-action action names string pred))) 1776 (complete-with-action action names string pred)))
1769 1777
1770(defun Info-read-node-name-1 (string predicate code) 1778(defun Info-read-node-name-1 (string predicate code)
@@ -5174,13 +5182,16 @@ Otherwise, visit the manual in a new Info buffer."
5174 (with-current-buffer buffer 5182 (with-current-buffer buffer
5175 (and (eq major-mode 'Info-mode) 5183 (and (eq major-mode 'Info-mode)
5176 (stringp Info-current-file) 5184 (stringp Info-current-file)
5185 (not (string= (substring (buffer-name) 0 1) " "))
5177 (push (file-name-sans-extension 5186 (push (file-name-sans-extension
5178 (file-name-nondirectory Info-current-file)) 5187 (file-name-nondirectory Info-current-file))
5179 names)))) 5188 names))))
5180 (delete-dups (append (nreverse names) 5189 (delete-dups (append (nreverse names)
5181 (apply-partially 'Info-read-node-name-2 5190 (all-completions
5182 Info-directory-list 5191 ""
5183 (mapcar 'car Info-suffix-list)))))) 5192 (apply-partially 'Info-read-node-name-2
5193 Info-directory-list
5194 (mapcar 'car Info-suffix-list)))))))
5184 5195
5185(provide 'info) 5196(provide 'info)
5186 5197