summaryrefslogtreecommitdiff
path: root/lisp/finder.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-12 03:51:53 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-12 03:51:53 +0000
commitdffb0893cb8805e4fc29055e3248675437a48a76 (patch)
tree8ba861a2dfca59fa9d5f61da11ee0ac43d433b54 /lisp/finder.el
parentd6e18e7fe9c7cb2f9f91fb003918ecc7f0550604 (diff)
downloademacs-dffb0893cb8805e4fc29055e3248675437a48a76.tar.gz
(finder-mode): Don't switch buffers or change text here.
(finder-by-keyword): Don't call finder-mode here. (finder-list-matches): Call finder-mode here. Switch to a buffer called *Finder Category*. (finder-list-keywords): Call finder-mode here. Switch to the buffer *Finder*. If the buffer already exists, don't reinitialize it or move point.
Diffstat (limited to 'lisp/finder.el')
-rw-r--r--lisp/finder.el40
1 files changed, 21 insertions, 19 deletions
diff --git a/lisp/finder.el b/lisp/finder.el
index d86a18ea779..799a681418c 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -172,23 +172,29 @@ arguments compiles from `load-path'."
(defun finder-list-keywords ()
"Display descriptions of the keywords in the Finder buffer."
(interactive)
- (setq buffer-read-only nil)
- (erase-buffer)
- (mapcar
- (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))
- (setq buffer-read-only t)
- (set-buffer-modified-p nil)
- (balance-windows)
- (finder-summary))
+ (if (get-buffer "*Finder*")
+ (pop-to-buffer "*Finder*")
+ (pop-to-buffer (set-buffer "*Finder*"))
+ (finder-mode)
+ (setq buffer-read-only nil)
+ (erase-buffer)
+ (mapcar
+ (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))
+ (setq buffer-read-only t)
+ (set-buffer-modified-p nil)
+ (balance-windows)
+ (finder-summary)))
(defun finder-list-matches (key)
+ (pop-to-buffer (set-buffer "*Finder Category*"))
+ (finder-mode)
(setq buffer-read-only nil)
(erase-buffer)
(let ((id (intern key)))
@@ -262,7 +268,6 @@ arguments compiles from `load-path'."
(defun finder-by-keyword ()
"Find packages matching a given keyword."
(interactive)
- (finder-mode)
(finder-list-keywords))
(defun finder-mode ()
@@ -272,9 +277,6 @@ arguments compiles from `load-path'."
\\[finder-exit] exit Finder mode and kill the Finder buffer.
"
(interactive)
- (pop-to-buffer "*Finder*")
- (setq buffer-read-only nil)
- (erase-buffer)
(use-local-map finder-mode-map)
(set-syntax-table emacs-lisp-mode-syntax-table)
(setq mode-name "Finder")