diff options
author | Erik Naggum <erik@naggum.no> | 1996-02-20 14:48:08 +0000 |
---|---|---|
committer | Erik Naggum <erik@naggum.no> | 1996-02-20 14:48:08 +0000 |
commit | cf116e9ee82674f5b15fada491581db8645a45d8 (patch) | |
tree | 9d4de35e85ec53767f80bf287be026f94de8b81d /lisp/finder.el | |
parent | 7d6a441823f30ecc7db1501babea93500c89f17a (diff) | |
download | emacs-cf116e9ee82674f5b15fada491581db8645a45d8.tar.gz |
Removed (require 'picture).
(finder-insert-at-column): New function.
(finder-list-keywords, finder-list-matches): Use it.
Diffstat (limited to 'lisp/finder.el')
-rw-r--r-- | lisp/finder.el | 106 |
1 files changed, 55 insertions, 51 deletions
diff --git a/lisp/finder.el b/lisp/finder.el index 92921852fda..76e2adefa6b 100644 --- a/lisp/finder.el +++ b/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." |