Commit d5a6b3ba authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/info.el (Info-finder-find-node): Use `package--builtins' instead

of `package-alist'.  Use node names formed by the pattern "Keyword "
and the keyword name.
parent e981b61f
2011-11-19 Juri Linkov <juri@jurta.org>
* info.el (Info-finder-find-node): Use `package--builtins' instead
of `package-alist'. Use node names formed by the pattern "Keyword "
and the keyword name.
2011-11-19 Andreas Schwab <schwab@linux-m68k.org> 2011-11-19 Andreas Schwab <schwab@linux-m68k.org>
* progmodes/sh-script.el (sh-assignment-regexp): Add entry for * progmodes/sh-script.el (sh-assignment-regexp): Add entry for
......
...@@ -3403,7 +3403,7 @@ Build a menu of the possible matches." ...@@ -3403,7 +3403,7 @@ Build a menu of the possible matches."
(declare-function finder-unknown-keywords "finder" ()) (declare-function finder-unknown-keywords "finder" ())
(declare-function lm-commentary "lisp-mnt" (&optional file)) (declare-function lm-commentary "lisp-mnt" (&optional file))
(defvar finder-keywords-hash) (defvar finder-keywords-hash)
(defvar package-alist) ; finder requires package (defvar package--builtins) ; finder requires package
(defun Info-finder-find-node (_filename nodename &optional _no-going-back) (defun Info-finder-find-node (_filename nodename &optional _no-going-back)
"Finder-specific implementation of `Info-find-node-2'." "Finder-specific implementation of `Info-find-node-2'."
...@@ -3417,14 +3417,14 @@ Build a menu of the possible matches." ...@@ -3417,14 +3417,14 @@ Build a menu of the possible matches."
(insert "***************\n\n") (insert "***************\n\n")
(insert "* Menu:\n\n") (insert "* Menu:\n\n")
(dolist (assoc (append '((all . "All package info") (dolist (assoc (append '((all . "All package info")
(unknown . "unknown keywords")) (unknown . "Unknown keywords"))
finder-known-keywords)) finder-known-keywords))
(let ((keyword (car assoc))) (let ((keyword (car assoc)))
(insert (format "* %s %s.\n" (insert (format "* %s %s.\n"
(concat (symbol-name keyword) ": " (concat (symbol-name keyword) ": "
"kw:" (symbol-name keyword) ".") "Keyword " (symbol-name keyword) ".")
(cdr assoc)))))) (cdr assoc))))))
((equal nodename "unknown") ((equal nodename "Keyword unknown")
;; Display unknown keywords ;; Display unknown keywords
(insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n" (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
Info-finder-file nodename)) Info-finder-file nodename))
...@@ -3434,24 +3434,29 @@ Build a menu of the possible matches." ...@@ -3434,24 +3434,29 @@ Build a menu of the possible matches."
(mapc (mapc
(lambda (assoc) (lambda (assoc)
(insert (format "* %-14s %s.\n" (insert (format "* %-14s %s.\n"
(concat (symbol-name (car assoc)) "::") (concat (symbol-name (car assoc)) ": "
"Keyword " (symbol-name (car assoc)) ".")
(cdr assoc)))) (cdr assoc))))
(finder-unknown-keywords))) (finder-unknown-keywords)))
((equal nodename "all") ((equal nodename "Keyword all")
;; Display all package info. ;; Display all package info.
(insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n" (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
Info-finder-file nodename)) Info-finder-file nodename))
(insert "Finder Package Info\n") (insert "Finder Package Info\n")
(insert "*******************\n\n") (insert "*******************\n\n")
(dolist (package package-alist) (insert "* Menu:\n\n")
(insert (format "%s - %s\n" (let (desc)
(format "*Note %s::" (nth 0 package)) (dolist (package package--builtins)
(nth 1 package))))) (setq desc (cdr-safe package))
((string-match "\\`kw:" nodename) (when (vectorp desc)
(insert (format "* %-16s %s.\n"
(concat (symbol-name (car package)) "::")
(aref desc 2)))))))
((string-match "\\`Keyword " nodename)
(setq nodename (substring nodename (match-end 0))) (setq nodename (substring nodename (match-end 0)))
;; Display packages that match the keyword ;; Display packages that match the keyword
;; or the list of keywords separated by comma. ;; or the list of keywords separated by comma.
(insert (format "\n\^_\nFile: %s, Node: kw:%s, Up: Top\n\n" (insert (format "\n\^_\nFile: %s, Node: Keyword %s, Up: Top\n\n"
Info-finder-file nodename)) Info-finder-file nodename))
(insert "Finder Packages\n") (insert "Finder Packages\n")
(insert "***************\n\n") (insert "***************\n\n")
...@@ -3463,11 +3468,11 @@ Build a menu of the possible matches." ...@@ -3463,11 +3468,11 @@ Build a menu of the possible matches."
(split-string nodename ",[ \t\n]*" t) (split-string nodename ",[ \t\n]*" t)
(list nodename)))) (list nodename))))
hits desc) hits desc)
(dolist (kw keywords) (dolist (keyword keywords)
(push (copy-tree (gethash kw finder-keywords-hash)) hits)) (push (copy-tree (gethash keyword finder-keywords-hash)) hits))
(setq hits (delete-dups (apply 'append hits))) (setq hits (delete-dups (apply 'append hits)))
(dolist (package hits) (dolist (package hits)
(setq desc (cdr-safe (assq package package-alist))) (setq desc (cdr-safe (assq package package--builtins)))
(when (vectorp desc) (when (vectorp desc)
(insert (format "* %-16s %s.\n" (insert (format "* %-16s %s.\n"
(concat (symbol-name package) "::") (concat (symbol-name package) "::")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment