(require 'lisp-mnt)
(require 'finder-inf)
-(require 'picture)
;; Local variable in finder buffer.
(defvar finder-headmark)
(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))
"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)
(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))
(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."