aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love1998-02-12 18:20:21 +0000
committerDave Love1998-02-12 18:20:21 +0000
commitd575e99d72ef5a774c40e26563e5bbb78c65418a (patch)
treeb4de2bd0dfdc9caf1a8b5b99303ec414bbb05d7b
parent4cf9710d502cb9889ca496bbc3d69156551d56ca (diff)
downloademacs-d575e99d72ef5a774c40e26563e5bbb78c65418a.tar.gz
emacs-d575e99d72ef5a774c40e26563e5bbb78c65418a.zip
(scheme-imenu-generic-expression): Simplify regexps.
(dsssl-imenu-generic-expression): Likewise (scheme-mode-variables): Set imenu-syntax-alist. (dsssl-mode): Remove `!' from font-lock-defaults. Set imenu-syntax-alist.
-rw-r--r--lisp/progmodes/scheme.el30
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index 17f0fda331c..4342b420171 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1986, 87, 88, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1986, 87, 88, 1997 Free Software Foundation, Inc.
4 4
5;; Author: Bill Rozas <jinx@martigny.ai.mit.edu> 5;; Author: Bill Rozas <jinx@martigny.ai.mit.edu>
6;; Maintainer: FSF 6;; Adapted-by: Dave Love <d.love@dl.ac.uk>
7;; Keywords: languages, lisp 7;; Keywords: languages, lisp
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -23,10 +23,6 @@
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24;; Boston, MA 02111-1307, USA. 24;; Boston, MA 02111-1307, USA.
25 25
26;; Originally adapted from Lisp mode by Bill Rozas, jinx@prep with a
27;; comment that the code should be merged back. Merging done by
28;; d.love@dl.ac.uk when DSSSL features added.
29
30;;; Commentary: 26;;; Commentary:
31 27
32;; The major mode for editing Scheme-type Lisp code, very similar to 28;; The major mode for editing Scheme-type Lisp code, very similar to
@@ -116,11 +112,11 @@
116 112
117(defvar scheme-imenu-generic-expression 113(defvar scheme-imenu-generic-expression
118 '((nil 114 '((nil
119 "^(define\\(\\|-\\(generic\\(\\|-procedure\\)\\|method\\)\\)*\\s-+(?\\(\\(\\sw\\|\\s_\\)+\\)" 4) 115 "^(define\\(\\|-\\(generic\\(\\|-procedure\\)\\|method\\)\\)*\\s-+(?\\(\\sw+\\)" 4)
120 (" Types" 116 (" Types"
121 "^(define-class\\s-+(?\\(\\(\\sw\\|\\s_\\)+\\)" 1) 117 "^(define-class\\s-+(?\\(\\sw+\\)" 1)
122 (" Macros" 118 (" Macros"
123 "^(\\(defmacro\\|define-macro\\|define-syntax\\)\\s-+(?\\(\\(\\sw\\|\\s_\\)+\\)" 2)) 119 "^(\\(defmacro\\|define-macro\\|define-syntax\\)\\s-+(?\\(\\sw+\\)" 2))
124 "Imenu generic expression for Scheme mode. See `imenu-generic-expression'.") 120 "Imenu generic expression for Scheme mode. See `imenu-generic-expression'.")
125 121
126(defun scheme-mode-variables () 122(defun scheme-mode-variables ()
@@ -162,9 +158,12 @@
162 (make-local-variable 'lisp-indent-function) 158 (make-local-variable 'lisp-indent-function)
163 (set lisp-indent-function 'scheme-indent-function) 159 (set lisp-indent-function 'scheme-indent-function)
164 (setq mode-line-process '("" scheme-mode-line-process)) 160 (setq mode-line-process '("" scheme-mode-line-process))
161 (make-local-variable 'imenu-case-fold-search)
162 (setq imenu-case-fold-search t)
165 (make-local-variable 'imenu-generic-expression) 163 (make-local-variable 'imenu-generic-expression)
166 (setq imenu-generic-expression scheme-imenu-generic-expression) 164 (setq imenu-generic-expression scheme-imenu-generic-expression)
167 (setq imenu-case-fold-search t)) 165 (make-local-variable 'imenu-syntax-alist)
166 (setq imenu-syntax-alist '(("+-*/.<>=?!$%_&~^:" . "w"))))
168 167
169(defvar scheme-mode-line-process "") 168(defvar scheme-mode-line-process "")
170 169
@@ -266,15 +265,15 @@ See `run-hooks'."
266 ;; should be at the first level, though you don't see this anyhow if 265 ;; should be at the first level, though you don't see this anyhow if
267 ;; it gets split up. 266 ;; it gets split up.
268 '((" Defines" 267 '((" Defines"
269 "^(define\\s-+(?\\(\\(\\sw\\|\\s_\\)+\\)" 1) 268 "^(define\\s-+(?\\(\\sw+\\)" 1)
270 (" Modes" 269 (" Modes"
271 "^\\s-*(mode\\s-+\\(\\(\\sw\\|\\s-\\|\\s_\\)+\\)" 1) 270 "^\\s-*(mode\\s-+\\(\\(\\sw\\|\\s-\\)+\\)" 1)
272 (" Elements" 271 (" Elements"
273 ;; (element foo ...) or (element (foo bar ...) ...) 272 ;; (element foo ...) or (element (foo bar ...) ...)
274 ;; Fixme: Perhaps it should do `root'. 273 ;; Fixme: Perhaps it should do `root'.
275 "^\\s-*(element\\s-+(?\\(\\(\\sw\\|\\s-\\|\\s_\\)+\\))?" 1) 274 "^\\s-*(element\\s-+(?\\(\\(\\sw\\|\\s-\\)+\\))?" 1)
276 (" Declarations" 275 (" Declarations"
277 "^(declare\\(-\\sw+\\)+\\>\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" 2)) 276 "^(declare\\(-\\sw+\\)+\\>\\s-+\\(\\sw+\\)" 2))
278 "Imenu generic expression for DSSSL mode. See `imenu-generic-expression'.") 277 "Imenu generic expression for DSSSL mode. See `imenu-generic-expression'.")
279 278
280;;;###autoload 279;;;###autoload
@@ -295,7 +294,7 @@ if that value is non-nil and inserts the value of
295 (scheme-mode-initialize) 294 (scheme-mode-initialize)
296 (make-local-variable 'font-lock-defaults) 295 (make-local-variable 'font-lock-defaults)
297 (setq font-lock-defaults '(dsssl-font-lock-keywords 296 (setq font-lock-defaults '(dsssl-font-lock-keywords
298 nil t (("+-*/.<>=!?$%_&~^:" . "w")) 297 nil t (("+-*/.<>=?$%_&~^:" . "w"))
299 beginning-of-defun 298 beginning-of-defun
300 (font-lock-comment-start-regexp . ";") 299 (font-lock-comment-start-regexp . ";")
301 (font-lock-mark-block-function . mark-defun))) 300 (font-lock-mark-block-function . mark-defun)))
@@ -311,8 +310,9 @@ if that value is non-nil and inserts the value of
311 (run-hooks 'scheme-mode-hook) 310 (run-hooks 'scheme-mode-hook)
312 (run-hooks 'dsssl-mode-hook) 311 (run-hooks 'dsssl-mode-hook)
313 (scheme-mode-variables) 312 (scheme-mode-variables)
313 (setq imenu-case-fold-search nil)
314 (setq imenu-generic-expression dsssl-imenu-generic-expression) 314 (setq imenu-generic-expression dsssl-imenu-generic-expression)
315 (setq imenu-case-fold-search nil)) 315 (setq imenu-syntax-alist '(("+-*/.<>=?$%_&~^:" . "w"))))
316 316
317;; Extra syntax for DSSSL. This isn't separated from Scheme, but 317;; Extra syntax for DSSSL. This isn't separated from Scheme, but
318;; shouldn't cause much trouble in scheme-mode. 318;; shouldn't cause much trouble in scheme-mode.