summaryrefslogtreecommitdiff
path: root/lisp/finder.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-03-24 18:43:04 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-03-24 18:43:04 +0000
commit89e2d47661a46e8bbfb2f3d39300860d48381c78 (patch)
tree8f1c3351f3f8ec4631b909b50e89aab01f2a752a /lisp/finder.el
parent318f2a46e093827563af5e297178bb8fb098a3b8 (diff)
downloademacs-89e2d47661a46e8bbfb2f3d39300860d48381c78.tar.gz
(finder-mode-syntax-table, finder-font-lock-keywords): New variables.
(finder-mode): Use finder-mode-syntax-table. Set font-lock-defaults. (finder-exit): Ignore errors rather than avoiding them. Kill *Finder-package* buffer also.
Diffstat (limited to 'lisp/finder.el')
-rw-r--r--lisp/finder.el28
1 files changed, 19 insertions, 9 deletions
diff --git a/lisp/finder.el b/lisp/finder.el
index c0231c84455..e5a41ca7e46 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -110,6 +110,16 @@
(define-key map "d" 'finder-list-keywords)
map))
+(defvar finder-mode-syntax-table
+ (let ((st (make-syntax-table emacs-lisp-mode-syntax-table)))
+ (modify-syntax-entry ?\; ". " st)
+ st)
+ "Syntax table used while in `finder-mode'.")
+
+(defvar finder-font-lock-keywords
+ '(("`\\([^']+\\)'" 1 font-lock-constant-face prepend))
+ "Font-lock keywords for Finder mode.")
+
;;; Code for regenerating the keyword list.
@@ -343,7 +353,9 @@ FILE should be in a form suitable for passing to `locate-library'."
(interactive)
(kill-all-local-variables)
(use-local-map finder-mode-map)
- (set-syntax-table emacs-lisp-mode-syntax-table)
+ (set-syntax-table finder-mode-syntax-table)
+ (setq font-lock-defaults '(finder-font-lock-keywords nil nil
+ (("+-*/.<>=!?$%_&~^:@" . "w")) nil))
(setq mode-name "Finder")
(setq major-mode 'finder-mode)
(set (make-local-variable 'finder-headmark) nil)
@@ -359,15 +371,13 @@ FILE should be in a form suitable for passing to `locate-library'."
finder directory, \\[finder-exit] = quit, \\[finder-summary] = help")))
(defun finder-exit ()
- "Exit Finder mode and kill the buffer."
+ "Exit Finder mode.
+Delete the window and kill the buffer."
(interactive)
- (or (one-window-p t)
- (delete-window))
- ;; Can happen in either buffer -- kill each of the two that exists
- (and (get-buffer "*Finder*")
- (kill-buffer "*Finder*"))
- (and (get-buffer "*Finder Category*")
- (kill-buffer "*Finder Category*")))
+ (condition-case nil (delete-window) (error nil))
+ (when (get-buffer "*Finder*") (kill-buffer "*Finder*"))
+ (when (get-buffer "*Finder-package*") (kill-buffer "*Finder-package*"))
+ (when (get-buffer "*Finder Category*") (kill-buffer "*Finder Category*")))
(provide 'finder)