aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2015-04-27 00:52:46 -0400
committerStefan Monnier2015-04-27 00:52:46 -0400
commitdef0df01fb2cfa14ed87a9d719e0ccc45b363fec (patch)
treebbf9d7741290850c5b8b8052804ada07162d13d6
parentd32d0fae2a7e37a065f1dd2372763c4dc0e409f4 (diff)
downloademacs-def0df01fb2cfa14ed87a9d719e0ccc45b363fec.tar.gz
emacs-def0df01fb2cfa14ed87a9d719e0ccc45b363fec.zip
* lisp/info.el (Info-menu): Properly provide the `default'
Fixes: debbugs:20391
-rw-r--r--lisp/info.el43
1 files changed, 22 insertions, 21 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 057bd77ba16..05574ae11f5 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -632,7 +632,7 @@ Do the right thing if the file has been compressed or zipped."
632 default-directory))) 632 default-directory)))
633 (or (consp decoder) 633 (or (consp decoder)
634 (setq decoder (list decoder))) 634 (setq decoder (list decoder)))
635 (apply 'call-process-region (point-min) (point-max) 635 (apply #'call-process-region (point-min) (point-max)
636 (car decoder) t t nil (cdr decoder)))) 636 (car decoder) t t nil (cdr decoder))))
637 (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes 637 (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes
638 (insert-file-contents fullname visit))) 638 (insert-file-contents fullname visit)))
@@ -1422,10 +1422,10 @@ is non-nil)."
1422 (insert "\^_\nFile: dir\tNode: " nodename "\n\n* Menu:\n\n")) 1422 (insert "\^_\nFile: dir\tNode: " nodename "\n\n* Menu:\n\n"))
1423 ;; Merge the text from the other buffer's menu 1423 ;; Merge the text from the other buffer's menu
1424 ;; into the menu in the like-named node in the main buffer. 1424 ;; into the menu in the like-named node in the main buffer.
1425 (apply 'insert-buffer-substring (cdr node)))) 1425 (apply #'insert-buffer-substring (cdr node))))
1426 (Info-dir-remove-duplicates) 1426 (Info-dir-remove-duplicates)
1427 ;; Kill all the buffers we just made, including the special one excised. 1427 ;; Kill all the buffers we just made, including the special one excised.
1428 (mapc 'kill-buffer (cons buffer buffers)) 1428 (mapc #'kill-buffer (cons buffer buffers))
1429 (goto-char (point-min)) 1429 (goto-char (point-min))
1430 (if problems 1430 (if problems
1431 (message "Composing main Info directory...problems encountered, see `*Messages*'") 1431 (message "Composing main Info directory...problems encountered, see `*Messages*'")
@@ -1810,10 +1810,10 @@ See `completing-read' for a description of arguments and usage."
1810 ((string-match "\\`([^)]*\\'" string) 1810 ((string-match "\\`([^)]*\\'" string)
1811 (completion-table-with-context 1811 (completion-table-with-context
1812 "(" 1812 "("
1813 (apply-partially 'completion-table-with-terminator ")" 1813 (apply-partially #'completion-table-with-terminator ")"
1814 (apply-partially 'Info-read-node-name-2 1814 (apply-partially #'Info-read-node-name-2
1815 Info-directory-list 1815 Info-directory-list
1816 (mapcar 'car Info-suffix-list))) 1816 (mapcar #'car Info-suffix-list)))
1817 (substring string 1) 1817 (substring string 1)
1818 predicate 1818 predicate
1819 code)) 1819 code))
@@ -1827,12 +1827,11 @@ See `completing-read' for a description of arguments and usage."
1827 t 1827 t
1828 (completion-table-with-context 1828 (completion-table-with-context
1829 file0 1829 file0
1830 (apply-partially 1830 (lambda (string pred action)
1831 (lambda (string pred action) 1831 (complete-with-action
1832 (complete-with-action 1832 action
1833 action 1833 (Info-build-node-completions (Info-find-file file1))
1834 (Info-build-node-completions (Info-find-file file1)) 1834 string pred))
1835 string pred)))
1836 nodename predicate code)))) 1835 nodename predicate code))))
1837 ;; Otherwise use Info-read-node-completion-table. 1836 ;; Otherwise use Info-read-node-completion-table.
1838 (t (complete-with-action 1837 (t (complete-with-action
@@ -2750,7 +2749,8 @@ new buffer."
2750 (end-of-line) 2749 (end-of-line)
2751 (if (re-search-backward (concat "\n\\* +\\(" 2750 (if (re-search-backward (concat "\n\\* +\\("
2752 Info-menu-entry-name-re 2751 Info-menu-entry-name-re
2753 "\\):") beg t) 2752 "\\):")
2753 beg t)
2754 (setq default (match-string-no-properties 1)))))) 2754 (setq default (match-string-no-properties 1))))))
2755 (let ((item nil)) 2755 (let ((item nil))
2756 (while (null item) 2756 (while (null item)
@@ -2760,7 +2760,8 @@ new buffer."
2760 (format "Menu item (default %s): " 2760 (format "Menu item (default %s): "
2761 default) 2761 default)
2762 "Menu item: ") 2762 "Menu item: ")
2763 'Info-complete-menu-item nil t))) 2763 #'Info-complete-menu-item nil t nil nil
2764 default)))
2764 ;; we rely on the fact that completing-read accepts an input 2765 ;; we rely on the fact that completing-read accepts an input
2765 ;; of "" even when the require-match argument is true and "" 2766 ;; of "" even when the require-match argument is true and ""
2766 ;; is not a valid possibility 2767 ;; is not a valid possibility
@@ -3496,7 +3497,7 @@ MATCHES is a list of index matches found by `Info-apropos-matches'.")
3496 3497
3497(defun Info-apropos-toc-nodes (filename) 3498(defun Info-apropos-toc-nodes (filename)
3498 "Apropos-specific implementation of `Info-toc-nodes'." 3499 "Apropos-specific implementation of `Info-toc-nodes'."
3499 (let ((nodes (mapcar 'car (reverse Info-apropos-nodes)))) 3500 (let ((nodes (mapcar #'car (reverse Info-apropos-nodes))))
3500 `(,filename 3501 `(,filename
3501 ("Top" nil nil ,nodes) 3502 ("Top" nil nil ,nodes)
3502 ,@(mapcar (lambda (node) `(,node "Top" nil nil)) nodes)))) 3503 ,@(mapcar (lambda (node) `(,node "Top" nil nil)) nodes))))
@@ -3709,13 +3710,13 @@ Build a menu of the possible matches."
3709 "The following packages match the keyword `" nodename "':\n\n") 3710 "The following packages match the keyword `" nodename "':\n\n")
3710 (insert "* Menu:\n\n") 3711 (insert "* Menu:\n\n")
3711 (let ((keywords 3712 (let ((keywords
3712 (mapcar 'intern (if (string-match-p "," nodename) 3713 (mapcar #'intern (if (string-match-p "," nodename)
3713 (split-string nodename ",[ \t\n]*" t) 3714 (split-string nodename ",[ \t\n]*" t)
3714 (list nodename)))) 3715 (list nodename))))
3715 hits desc) 3716 hits desc)
3716 (dolist (keyword keywords) 3717 (dolist (keyword keywords)
3717 (push (copy-tree (gethash keyword finder-keywords-hash)) hits)) 3718 (push (copy-tree (gethash keyword finder-keywords-hash)) hits))
3718 (setq hits (delete-dups (apply 'append hits)) 3719 (setq hits (delete-dups (apply #'append hits))
3719 ;; Not a meaningful package. 3720 ;; Not a meaningful package.
3720 hits (delete 'emacs hits) 3721 hits (delete 'emacs hits)
3721 hits (sort hits (lambda (a b) (string< (symbol-name a) 3722 hits (sort hits (lambda (a b) (string< (symbol-name a)
@@ -3766,8 +3767,8 @@ with a list of packages that contain all specified keywords."
3766 (list 3767 (list
3767 (completing-read-multiple 3768 (completing-read-multiple
3768 "Keywords (separated by comma): " 3769 "Keywords (separated by comma): "
3769 (mapcar 'symbol-name (mapcar 'car (append finder-known-keywords 3770 (mapcar #'symbol-name (mapcar #'car (append finder-known-keywords
3770 (finder-unknown-keywords)))) 3771 (finder-unknown-keywords))))
3771 nil t)))) 3772 nil t))))
3772 (require 'finder) 3773 (require 'finder)
3773 (if keywords 3774 (if keywords
@@ -5322,9 +5323,9 @@ completion alternatives to currently visited manuals."
5322 (when (not visited-only) 5323 (when (not visited-only)
5323 (all-completions 5324 (all-completions
5324 "" 5325 ""
5325 (apply-partially 'Info-read-node-name-2 5326 (apply-partially #'Info-read-node-name-2
5326 Info-directory-list 5327 Info-directory-list
5327 (mapcar 'car Info-suffix-list)))))))) 5328 (mapcar #'car Info-suffix-list))))))))
5328 5329
5329(provide 'info) 5330(provide 'info)
5330 5331