[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r99664: Add finder unknown keywords.
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r99664: Add finder unknown keywords. |
Date: |
Sun, 14 Mar 2010 23:28:52 +0200 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 99664
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Sun 2010-03-14 23:28:52 +0200
message:
Add finder unknown keywords.
* finder.el (finder-unknown-keywords): New function.
* info.el (Info-finder-find-node): Use `finder-unknown-keywords'
to create a Finder node with unknown keywords.
modified:
lisp/ChangeLog
lisp/finder.el
lisp/info.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-03-14 21:15:02 +0000
+++ b/lisp/ChangeLog 2010-03-14 21:28:52 +0000
@@ -1,5 +1,14 @@
2010-03-14 Juri Linkov <address@hidden>
+ Add finder unknown keywords.
+
+ * finder.el (finder-unknown-keywords): New function.
+
+ * info.el (Info-finder-find-node): Use `finder-unknown-keywords'
+ to create a Finder node with unknown keywords.
+
+2010-03-14 Juri Linkov <address@hidden>
+
* finder.el (finder-compile-keywords): Replace `princ' with
`prin1' on a list of symbols interned from keyword strings.
=== modified file 'lisp/finder.el'
--- a/lisp/finder.el 2010-03-14 21:15:02 +0000
+++ b/lisp/finder.el 2010-03-14 21:28:52 +0000
@@ -33,7 +33,6 @@
;; there doesn't seem to be any way to get completing-read to exit on
;; an EOL with no substring pending, which is what we'd want to end the loop.
;; 2. Search by string in synopsis line?
-;; 3. Function to check finder-package-info for unknown keywords.
;;; Code:
@@ -230,6 +229,29 @@
'(mouse-face highlight
help-echo finder-help-echo))))
+(defun finder-unknown-keywords ()
+ "Return an alist of unknown keywords and number of their occurences.
+Unknown are keywords that are present in `finder-package-info'
+but absent in `finder-known-keywords'."
+ (let ((unknown-keywords-hash (make-hash-table)))
+ ;; Prepare a hash where key is a keyword
+ ;; and value is the number of keyword occurences.
+ (mapc (lambda (package)
+ (mapc (lambda (keyword)
+ (unless (assq keyword finder-known-keywords)
+ (puthash keyword
+ (1+ (gethash keyword unknown-keywords-hash 0))
+ unknown-keywords-hash)))
+ (nth 2 package)))
+ finder-package-info)
+ ;; Make an alist from the hash and sort by the keyword name.
+ (sort (let (unknown-keywords-list)
+ (maphash (lambda (key value)
+ (push (cons key value) unknown-keywords-list))
+ unknown-keywords-hash)
+ unknown-keywords-list)
+ (lambda (a b) (string< (car a) (car b))))))
+
;;;###autoload
(defun finder-list-keywords ()
"Display descriptions of the keywords in the Finder buffer."
=== modified file 'lisp/info.el'
--- a/lisp/info.el 2010-03-03 19:23:20 +0000
+++ b/lisp/info.el 2010-03-14 21:28:52 +0000
@@ -3343,6 +3343,7 @@
(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))
(defun Info-finder-find-node (filename nodename &optional no-going-back)
@@ -3361,7 +3362,21 @@
(insert (format "* %-14s %s.\n"
(concat (symbol-name keyword) "::")
(cdr assoc)))))
- finder-known-keywords))
+ (cons '(unknown . "unknown keywords")
+ finder-known-keywords)))
+ ((equal nodename "unknown")
+ ;; Display unknown keywords
+ (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
+ Info-finder-file nodename))
+ (insert "Finder Unknown Keywords\n")
+ (insert "***********************\n\n")
+ (insert "* Menu:\n\n")
+ (mapc
+ (lambda (assoc)
+ (insert (format "* %-14s %s.\n"
+ (concat (symbol-name (car assoc)) "::")
+ (cdr assoc))))
+ (finder-unknown-keywords)))
((string-match-p "\\.el\\'" nodename)
;; Display commentary section
(insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r99664: Add finder unknown keywords.,
Juri Linkov <=