mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-21 06:55:39 +00:00
Removed (require 'picture).
(finder-insert-at-column): New function. (finder-list-keywords, finder-list-matches): Use it.
This commit is contained in:
parent
dfeadd842f
commit
e6fb4d11c9
106
lisp/finder.el
106
lisp/finder.el
@ -40,7 +40,6 @@
|
||||
|
||||
(require 'lisp-mnt)
|
||||
(require 'finder-inf)
|
||||
(require 'picture)
|
||||
|
||||
;; Local variable in finder buffer.
|
||||
(defvar finder-headmark)
|
||||
@ -115,57 +114,67 @@ arguments compiles from `load-path'."
|
||||
(insert ";;; Code:\n")
|
||||
(insert "\n(setq finder-package-info '(\n")
|
||||
(mapcar
|
||||
(function
|
||||
(lambda (d)
|
||||
(mapcar
|
||||
(function
|
||||
(lambda (f)
|
||||
(if (and (string-match "^[^=].*\\.el$" f)
|
||||
(not (member f processed)))
|
||||
(let (summary keystart keywords)
|
||||
(setq processed (cons f processed))
|
||||
(save-excursion
|
||||
(set-buffer (get-buffer-create "*finder-scratch*"))
|
||||
(buffer-disable-undo (current-buffer))
|
||||
(erase-buffer)
|
||||
(insert-file-contents
|
||||
(concat (file-name-as-directory (or d ".")) f))
|
||||
(setq summary (lm-synopsis))
|
||||
(setq keywords (lm-keywords)))
|
||||
(insert
|
||||
(format " (\"%s\"\n " f))
|
||||
(prin1 summary (current-buffer))
|
||||
(insert
|
||||
"\n ")
|
||||
(setq keystart (point))
|
||||
(insert
|
||||
(if keywords (format "(%s)" keywords) "nil")
|
||||
")\n")
|
||||
(subst-char-in-region keystart (point) ?, ? )
|
||||
)
|
||||
)))
|
||||
(directory-files (or d ".")))
|
||||
))
|
||||
(lambda (d)
|
||||
(mapcar
|
||||
(lambda (f)
|
||||
(if (and (string-match "^[^=].*\\.el$" f)
|
||||
(not (member f processed)))
|
||||
(let (summary keystart keywords)
|
||||
(setq processed (cons f processed))
|
||||
(save-excursion
|
||||
(set-buffer (get-buffer-create "*finder-scratch*"))
|
||||
(buffer-disable-undo (current-buffer))
|
||||
(erase-buffer)
|
||||
(insert-file-contents
|
||||
(concat (file-name-as-directory (or d ".")) f))
|
||||
(setq summary (lm-synopsis))
|
||||
(setq keywords (lm-keywords)))
|
||||
(insert
|
||||
(format " (\"%s\"\n " f))
|
||||
(prin1 summary (current-buffer))
|
||||
(insert
|
||||
"\n ")
|
||||
(setq keystart (point))
|
||||
(insert
|
||||
(if keywords (format "(%s)" keywords) "nil")
|
||||
")\n")
|
||||
(subst-char-in-region keystart (point) ?, ? )
|
||||
)))
|
||||
(directory-files (or d "."))))
|
||||
(or dirs load-path))
|
||||
(insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n")
|
||||
(kill-buffer "*finder-scratch*")
|
||||
(eval-current-buffer) ;; So we get the new keyword list immediately
|
||||
(basic-save-buffer)
|
||||
)))
|
||||
(basic-save-buffer))))
|
||||
|
||||
;;; Now the retrieval code
|
||||
|
||||
(defun finder-insert-at-column (column &rest strings)
|
||||
"Insert list of STRINGS, at column COLUMN."
|
||||
(if (> (current-column) column) (insert "\n"))
|
||||
(move-to-column column)
|
||||
(let ((col (current-column)))
|
||||
(if (< col column)
|
||||
(indent-to column)
|
||||
(if (and (/= col column)
|
||||
(= (preceding-char) ?\t))
|
||||
(let (indent-tabs-mode)
|
||||
(delete-char -1)
|
||||
(indent-to col)
|
||||
(move-to-column column)))))
|
||||
(apply 'insert strings))
|
||||
|
||||
(defun finder-list-keywords ()
|
||||
"Display descriptions of the keywords in the Finder buffer."
|
||||
(interactive)
|
||||
(setq buffer-read-only nil)
|
||||
(erase-buffer)
|
||||
(mapcar
|
||||
(function (lambda (assoc)
|
||||
(let ((keyword (car assoc)))
|
||||
(insert (symbol-name keyword))
|
||||
(insert-at-column 14 (concat (cdr assoc) "\n"))
|
||||
(cons (symbol-name keyword) keyword))))
|
||||
(lambda (assoc)
|
||||
(let ((keyword (car assoc)))
|
||||
(insert (symbol-name keyword))
|
||||
(finder-insert-at-column 14 (concat (cdr assoc) "\n"))
|
||||
(cons (symbol-name keyword) keyword)))
|
||||
finder-known-keywords)
|
||||
(goto-char (point-min))
|
||||
(setq finder-headmark (point))
|
||||
@ -182,14 +191,11 @@ arguments compiles from `load-path'."
|
||||
"The following packages match the keyword `" key "':\n\n")
|
||||
(setq finder-headmark (point))
|
||||
(mapcar
|
||||
(function (lambda (x)
|
||||
(if (memq id (car (cdr (cdr x))))
|
||||
(progn
|
||||
(insert (car x))
|
||||
(insert-at-column 16
|
||||
(concat (car (cdr x)) "\n"))
|
||||
))
|
||||
))
|
||||
(lambda (x)
|
||||
(if (memq id (car (cdr (cdr x))))
|
||||
(progn
|
||||
(insert (car x))
|
||||
(finder-insert-at-column 16 (concat (car (cdr x)) "\n")))))
|
||||
finder-package-info)
|
||||
(goto-char (point-min))
|
||||
(forward-line)
|
||||
@ -232,8 +238,7 @@ arguments compiles from `load-path'."
|
||||
(setq buffer-read-only t)
|
||||
(set-buffer-modified-p nil)
|
||||
(shrink-window-if-larger-than-buffer)
|
||||
(finder-summary)
|
||||
))
|
||||
(finder-summary)))
|
||||
|
||||
(defun finder-current-item ()
|
||||
(if (and finder-headmark (< (point) finder-headmark))
|
||||
@ -270,8 +275,7 @@ arguments compiles from `load-path'."
|
||||
(setq mode-name "Finder")
|
||||
(setq major-mode 'finder-mode)
|
||||
(make-local-variable 'finder-headmark)
|
||||
(setq finder-headmark nil)
|
||||
)
|
||||
(setq finder-headmark nil))
|
||||
|
||||
(defun finder-summary ()
|
||||
"Summarize basic Finder commands."
|
||||
|
Loading…
Reference in New Issue
Block a user