changeset 14599:1de3a922cfe0

Removed (require 'picture). (finder-insert-at-column): New function. (finder-list-keywords, finder-list-matches): Use it.
author Erik Naggum <erik@naggum.no>
date Tue, 20 Feb 1996 14:48:08 +0000
parents 5a1435bd8ff3
children f32beac333a0
files lisp/finder.el
diffstat 1 files changed, 55 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/finder.el	Mon Feb 19 08:13:10 1996 +0000
+++ b/lisp/finder.el	Tue Feb 20 14:48:08 1996 +0000
@@ -40,7 +40,6 @@
 
 (require 'lisp-mnt)
 (require 'finder-inf)
-(require 'picture)
 
 ;; Local variable in finder buffer.
 (defvar finder-headmark)
@@ -115,57 +114,67 @@
       (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 @@
      "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 @@
     (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 @@
   (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."