From 5acc847d859ea609f87013fa71477a1b281a27d5 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 12 Jun 1997 03:51:53 +0000 Subject: [PATCH] (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. --- lisp/finder.el | 40 +++++++++++++++++++++------------------- 1 file 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") -- 2.39.2