Commit 96ae4c8f authored by Chong Yidong's avatar Chong Yidong

Merge Finder and package-menu functionality.

* lisp/finder.el: Require `package'.
(finder-known-keywords): Tweak descriptions.  Retire `oop' keyword.
(finder-package-info): Var deleted.
(finder-keywords-hash, finder--builtins-alist): New vars.
(finder-compile-keywords): Compute package--builtins and
finder-keywords-hash instead of finder-keywords-hash, respecting
the "Package" header.
(finder-unknown-keywords, finder-list-matches): Use
finder-keywords-hash and package--list-packages.
(finder-mode): Don't set font-lock-defaults.
(finder-exit): We don't use "*Finder-package*" and "*Finder
Category*" buffers anymore.

* lisp/info.el (Info-finder-find-node): Search package-alist instead of
finder-package-info.

* lisp/emacs-lisp/package.el (package--builtins-base): Var deleted.
(package--builtins): Set default value to nil.
(package-initialize): Load precomputed value of package--builtins
from finder-inf.el.
(package-alist, package-compute-transaction)
(package-download-transaction): Improve docstring.
(package-read-all-archive-contents): Do not change
package--builtins here.
(list-packages): Make package-list-packages an alias for this.
Sort by status by default.
(package--list-packages): Add optional PACKAGES arg.
(describe-package-1): Use font-lock-face property.  For built-in
packages, insert file commentary.
(package--generate-package-list): Rename from
package-list-packages-internal; all callers changed.  Add optional
PACKAGES arg.  Add alphabetical sort fallbacks.
(package-menu--version-predicate, package-menu--status-predicate)
(package-menu--description-predicate)
(package-menu--name-predicate): New functions.
parent aad4679e
2010-08-29 Chong Yidong <cyd@stupidchicken.com>
* finder.el: Require `package'.
(finder-known-keywords): Tweak descriptions. Retire `oop' keyword.
(finder-package-info): Var deleted.
(finder-keywords-hash, finder--builtins-alist): New vars.
(finder-compile-keywords): Compute package--builtins and
finder-keywords-hash instead of finder-keywords-hash, respecting
the "Package" header.
(finder-unknown-keywords, finder-list-matches): Use
finder-keywords-hash and package--list-packages.
(finder-mode): Don't set font-lock-defaults.
(finder-exit): We don't use "*Finder-package*" and "*Finder
Category*" buffers anymore.
* emacs-lisp/package.el (package--builtins-base): Var deleted.
(package--builtins): Set default value to nil.
(package-initialize): Load precomputed value of package--builtins
from finder-inf.el.
(package-alist, package-compute-transaction)
(package-download-transaction): Improve docstring.
(package-read-all-archive-contents): Do not change
package--builtins here.
(list-packages): Make package-list-packages an alias for this.
Sort by status by default.
(package--list-packages): Add optional PACKAGES arg.
(describe-package-1): Use font-lock-face property. For built-in
packages, insert file commentary.
(package--generate-package-list): Rename from
package-list-packages-internal; all callers changed. Add optional
PACKAGES arg. Add alphabetical sort fallbacks.
(package-menu--version-predicate, package-menu--status-predicate)
(package-menu--description-predicate)
(package-menu--name-predicate): New functions.
* info.el (Info-finder-find-node): Search package-alist instead of
finder-package-info.
2010-08-29 Chong Yidong <cyd@stupidchicken.com>
* subr.el (version-regexp-alist): Don't use "a" and "b" for
......
This diff is collapsed.
This diff is collapsed.
......@@ -2641,7 +2641,7 @@ will be inserted before the group at point."
;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group
;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "e1272bfdc7c3b6e926b2a68155217303")
;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "fa9822b5ef905f06d8a03dc9ce3a2894")
;;; Generated autoloads from ibuf-ext.el
(autoload 'ibuffer-auto-mode "ibuf-ext" "\
......
......@@ -3372,7 +3372,6 @@ Build a menu of the possible matches."
filename)
(defvar finder-known-keywords)
(defvar finder-package-info)
(declare-function find-library-name "find-func" (library))
(declare-function finder-unknown-keywords "finder" ())
(declare-function lm-commentary "lisp-mnt" (&optional file))
......@@ -3388,15 +3387,14 @@ Build a menu of the possible matches."
(insert "Finder Keywords\n")
(insert "***************\n\n")
(insert "* Menu:\n\n")
(mapc
(lambda (assoc)
(let ((keyword (car assoc)))
(insert (format "* %-14s %s.\n"
(concat (symbol-name keyword) "::")
(cdr assoc)))))
(append '((all . "All package info")
(unknown . "unknown keywords"))
finder-known-keywords)))
(dolist (assoc (append '((all . "All package info")
(unknown . "unknown keywords"))
finder-known-keywords))
(let ((keyword (car assoc)))
(insert (format "* %s %s.\n"
(concat (symbol-name keyword) ": "
"kw:" (symbol-name keyword) ".")
(cdr assoc))))))
((equal nodename "unknown")
;; Display unknown keywords
(insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
......@@ -3416,17 +3414,36 @@ Build a menu of the possible matches."
Info-finder-file nodename))
(insert "Finder Package Info\n")
(insert "*******************\n\n")
(mapc (lambda (package)
(insert (format "%s - %s\n"
(format "*Note %s::" (nth 0 package))
(nth 1 package)))
(insert "Keywords: "
(mapconcat (lambda (keyword)
(format "*Note %s::" (symbol-name keyword)))
(nth 2 package) ", ")
"\n\n"))
finder-package-info))
((string-match-p "\\.el\\'" nodename)
(dolist (package package-alist)
(insert (format "%s - %s\n"
(format "*Note %s::" (nth 0 package))
(nth 1 package)))))
((string-match "\\`kw:" nodename)
(setq nodename (substring nodename (match-end 0)))
;; Display packages that match the keyword
;; or the list of keywords separated by comma.
(insert (format "\n\^_\nFile: %s, Node: kw:%s, Up: Top\n\n"
Info-finder-file nodename))
(insert "Finder Packages\n")
(insert "***************\n\n")
(insert
"The following packages match the keyword `" nodename "':\n\n")
(insert "* Menu:\n\n")
(let ((keywords
(mapcar 'intern (if (string-match-p "," nodename)
(split-string nodename ",[ \t\n]*" t)
(list nodename))))
hits desc)
(dolist (kw keywords)
(push (copy-tree (gethash kw finder-keywords-hash)) hits))
(setq hits (delete-dups (apply 'append hits)))
(dolist (package hits)
(setq desc (cdr-safe (assq package package-alist)))
(when (vectorp desc)
(insert (format "* %-16s %s.\n"
(concat (symbol-name package) "::")
(aref desc 2)))))))
(t
;; Display commentary section
(insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
Info-finder-file nodename))
......@@ -3447,29 +3464,7 @@ Build a menu of the possible matches."
(goto-char (point-min))
(while (re-search-forward "^;+ ?" nil t)
(replace-match "" nil nil))
(buffer-string))))))
(t
;; Display packages that match the keyword
;; or the list of keywords separated by comma.
(insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
Info-finder-file nodename))
(insert "Finder Packages\n")
(insert "***************\n\n")
(insert
"The following packages match the keyword `" nodename "':\n\n")
(insert "* Menu:\n\n")
(let ((keywords
(mapcar 'intern (if (string-match-p "," nodename)
(split-string nodename ",[ \t\n]*" t)
(list nodename)))))
(mapc
(lambda (package)
(unless (memq nil (mapcar (lambda (k) (memq k (nth 2 package)))
keywords))
(insert (format "* %-16s %s.\n"
(concat (nth 0 package) "::")
(nth 1 package)))))
finder-package-info)))))
(buffer-string))))))))
;;;###autoload
(defun info-finder (&optional keywords)
......
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