2001-07-16 12:23:00 +00:00
|
|
|
|
;;; scheme.el --- Scheme (and DSSSL) editing mode
|
1992-05-30 21:11:25 +00:00
|
|
|
|
|
2012-01-05 09:46:05 +00:00
|
|
|
|
;; Copyright (C) 1986-1988, 1997-1998, 2001-2012
|
2011-01-26 08:36:39 +00:00
|
|
|
|
;; Free Software Foundation, Inc.
|
1992-07-22 04:22:42 +00:00
|
|
|
|
|
1997-05-27 17:46:19 +00:00
|
|
|
|
;; Author: Bill Rozas <jinx@martigny.ai.mit.edu>
|
1998-02-12 18:20:21 +00:00
|
|
|
|
;; Adapted-by: Dave Love <d.love@dl.ac.uk>
|
1992-07-17 20:24:00 +00:00
|
|
|
|
;; Keywords: languages, lisp
|
1992-07-16 21:47:34 +00:00
|
|
|
|
|
1990-05-29 16:50:24 +00:00
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 07:25:26 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1990-05-29 16:50:24 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 07:25:26 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2008-05-06 07:25:26 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
1992-07-16 21:47:34 +00:00
|
|
|
|
;;; Commentary:
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
1997-04-10 19:41:00 +00:00
|
|
|
|
;; The major mode for editing Scheme-type Lisp code, very similar to
|
|
|
|
|
;; the Lisp mode documented in the Emacs manual. `dsssl-mode' is a
|
|
|
|
|
;; variant of scheme-mode for editing DSSSL specifications for SGML
|
|
|
|
|
;; documents. [As of Apr 1997, some pointers for DSSSL may be found,
|
|
|
|
|
;; for instance, at <URL:http://www.sil.org/sgml/related.html#dsssl>.]
|
|
|
|
|
;; All these Lisp-ish modes vary basically in details of the language
|
|
|
|
|
;; syntax they highlight/indent/index, but dsssl-mode uses "^;;;" as
|
2008-02-05 12:25:49 +00:00
|
|
|
|
;; the page-delimiter since ^L isn't normally a valid SGML character.
|
1997-04-10 19:41:00 +00:00
|
|
|
|
;;
|
|
|
|
|
;; For interacting with a Scheme interpreter See also `run-scheme' in
|
|
|
|
|
;; the `cmuscheme' package and also the implementation-specific
|
|
|
|
|
;; `xscheme' package.
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
1997-12-13 22:21:03 +00:00
|
|
|
|
;; Here's a recipe to generate a TAGS file for DSSSL, by the way:
|
|
|
|
|
;; etags --lang=scheme --regex='/[ \t]*(\(mode\|element\)[ \t
|
|
|
|
|
;; ]+\([^ \t(
|
|
|
|
|
;; ]+\)/\2/' --regex='/[ \t]*(element[ \t
|
|
|
|
|
;; ]*([^)]+[ \t
|
|
|
|
|
;; ]+\([^)]+\)[ \t
|
|
|
|
|
;; ]*)/\1/' --regex='/(declare[^ \t
|
|
|
|
|
;; ]*[ \t
|
|
|
|
|
;; ]+\([^ \t
|
|
|
|
|
;; ]+\)/\1/' "$@"
|
|
|
|
|
|
1992-07-16 21:47:34 +00:00
|
|
|
|
;;; Code:
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(require 'lisp-mode)
|
|
|
|
|
|
2003-02-11 21:23:00 +00:00
|
|
|
|
(defvar scheme-mode-syntax-table
|
|
|
|
|
(let ((st (make-syntax-table))
|
|
|
|
|
(i 0))
|
2011-08-22 03:38:30 +00:00
|
|
|
|
;; Symbol constituents
|
|
|
|
|
;; We used to treat chars 128-256 as symbol-constituent, but they
|
|
|
|
|
;; should be valid word constituents (Bug#8843). Note that valid
|
|
|
|
|
;; identifier characters are Scheme-implementation dependent.
|
|
|
|
|
(while (< i ?0)
|
2003-03-10 11:35:43 +00:00
|
|
|
|
(modify-syntax-entry i "_ " st)
|
|
|
|
|
(setq i (1+ i)))
|
2011-08-22 03:38:30 +00:00
|
|
|
|
(setq i (1+ ?9))
|
|
|
|
|
(while (< i ?A)
|
|
|
|
|
(modify-syntax-entry i "_ " st)
|
2003-03-10 11:35:43 +00:00
|
|
|
|
(setq i (1+ i)))
|
2011-08-22 03:38:30 +00:00
|
|
|
|
(setq i (1+ ?Z))
|
|
|
|
|
(while (< i ?a)
|
|
|
|
|
(modify-syntax-entry i "_ " st)
|
2003-03-10 11:35:43 +00:00
|
|
|
|
(setq i (1+ i)))
|
2011-08-22 03:38:30 +00:00
|
|
|
|
(setq i (1+ ?z))
|
|
|
|
|
(while (< i 128)
|
|
|
|
|
(modify-syntax-entry i "_ " st)
|
2003-03-10 11:35:43 +00:00
|
|
|
|
(setq i (1+ i)))
|
|
|
|
|
|
|
|
|
|
;; Whitespace
|
|
|
|
|
(modify-syntax-entry ?\t " " st)
|
|
|
|
|
(modify-syntax-entry ?\n "> " st)
|
|
|
|
|
(modify-syntax-entry ?\f " " st)
|
|
|
|
|
(modify-syntax-entry ?\r " " st)
|
2005-07-04 03:22:03 +00:00
|
|
|
|
(modify-syntax-entry ?\s " " st)
|
2003-03-10 11:35:43 +00:00
|
|
|
|
|
|
|
|
|
;; These characters are delimiters but otherwise undefined.
|
|
|
|
|
;; Brackets and braces balance for editing convenience.
|
|
|
|
|
(modify-syntax-entry ?\[ "(] " st)
|
|
|
|
|
(modify-syntax-entry ?\] ")[ " st)
|
|
|
|
|
(modify-syntax-entry ?{ "(} " st)
|
|
|
|
|
(modify-syntax-entry ?} "){ " st)
|
2005-10-05 14:23:13 +00:00
|
|
|
|
(modify-syntax-entry ?\| "\" 23bn" st)
|
|
|
|
|
;; Guile allows #! ... !# comments.
|
|
|
|
|
;; But SRFI-22 defines the comment as #!...\n instead.
|
|
|
|
|
;; Also Guile says that the !# should be on a line of its own.
|
|
|
|
|
;; It's too difficult to get it right, for too little benefit.
|
|
|
|
|
;; (modify-syntax-entry ?! "_ 2" st)
|
2003-03-10 11:35:43 +00:00
|
|
|
|
|
|
|
|
|
;; Other atom delimiters
|
|
|
|
|
(modify-syntax-entry ?\( "() " st)
|
|
|
|
|
(modify-syntax-entry ?\) ")( " st)
|
2005-10-05 15:31:44 +00:00
|
|
|
|
;; It's used for single-line comments as well as for #;(...) sexp-comments.
|
|
|
|
|
(modify-syntax-entry ?\; "< 2 " st)
|
|
|
|
|
(modify-syntax-entry ?\" "\" " st)
|
2003-04-24 01:41:45 +00:00
|
|
|
|
(modify-syntax-entry ?' "' " st)
|
|
|
|
|
(modify-syntax-entry ?` "' " st)
|
2003-03-10 11:35:43 +00:00
|
|
|
|
|
|
|
|
|
;; Special characters
|
2003-04-24 01:41:45 +00:00
|
|
|
|
(modify-syntax-entry ?, "' " st)
|
|
|
|
|
(modify-syntax-entry ?@ "' " st)
|
2010-08-12 14:44:16 +00:00
|
|
|
|
(modify-syntax-entry ?# "' 14" st)
|
2003-03-10 11:35:43 +00:00
|
|
|
|
(modify-syntax-entry ?\\ "\\ " st)
|
2003-02-11 21:23:00 +00:00
|
|
|
|
st))
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
1999-12-18 16:47:43 +00:00
|
|
|
|
(defvar scheme-mode-abbrev-table nil)
|
1990-05-29 16:50:24 +00:00
|
|
|
|
(define-abbrev-table 'scheme-mode-abbrev-table ())
|
|
|
|
|
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(defvar scheme-imenu-generic-expression
|
1999-12-18 16:47:43 +00:00
|
|
|
|
'((nil
|
1998-02-12 18:20:21 +00:00
|
|
|
|
"^(define\\(\\|-\\(generic\\(\\|-procedure\\)\\|method\\)\\)*\\s-+(?\\(\\sw+\\)" 4)
|
1999-12-18 16:47:43 +00:00
|
|
|
|
("Types"
|
1998-02-12 18:20:21 +00:00
|
|
|
|
"^(define-class\\s-+(?\\(\\sw+\\)" 1)
|
1998-04-17 20:46:21 +00:00
|
|
|
|
("Macros"
|
1998-02-12 18:20:21 +00:00
|
|
|
|
"^(\\(defmacro\\|define-macro\\|define-syntax\\)\\s-+(?\\(\\sw+\\)" 2))
|
1997-04-10 19:41:00 +00:00
|
|
|
|
"Imenu generic expression for Scheme mode. See `imenu-generic-expression'.")
|
|
|
|
|
|
1990-05-29 16:50:24 +00:00
|
|
|
|
(defun scheme-mode-variables ()
|
|
|
|
|
(set-syntax-table scheme-mode-syntax-table)
|
|
|
|
|
(setq local-abbrev-table scheme-mode-abbrev-table)
|
Derive from prog-mode, use derived-mode-p, and fix up various
minor style issues in lisp/progmodes.
* lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
make-local-hook.
* lisp/progmodes/sh-script.el (sh-require-final-newline): Remove.
(sh-set-shell): Don't set require-final-newline since it's already done
by prog-mode.
* lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
since we never set it.
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
Use read-string and standard prompt.
* lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
* lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
(meta-common-mode-map): Rename from meta-mode-map.
Remove C-m binding, which is a user preference, not mode specific.
(meta-common-mode): New major mode; replace meta-common-initialization.
* lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing
around with font-lock.
* lisp/progmodes/etags.el (select-tags-table-mode):
Derive from special-mode.
* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
Let define-derived-mode do its job.
* lisp/progmodes/cpp.el (cpp-edit-mode-map):
Move initialization into declaration.
(cpp-edit-mode): Use define-derived-mode.
(cpp-edit-load): Use derived-mode-p.
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/f90.el (f90-mode):
* lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting
require-final-newline since prog-mode does it already.
* lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string.
* lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
* lisp/progmodes/antlr-mode.el: Require cc-mode upfront.
(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
the declaration.
(antlr-directory-dependencies, antlr-show-makefile-rules):
Use derived-mode-p.
(antlr-language-option): Don't assume point-min==1.
(antlr-mode): Use define-derived-mode.
* lisp/progmodes/ada-mode.el: Use derived-mode-p.
(ada-mode): Use define-derived-mode.
Use hack-local-variables-hook.
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vera-mode.el (vera-mode):
* lisp/progmodes/sql.el (sql-mode):
* lisp/progmodes/scheme.el (scheme-mode):
* lisp/progmodes/perl-mode.el (perl-mode):
* lisp/progmodes/octave-inf.el (inferior-octave-mode):
* lisp/progmodes/autoconf.el (autoconf-mode):
* lisp/progmodes/m4-mode.el (m4-mode):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode):
* lisp/progmodes/idlwave.el (idlwave-mode):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/idlw-help.el (idlwave-help-mode):
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
(ebrowse-member-mode, ebrowse-electric-position-mode):
Use define-derived-mode.
* lisp/progmodes/xscheme.el (xscheme-start)
(local-set-scheme-interaction-buffer, scheme-interaction-mode):
* lisp/progmodes/which-func.el (which-function):
* lisp/progmodes/vhdl-mode.el (vhdl-set-style):
* lisp/progmodes/verilog-mode.el (verilog-set-compile-command)
(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
(verilog-set-define, verilog-auto-reeval-locals):
* lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
* lisp/progmodes/simula.el (simula-mode):
* lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
* lisp/progmodes/python.el (python-check, python-mode):
* lisp/progmodes/prolog.el (prolog-mode-variables):
* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions):
* lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame):
* lisp/progmodes/delphi.el (delphi-mode):
* lisp/progmodes/cc-styles.el (c-setup-paragraph-variables):
* lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init)
(c-font-lock-init): Move make-local-variable to their setq.
* lisp/progmodes/xscheme.el (exit-scheme-interaction-mode)
(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
(xscheme-debugger-mode-p, xscheme-send-string-1):
* lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
(tcl-load-file, tcl-restart-with-file):
* lisp/progmodes/ps-mode.el (ps-run-running):
* lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
* lisp/progmodes/js.el (js--get-all-known-symbols):
* lisp/progmodes/inf-lisp.el (inferior-lisp-proc):
* lisp/progmodes/idlwave.el (idlwave-beginning-of-statement)
(idlwave-template, idlwave-update-buffer-routine-info)
(idlwave-update-current-buffer-info)
(idlwave-get-routine-info-from-buffers, idlwave-choose)
(idlwave-scan-class-info, idlwave-fix-keywords)
(idlwave-list-buffer-load-path-shadows):
* lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
(idlwave-toolbar-remove):
* lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action)
(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
(idlwave-shell-menu-def):
* lisp/progmodes/idlw-complete-structtag.el
(idlwave-prepare-structure-tag-completion):
* lisp/progmodes/gud.el (gud-set-buffer):
* lisp/progmodes/f90.el (f90-backslash-not-special):
* lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 20:00:25 +00:00
|
|
|
|
(set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
|
|
|
|
|
(set (make-local-variable 'paragraph-separate) paragraph-start)
|
|
|
|
|
(set (make-local-variable 'paragraph-ignore-fill-prefix) t)
|
|
|
|
|
(set (make-local-variable 'fill-paragraph-function) 'lisp-fill-paragraph)
|
1997-04-10 19:41:00 +00:00
|
|
|
|
;; Adaptive fill mode gets in the way of auto-fill,
|
|
|
|
|
;; and should make no difference for explicit fill
|
|
|
|
|
;; because lisp-fill-paragraph should do the job.
|
Derive from prog-mode, use derived-mode-p, and fix up various
minor style issues in lisp/progmodes.
* lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
make-local-hook.
* lisp/progmodes/sh-script.el (sh-require-final-newline): Remove.
(sh-set-shell): Don't set require-final-newline since it's already done
by prog-mode.
* lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
since we never set it.
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
Use read-string and standard prompt.
* lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
* lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
(meta-common-mode-map): Rename from meta-mode-map.
Remove C-m binding, which is a user preference, not mode specific.
(meta-common-mode): New major mode; replace meta-common-initialization.
* lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing
around with font-lock.
* lisp/progmodes/etags.el (select-tags-table-mode):
Derive from special-mode.
* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
Let define-derived-mode do its job.
* lisp/progmodes/cpp.el (cpp-edit-mode-map):
Move initialization into declaration.
(cpp-edit-mode): Use define-derived-mode.
(cpp-edit-load): Use derived-mode-p.
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/f90.el (f90-mode):
* lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting
require-final-newline since prog-mode does it already.
* lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string.
* lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
* lisp/progmodes/antlr-mode.el: Require cc-mode upfront.
(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
the declaration.
(antlr-directory-dependencies, antlr-show-makefile-rules):
Use derived-mode-p.
(antlr-language-option): Don't assume point-min==1.
(antlr-mode): Use define-derived-mode.
* lisp/progmodes/ada-mode.el: Use derived-mode-p.
(ada-mode): Use define-derived-mode.
Use hack-local-variables-hook.
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vera-mode.el (vera-mode):
* lisp/progmodes/sql.el (sql-mode):
* lisp/progmodes/scheme.el (scheme-mode):
* lisp/progmodes/perl-mode.el (perl-mode):
* lisp/progmodes/octave-inf.el (inferior-octave-mode):
* lisp/progmodes/autoconf.el (autoconf-mode):
* lisp/progmodes/m4-mode.el (m4-mode):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode):
* lisp/progmodes/idlwave.el (idlwave-mode):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/idlw-help.el (idlwave-help-mode):
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
(ebrowse-member-mode, ebrowse-electric-position-mode):
Use define-derived-mode.
* lisp/progmodes/xscheme.el (xscheme-start)
(local-set-scheme-interaction-buffer, scheme-interaction-mode):
* lisp/progmodes/which-func.el (which-function):
* lisp/progmodes/vhdl-mode.el (vhdl-set-style):
* lisp/progmodes/verilog-mode.el (verilog-set-compile-command)
(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
(verilog-set-define, verilog-auto-reeval-locals):
* lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
* lisp/progmodes/simula.el (simula-mode):
* lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
* lisp/progmodes/python.el (python-check, python-mode):
* lisp/progmodes/prolog.el (prolog-mode-variables):
* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions):
* lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame):
* lisp/progmodes/delphi.el (delphi-mode):
* lisp/progmodes/cc-styles.el (c-setup-paragraph-variables):
* lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init)
(c-font-lock-init): Move make-local-variable to their setq.
* lisp/progmodes/xscheme.el (exit-scheme-interaction-mode)
(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
(xscheme-debugger-mode-p, xscheme-send-string-1):
* lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
(tcl-load-file, tcl-restart-with-file):
* lisp/progmodes/ps-mode.el (ps-run-running):
* lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
* lisp/progmodes/js.el (js--get-all-known-symbols):
* lisp/progmodes/inf-lisp.el (inferior-lisp-proc):
* lisp/progmodes/idlwave.el (idlwave-beginning-of-statement)
(idlwave-template, idlwave-update-buffer-routine-info)
(idlwave-update-current-buffer-info)
(idlwave-get-routine-info-from-buffers, idlwave-choose)
(idlwave-scan-class-info, idlwave-fix-keywords)
(idlwave-list-buffer-load-path-shadows):
* lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
(idlwave-toolbar-remove):
* lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action)
(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
(idlwave-shell-menu-def):
* lisp/progmodes/idlw-complete-structtag.el
(idlwave-prepare-structure-tag-completion):
* lisp/progmodes/gud.el (gud-set-buffer):
* lisp/progmodes/f90.el (f90-backslash-not-special):
* lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 20:00:25 +00:00
|
|
|
|
(set (make-local-variable 'adaptive-fill-mode) nil)
|
|
|
|
|
(set (make-local-variable 'indent-line-function) 'lisp-indent-line)
|
|
|
|
|
(set (make-local-variable 'parse-sexp-ignore-comments) t)
|
|
|
|
|
(set (make-local-variable 'outline-regexp) ";;; \\|(....")
|
|
|
|
|
(set (make-local-variable 'comment-start) ";")
|
2005-01-28 18:57:45 +00:00
|
|
|
|
(set (make-local-variable 'comment-add) 1)
|
1996-07-04 05:45:55 +00:00
|
|
|
|
;; Look within the line for a ; following an even number of backslashes
|
|
|
|
|
;; after either a non-backslash or the line beginning.
|
Derive from prog-mode, use derived-mode-p, and fix up various
minor style issues in lisp/progmodes.
* lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
make-local-hook.
* lisp/progmodes/sh-script.el (sh-require-final-newline): Remove.
(sh-set-shell): Don't set require-final-newline since it's already done
by prog-mode.
* lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
since we never set it.
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
Use read-string and standard prompt.
* lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
* lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
(meta-common-mode-map): Rename from meta-mode-map.
Remove C-m binding, which is a user preference, not mode specific.
(meta-common-mode): New major mode; replace meta-common-initialization.
* lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing
around with font-lock.
* lisp/progmodes/etags.el (select-tags-table-mode):
Derive from special-mode.
* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
Let define-derived-mode do its job.
* lisp/progmodes/cpp.el (cpp-edit-mode-map):
Move initialization into declaration.
(cpp-edit-mode): Use define-derived-mode.
(cpp-edit-load): Use derived-mode-p.
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/f90.el (f90-mode):
* lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting
require-final-newline since prog-mode does it already.
* lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string.
* lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
* lisp/progmodes/antlr-mode.el: Require cc-mode upfront.
(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
the declaration.
(antlr-directory-dependencies, antlr-show-makefile-rules):
Use derived-mode-p.
(antlr-language-option): Don't assume point-min==1.
(antlr-mode): Use define-derived-mode.
* lisp/progmodes/ada-mode.el: Use derived-mode-p.
(ada-mode): Use define-derived-mode.
Use hack-local-variables-hook.
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vera-mode.el (vera-mode):
* lisp/progmodes/sql.el (sql-mode):
* lisp/progmodes/scheme.el (scheme-mode):
* lisp/progmodes/perl-mode.el (perl-mode):
* lisp/progmodes/octave-inf.el (inferior-octave-mode):
* lisp/progmodes/autoconf.el (autoconf-mode):
* lisp/progmodes/m4-mode.el (m4-mode):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode):
* lisp/progmodes/idlwave.el (idlwave-mode):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/idlw-help.el (idlwave-help-mode):
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
(ebrowse-member-mode, ebrowse-electric-position-mode):
Use define-derived-mode.
* lisp/progmodes/xscheme.el (xscheme-start)
(local-set-scheme-interaction-buffer, scheme-interaction-mode):
* lisp/progmodes/which-func.el (which-function):
* lisp/progmodes/vhdl-mode.el (vhdl-set-style):
* lisp/progmodes/verilog-mode.el (verilog-set-compile-command)
(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
(verilog-set-define, verilog-auto-reeval-locals):
* lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
* lisp/progmodes/simula.el (simula-mode):
* lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
* lisp/progmodes/python.el (python-check, python-mode):
* lisp/progmodes/prolog.el (prolog-mode-variables):
* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions):
* lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame):
* lisp/progmodes/delphi.el (delphi-mode):
* lisp/progmodes/cc-styles.el (c-setup-paragraph-variables):
* lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init)
(c-font-lock-init): Move make-local-variable to their setq.
* lisp/progmodes/xscheme.el (exit-scheme-interaction-mode)
(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
(xscheme-debugger-mode-p, xscheme-send-string-1):
* lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
(tcl-load-file, tcl-restart-with-file):
* lisp/progmodes/ps-mode.el (ps-run-running):
* lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
* lisp/progmodes/js.el (js--get-all-known-symbols):
* lisp/progmodes/inf-lisp.el (inferior-lisp-proc):
* lisp/progmodes/idlwave.el (idlwave-beginning-of-statement)
(idlwave-template, idlwave-update-buffer-routine-info)
(idlwave-update-current-buffer-info)
(idlwave-get-routine-info-from-buffers, idlwave-choose)
(idlwave-scan-class-info, idlwave-fix-keywords)
(idlwave-list-buffer-load-path-shadows):
* lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
(idlwave-toolbar-remove):
* lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action)
(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
(idlwave-shell-menu-def):
* lisp/progmodes/idlw-complete-structtag.el
(idlwave-prepare-structure-tag-completion):
* lisp/progmodes/gud.el (gud-set-buffer):
* lisp/progmodes/f90.el (f90-backslash-not-special):
* lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 20:00:25 +00:00
|
|
|
|
(set (make-local-variable 'comment-start-skip)
|
|
|
|
|
"\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
|
2007-08-18 23:45:58 +00:00
|
|
|
|
(set (make-local-variable 'font-lock-comment-start-skip) ";+ *")
|
Derive from prog-mode, use derived-mode-p, and fix up various
minor style issues in lisp/progmodes.
* lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
make-local-hook.
* lisp/progmodes/sh-script.el (sh-require-final-newline): Remove.
(sh-set-shell): Don't set require-final-newline since it's already done
by prog-mode.
* lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
since we never set it.
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
Use read-string and standard prompt.
* lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
* lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
(meta-common-mode-map): Rename from meta-mode-map.
Remove C-m binding, which is a user preference, not mode specific.
(meta-common-mode): New major mode; replace meta-common-initialization.
* lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing
around with font-lock.
* lisp/progmodes/etags.el (select-tags-table-mode):
Derive from special-mode.
* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
Let define-derived-mode do its job.
* lisp/progmodes/cpp.el (cpp-edit-mode-map):
Move initialization into declaration.
(cpp-edit-mode): Use define-derived-mode.
(cpp-edit-load): Use derived-mode-p.
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/f90.el (f90-mode):
* lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting
require-final-newline since prog-mode does it already.
* lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string.
* lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
* lisp/progmodes/antlr-mode.el: Require cc-mode upfront.
(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
the declaration.
(antlr-directory-dependencies, antlr-show-makefile-rules):
Use derived-mode-p.
(antlr-language-option): Don't assume point-min==1.
(antlr-mode): Use define-derived-mode.
* lisp/progmodes/ada-mode.el: Use derived-mode-p.
(ada-mode): Use define-derived-mode.
Use hack-local-variables-hook.
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vera-mode.el (vera-mode):
* lisp/progmodes/sql.el (sql-mode):
* lisp/progmodes/scheme.el (scheme-mode):
* lisp/progmodes/perl-mode.el (perl-mode):
* lisp/progmodes/octave-inf.el (inferior-octave-mode):
* lisp/progmodes/autoconf.el (autoconf-mode):
* lisp/progmodes/m4-mode.el (m4-mode):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode):
* lisp/progmodes/idlwave.el (idlwave-mode):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/idlw-help.el (idlwave-help-mode):
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
(ebrowse-member-mode, ebrowse-electric-position-mode):
Use define-derived-mode.
* lisp/progmodes/xscheme.el (xscheme-start)
(local-set-scheme-interaction-buffer, scheme-interaction-mode):
* lisp/progmodes/which-func.el (which-function):
* lisp/progmodes/vhdl-mode.el (vhdl-set-style):
* lisp/progmodes/verilog-mode.el (verilog-set-compile-command)
(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
(verilog-set-define, verilog-auto-reeval-locals):
* lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
* lisp/progmodes/simula.el (simula-mode):
* lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
* lisp/progmodes/python.el (python-check, python-mode):
* lisp/progmodes/prolog.el (prolog-mode-variables):
* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions):
* lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame):
* lisp/progmodes/delphi.el (delphi-mode):
* lisp/progmodes/cc-styles.el (c-setup-paragraph-variables):
* lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init)
(c-font-lock-init): Move make-local-variable to their setq.
* lisp/progmodes/xscheme.el (exit-scheme-interaction-mode)
(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
(xscheme-debugger-mode-p, xscheme-send-string-1):
* lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
(tcl-load-file, tcl-restart-with-file):
* lisp/progmodes/ps-mode.el (ps-run-running):
* lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
* lisp/progmodes/js.el (js--get-all-known-symbols):
* lisp/progmodes/inf-lisp.el (inferior-lisp-proc):
* lisp/progmodes/idlwave.el (idlwave-beginning-of-statement)
(idlwave-template, idlwave-update-buffer-routine-info)
(idlwave-update-current-buffer-info)
(idlwave-get-routine-info-from-buffers, idlwave-choose)
(idlwave-scan-class-info, idlwave-fix-keywords)
(idlwave-list-buffer-load-path-shadows):
* lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
(idlwave-toolbar-remove):
* lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action)
(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
(idlwave-shell-menu-def):
* lisp/progmodes/idlw-complete-structtag.el
(idlwave-prepare-structure-tag-completion):
* lisp/progmodes/gud.el (gud-set-buffer):
* lisp/progmodes/f90.el (f90-backslash-not-special):
* lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 20:00:25 +00:00
|
|
|
|
(set (make-local-variable 'comment-column) 40)
|
|
|
|
|
(set (make-local-variable 'parse-sexp-ignore-comments) t)
|
|
|
|
|
(set (make-local-variable 'lisp-indent-function) 'scheme-indent-function)
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(setq mode-line-process '("" scheme-mode-line-process))
|
2000-10-11 09:46:28 +00:00
|
|
|
|
(set (make-local-variable 'imenu-case-fold-search) t)
|
1997-12-12 17:10:08 +00:00
|
|
|
|
(setq imenu-generic-expression scheme-imenu-generic-expression)
|
2000-10-11 09:46:28 +00:00
|
|
|
|
(set (make-local-variable 'imenu-syntax-alist)
|
|
|
|
|
'(("+-*/.<>=?!$%_&~^:" . "w")))
|
2005-10-05 15:31:44 +00:00
|
|
|
|
(set (make-local-variable 'font-lock-defaults)
|
|
|
|
|
'((scheme-font-lock-keywords
|
|
|
|
|
scheme-font-lock-keywords-1 scheme-font-lock-keywords-2)
|
|
|
|
|
nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14"))
|
|
|
|
|
beginning-of-defun
|
|
|
|
|
(font-lock-mark-block-function . mark-defun)
|
|
|
|
|
(font-lock-syntactic-face-function
|
|
|
|
|
. scheme-font-lock-syntactic-face-function)
|
|
|
|
|
(parse-sexp-lookup-properties . t)
|
|
|
|
|
(font-lock-extra-managed-props syntax-table)))
|
|
|
|
|
(set (make-local-variable 'lisp-doc-string-elt-property)
|
|
|
|
|
'scheme-doc-string-elt))
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
|
|
|
|
(defvar scheme-mode-line-process "")
|
|
|
|
|
|
2005-01-28 18:57:45 +00:00
|
|
|
|
(defvar scheme-mode-map
|
|
|
|
|
(let ((smap (make-sparse-keymap))
|
|
|
|
|
(map (make-sparse-keymap "Scheme")))
|
|
|
|
|
(set-keymap-parent smap lisp-mode-shared-map)
|
|
|
|
|
(define-key smap [menu-bar scheme] (cons "Scheme" map))
|
2000-11-14 14:41:38 +00:00
|
|
|
|
(define-key map [run-scheme] '("Run Inferior Scheme" . run-scheme))
|
|
|
|
|
(define-key map [uncomment-region]
|
|
|
|
|
'("Uncomment Out Region" . (lambda (beg end)
|
|
|
|
|
(interactive "r")
|
|
|
|
|
(comment-region beg end '(4)))))
|
|
|
|
|
(define-key map [comment-region] '("Comment Out Region" . comment-region))
|
|
|
|
|
(define-key map [indent-region] '("Indent Region" . indent-region))
|
|
|
|
|
(define-key map [indent-line] '("Indent Line" . lisp-indent-line))
|
|
|
|
|
(put 'comment-region 'menu-enable 'mark-active)
|
|
|
|
|
(put 'uncomment-region 'menu-enable 'mark-active)
|
2005-01-28 18:57:45 +00:00
|
|
|
|
(put 'indent-region 'menu-enable 'mark-active)
|
|
|
|
|
smap)
|
|
|
|
|
"Keymap for Scheme mode.
|
|
|
|
|
All commands in `lisp-mode-shared-map' are inherited by this map.")
|
1997-04-10 19:41:00 +00:00
|
|
|
|
|
|
|
|
|
;; Used by cmuscheme
|
1990-05-29 16:50:24 +00:00
|
|
|
|
(defun scheme-mode-commands (map)
|
1997-06-17 21:54:16 +00:00
|
|
|
|
;;(define-key map "\t" 'indent-for-tab-command) ; default
|
1990-05-29 16:50:24 +00:00
|
|
|
|
(define-key map "\177" 'backward-delete-char-untabify)
|
1997-06-17 21:54:16 +00:00
|
|
|
|
(define-key map "\e\C-q" 'indent-sexp))
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
1991-05-13 20:36:24 +00:00
|
|
|
|
;;;###autoload
|
Derive from prog-mode, use derived-mode-p, and fix up various
minor style issues in lisp/progmodes.
* lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
make-local-hook.
* lisp/progmodes/sh-script.el (sh-require-final-newline): Remove.
(sh-set-shell): Don't set require-final-newline since it's already done
by prog-mode.
* lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
since we never set it.
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
Use read-string and standard prompt.
* lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
* lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
(meta-common-mode-map): Rename from meta-mode-map.
Remove C-m binding, which is a user preference, not mode specific.
(meta-common-mode): New major mode; replace meta-common-initialization.
* lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing
around with font-lock.
* lisp/progmodes/etags.el (select-tags-table-mode):
Derive from special-mode.
* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
Let define-derived-mode do its job.
* lisp/progmodes/cpp.el (cpp-edit-mode-map):
Move initialization into declaration.
(cpp-edit-mode): Use define-derived-mode.
(cpp-edit-load): Use derived-mode-p.
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/f90.el (f90-mode):
* lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting
require-final-newline since prog-mode does it already.
* lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string.
* lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
* lisp/progmodes/antlr-mode.el: Require cc-mode upfront.
(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
the declaration.
(antlr-directory-dependencies, antlr-show-makefile-rules):
Use derived-mode-p.
(antlr-language-option): Don't assume point-min==1.
(antlr-mode): Use define-derived-mode.
* lisp/progmodes/ada-mode.el: Use derived-mode-p.
(ada-mode): Use define-derived-mode.
Use hack-local-variables-hook.
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vera-mode.el (vera-mode):
* lisp/progmodes/sql.el (sql-mode):
* lisp/progmodes/scheme.el (scheme-mode):
* lisp/progmodes/perl-mode.el (perl-mode):
* lisp/progmodes/octave-inf.el (inferior-octave-mode):
* lisp/progmodes/autoconf.el (autoconf-mode):
* lisp/progmodes/m4-mode.el (m4-mode):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode):
* lisp/progmodes/idlwave.el (idlwave-mode):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/idlw-help.el (idlwave-help-mode):
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
(ebrowse-member-mode, ebrowse-electric-position-mode):
Use define-derived-mode.
* lisp/progmodes/xscheme.el (xscheme-start)
(local-set-scheme-interaction-buffer, scheme-interaction-mode):
* lisp/progmodes/which-func.el (which-function):
* lisp/progmodes/vhdl-mode.el (vhdl-set-style):
* lisp/progmodes/verilog-mode.el (verilog-set-compile-command)
(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
(verilog-set-define, verilog-auto-reeval-locals):
* lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
* lisp/progmodes/simula.el (simula-mode):
* lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
* lisp/progmodes/python.el (python-check, python-mode):
* lisp/progmodes/prolog.el (prolog-mode-variables):
* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions):
* lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame):
* lisp/progmodes/delphi.el (delphi-mode):
* lisp/progmodes/cc-styles.el (c-setup-paragraph-variables):
* lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init)
(c-font-lock-init): Move make-local-variable to their setq.
* lisp/progmodes/xscheme.el (exit-scheme-interaction-mode)
(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
(xscheme-debugger-mode-p, xscheme-send-string-1):
* lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
(tcl-load-file, tcl-restart-with-file):
* lisp/progmodes/ps-mode.el (ps-run-running):
* lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
* lisp/progmodes/js.el (js--get-all-known-symbols):
* lisp/progmodes/inf-lisp.el (inferior-lisp-proc):
* lisp/progmodes/idlwave.el (idlwave-beginning-of-statement)
(idlwave-template, idlwave-update-buffer-routine-info)
(idlwave-update-current-buffer-info)
(idlwave-get-routine-info-from-buffers, idlwave-choose)
(idlwave-scan-class-info, idlwave-fix-keywords)
(idlwave-list-buffer-load-path-shadows):
* lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
(idlwave-toolbar-remove):
* lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action)
(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
(idlwave-shell-menu-def):
* lisp/progmodes/idlw-complete-structtag.el
(idlwave-prepare-structure-tag-completion):
* lisp/progmodes/gud.el (gud-set-buffer):
* lisp/progmodes/f90.el (f90-backslash-not-special):
* lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 20:00:25 +00:00
|
|
|
|
(define-derived-mode scheme-mode prog-mode "Scheme"
|
1990-05-29 16:50:24 +00:00
|
|
|
|
"Major mode for editing Scheme code.
|
1999-12-18 16:47:43 +00:00
|
|
|
|
Editing commands are similar to those of `lisp-mode'.
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
|
|
|
|
In addition, if an inferior Scheme process is running, some additional
|
|
|
|
|
commands will be defined, for evaluating expressions and controlling
|
|
|
|
|
the interpreter, and the state of the process will be displayed in the
|
2012-06-02 10:56:09 +00:00
|
|
|
|
mode line of all Scheme buffers. The names of commands that interact
|
2000-10-11 09:46:28 +00:00
|
|
|
|
with the Scheme process start with \"xscheme-\" if you use the MIT
|
|
|
|
|
Scheme-specific `xscheme' package; for more information see the
|
|
|
|
|
documentation for `xscheme-interaction-mode'. Use \\[run-scheme] to
|
|
|
|
|
start an inferior Scheme using the more general `cmuscheme' package.
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
|
Delete converts tabs to spaces as it moves back.
|
|
|
|
|
Blank lines separate paragraphs. Semicolons start comments.
|
|
|
|
|
\\{scheme-mode-map}
|
1999-12-18 16:47:43 +00:00
|
|
|
|
Entry to this mode calls the value of `scheme-mode-hook'
|
1990-05-29 16:50:24 +00:00
|
|
|
|
if that value is non-nil."
|
Derive from prog-mode, use derived-mode-p, and fix up various
minor style issues in lisp/progmodes.
* lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
make-local-hook.
* lisp/progmodes/sh-script.el (sh-require-final-newline): Remove.
(sh-set-shell): Don't set require-final-newline since it's already done
by prog-mode.
* lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
since we never set it.
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
Use read-string and standard prompt.
* lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
* lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
(meta-common-mode-map): Rename from meta-mode-map.
Remove C-m binding, which is a user preference, not mode specific.
(meta-common-mode): New major mode; replace meta-common-initialization.
* lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing
around with font-lock.
* lisp/progmodes/etags.el (select-tags-table-mode):
Derive from special-mode.
* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
Let define-derived-mode do its job.
* lisp/progmodes/cpp.el (cpp-edit-mode-map):
Move initialization into declaration.
(cpp-edit-mode): Use define-derived-mode.
(cpp-edit-load): Use derived-mode-p.
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/f90.el (f90-mode):
* lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting
require-final-newline since prog-mode does it already.
* lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string.
* lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
* lisp/progmodes/antlr-mode.el: Require cc-mode upfront.
(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
the declaration.
(antlr-directory-dependencies, antlr-show-makefile-rules):
Use derived-mode-p.
(antlr-language-option): Don't assume point-min==1.
(antlr-mode): Use define-derived-mode.
* lisp/progmodes/ada-mode.el: Use derived-mode-p.
(ada-mode): Use define-derived-mode.
Use hack-local-variables-hook.
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vera-mode.el (vera-mode):
* lisp/progmodes/sql.el (sql-mode):
* lisp/progmodes/scheme.el (scheme-mode):
* lisp/progmodes/perl-mode.el (perl-mode):
* lisp/progmodes/octave-inf.el (inferior-octave-mode):
* lisp/progmodes/autoconf.el (autoconf-mode):
* lisp/progmodes/m4-mode.el (m4-mode):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode):
* lisp/progmodes/idlwave.el (idlwave-mode):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/idlw-help.el (idlwave-help-mode):
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
(ebrowse-member-mode, ebrowse-electric-position-mode):
Use define-derived-mode.
* lisp/progmodes/xscheme.el (xscheme-start)
(local-set-scheme-interaction-buffer, scheme-interaction-mode):
* lisp/progmodes/which-func.el (which-function):
* lisp/progmodes/vhdl-mode.el (vhdl-set-style):
* lisp/progmodes/verilog-mode.el (verilog-set-compile-command)
(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
(verilog-set-define, verilog-auto-reeval-locals):
* lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
* lisp/progmodes/simula.el (simula-mode):
* lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
* lisp/progmodes/python.el (python-check, python-mode):
* lisp/progmodes/prolog.el (prolog-mode-variables):
* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions):
* lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame):
* lisp/progmodes/delphi.el (delphi-mode):
* lisp/progmodes/cc-styles.el (c-setup-paragraph-variables):
* lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init)
(c-font-lock-init): Move make-local-variable to their setq.
* lisp/progmodes/xscheme.el (exit-scheme-interaction-mode)
(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
(xscheme-debugger-mode-p, xscheme-send-string-1):
* lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
(tcl-load-file, tcl-restart-with-file):
* lisp/progmodes/ps-mode.el (ps-run-running):
* lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
* lisp/progmodes/js.el (js--get-all-known-symbols):
* lisp/progmodes/inf-lisp.el (inferior-lisp-proc):
* lisp/progmodes/idlwave.el (idlwave-beginning-of-statement)
(idlwave-template, idlwave-update-buffer-routine-info)
(idlwave-update-current-buffer-info)
(idlwave-get-routine-info-from-buffers, idlwave-choose)
(idlwave-scan-class-info, idlwave-fix-keywords)
(idlwave-list-buffer-load-path-shadows):
* lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
(idlwave-toolbar-remove):
* lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action)
(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
(idlwave-shell-menu-def):
* lisp/progmodes/idlw-complete-structtag.el
(idlwave-prepare-structure-tag-completion):
* lisp/progmodes/gud.el (gud-set-buffer):
* lisp/progmodes/f90.el (f90-backslash-not-special):
* lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 20:00:25 +00:00
|
|
|
|
(scheme-mode-variables))
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
1997-06-17 21:54:16 +00:00
|
|
|
|
(defgroup scheme nil
|
2005-07-04 03:22:03 +00:00
|
|
|
|
"Editing Scheme code."
|
2005-11-17 07:40:11 +00:00
|
|
|
|
:link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
|
1997-06-17 21:54:16 +00:00
|
|
|
|
:group 'lisp)
|
|
|
|
|
|
|
|
|
|
(defcustom scheme-mit-dialect t
|
1990-05-29 16:50:24 +00:00
|
|
|
|
"If non-nil, scheme mode is specialized for MIT Scheme.
|
1997-06-17 21:54:16 +00:00
|
|
|
|
Set this to nil if you normally use another dialect."
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:group 'scheme)
|
1997-04-10 19:41:00 +00:00
|
|
|
|
|
1997-06-17 21:54:16 +00:00
|
|
|
|
(defcustom dsssl-sgml-declaration
|
1997-04-10 19:41:00 +00:00
|
|
|
|
"<!DOCTYPE style-sheet PUBLIC \"-//James Clark//DTD DSSSL Style Sheet//EN\">
|
|
|
|
|
"
|
2012-04-09 13:05:48 +00:00
|
|
|
|
"An SGML declaration for the DSSSL file.
|
1997-12-13 22:21:03 +00:00
|
|
|
|
If it is defined as a string this will be inserted into an empty buffer
|
1999-12-18 16:47:43 +00:00
|
|
|
|
which is in `dsssl-mode'. It is typically James Clark's style-sheet
|
1997-06-17 21:54:16 +00:00
|
|
|
|
doctype, as required for Jade."
|
1999-12-18 16:47:43 +00:00
|
|
|
|
:type '(choice (string :tag "Specified string")
|
1997-12-13 22:21:03 +00:00
|
|
|
|
(const :tag "None" :value nil))
|
|
|
|
|
:group 'scheme)
|
|
|
|
|
|
|
|
|
|
(defcustom scheme-mode-hook nil
|
1999-12-18 16:47:43 +00:00
|
|
|
|
"Normal hook run when entering `scheme-mode'.
|
1997-12-13 22:21:03 +00:00
|
|
|
|
See `run-hooks'."
|
|
|
|
|
:type 'hook
|
|
|
|
|
:group 'scheme)
|
|
|
|
|
|
|
|
|
|
(defcustom dsssl-mode-hook nil
|
1999-12-18 16:47:43 +00:00
|
|
|
|
"Normal hook run when entering `dsssl-mode'.
|
1997-12-13 22:21:03 +00:00
|
|
|
|
See `run-hooks'."
|
|
|
|
|
:type 'hook
|
1997-06-17 21:54:16 +00:00
|
|
|
|
:group 'scheme)
|
1997-04-10 19:41:00 +00:00
|
|
|
|
|
2000-11-14 17:19:59 +00:00
|
|
|
|
;; This is shared by cmuscheme and xscheme.
|
|
|
|
|
(defcustom scheme-program-name "scheme"
|
2012-04-09 13:05:48 +00:00
|
|
|
|
"Program invoked by the `run-scheme' command."
|
2000-11-14 17:19:59 +00:00
|
|
|
|
:type 'string
|
|
|
|
|
:group 'scheme)
|
|
|
|
|
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(defvar dsssl-imenu-generic-expression
|
|
|
|
|
;; Perhaps this should also look for the style-sheet DTD tags. I'm
|
|
|
|
|
;; not sure it's the best way to organize it; perhaps one type
|
|
|
|
|
;; should be at the first level, though you don't see this anyhow if
|
|
|
|
|
;; it gets split up.
|
1999-12-18 16:47:43 +00:00
|
|
|
|
'(("Defines"
|
1998-02-12 18:20:21 +00:00
|
|
|
|
"^(define\\s-+(?\\(\\sw+\\)" 1)
|
1998-04-17 20:46:21 +00:00
|
|
|
|
("Modes"
|
1998-02-12 18:20:21 +00:00
|
|
|
|
"^\\s-*(mode\\s-+\\(\\(\\sw\\|\\s-\\)+\\)" 1)
|
1998-04-17 20:46:21 +00:00
|
|
|
|
("Elements"
|
1997-04-10 19:41:00 +00:00
|
|
|
|
;; (element foo ...) or (element (foo bar ...) ...)
|
1997-04-27 17:50:39 +00:00
|
|
|
|
;; Fixme: Perhaps it should do `root'.
|
1998-02-12 18:20:21 +00:00
|
|
|
|
"^\\s-*(element\\s-+(?\\(\\(\\sw\\|\\s-\\)+\\))?" 1)
|
1999-12-18 16:47:43 +00:00
|
|
|
|
("Declarations"
|
1998-02-12 18:20:21 +00:00
|
|
|
|
"^(declare\\(-\\sw+\\)+\\>\\s-+\\(\\sw+\\)" 2))
|
1997-04-10 19:41:00 +00:00
|
|
|
|
"Imenu generic expression for DSSSL mode. See `imenu-generic-expression'.")
|
|
|
|
|
|
1998-03-10 22:51:23 +00:00
|
|
|
|
(defconst scheme-font-lock-keywords-1
|
|
|
|
|
(eval-when-compile
|
|
|
|
|
(list
|
|
|
|
|
;;
|
|
|
|
|
;; Declarations. Hannes Haug <hannes.haug@student.uni-tuebingen.de> says
|
|
|
|
|
;; this works for SOS, STklos, SCOOPS, Meroon and Tiny CLOS.
|
1998-07-07 19:27:40 +00:00
|
|
|
|
(list (concat "(\\(define\\*?\\("
|
1998-03-10 22:51:23 +00:00
|
|
|
|
;; Function names.
|
1998-07-07 19:27:40 +00:00
|
|
|
|
"\\(\\|-public\\|-method\\|-generic\\(-procedure\\)?\\)\\|"
|
1998-03-10 22:51:23 +00:00
|
|
|
|
;; Macro names, as variable names. A bit dubious, this.
|
2000-10-11 09:46:28 +00:00
|
|
|
|
"\\(-syntax\\|-macro\\)\\|"
|
1998-03-10 22:51:23 +00:00
|
|
|
|
;; Class names.
|
|
|
|
|
"-class"
|
1998-07-07 19:27:40 +00:00
|
|
|
|
;; Guile modules.
|
|
|
|
|
"\\|-module"
|
1998-03-10 22:51:23 +00:00
|
|
|
|
"\\)\\)\\>"
|
|
|
|
|
;; Any whitespace and declared object.
|
|
|
|
|
"[ \t]*(?"
|
|
|
|
|
"\\(\\sw+\\)?")
|
|
|
|
|
'(1 font-lock-keyword-face)
|
|
|
|
|
'(6 (cond ((match-beginning 3) font-lock-function-name-face)
|
|
|
|
|
((match-beginning 5) font-lock-variable-name-face)
|
|
|
|
|
(t font-lock-type-face))
|
|
|
|
|
nil t))
|
|
|
|
|
))
|
|
|
|
|
"Subdued expressions to highlight in Scheme modes.")
|
|
|
|
|
|
|
|
|
|
(defconst scheme-font-lock-keywords-2
|
|
|
|
|
(append scheme-font-lock-keywords-1
|
|
|
|
|
(eval-when-compile
|
|
|
|
|
(list
|
|
|
|
|
;;
|
|
|
|
|
;; Control structures.
|
|
|
|
|
(cons
|
|
|
|
|
(concat
|
|
|
|
|
"(" (regexp-opt
|
|
|
|
|
'("begin" "call-with-current-continuation" "call/cc"
|
|
|
|
|
"call-with-input-file" "call-with-output-file" "case" "cond"
|
|
|
|
|
"do" "else" "for-each" "if" "lambda"
|
|
|
|
|
"let" "let*" "let-syntax" "letrec" "letrec-syntax"
|
2008-02-22 11:12:09 +00:00
|
|
|
|
;; SRFI 11 usage comes up often enough.
|
|
|
|
|
"let-values" "let*-values"
|
1998-03-10 22:51:23 +00:00
|
|
|
|
;; Hannes Haug <hannes.haug@student.uni-tuebingen.de> wants:
|
2004-01-15 14:18:24 +00:00
|
|
|
|
"and" "or" "delay" "force"
|
1998-03-10 22:51:23 +00:00
|
|
|
|
;; Stefan Monnier <stefan.monnier@epfl.ch> says don't bother:
|
|
|
|
|
;;"quasiquote" "quote" "unquote" "unquote-splicing"
|
|
|
|
|
"map" "syntax" "syntax-rules") t)
|
|
|
|
|
"\\>") 1)
|
|
|
|
|
;;
|
2005-02-20 12:07:08 +00:00
|
|
|
|
;; It wouldn't be Scheme w/o named-let.
|
|
|
|
|
'("(let\\s-+\\(\\sw+\\)"
|
|
|
|
|
(1 font-lock-function-name-face))
|
|
|
|
|
;;
|
1998-03-10 22:51:23 +00:00
|
|
|
|
;; David Fox <fox@graphics.cs.nyu.edu> for SOS/STklos class specifiers.
|
|
|
|
|
'("\\<<\\sw+>\\>" . font-lock-type-face)
|
|
|
|
|
;;
|
2003-09-30 11:47:57 +00:00
|
|
|
|
;; Scheme `:' and `#:' keywords as builtins.
|
|
|
|
|
'("\\<#?:\\sw+\\>" . font-lock-builtin-face)
|
1998-03-10 22:51:23 +00:00
|
|
|
|
)))
|
|
|
|
|
"Gaudy expressions to highlight in Scheme modes.")
|
|
|
|
|
|
|
|
|
|
(defvar scheme-font-lock-keywords scheme-font-lock-keywords-1
|
|
|
|
|
"Default expressions to highlight in Scheme modes.")
|
|
|
|
|
|
2005-10-05 15:31:44 +00:00
|
|
|
|
(defconst scheme-sexp-comment-syntax-table
|
|
|
|
|
(let ((st (make-syntax-table scheme-mode-syntax-table)))
|
|
|
|
|
(modify-syntax-entry ?\; "." st)
|
|
|
|
|
(modify-syntax-entry ?\n " " st)
|
|
|
|
|
(modify-syntax-entry ?# "'" st)
|
|
|
|
|
st))
|
|
|
|
|
|
|
|
|
|
(put 'lambda 'scheme-doc-string-elt 2)
|
|
|
|
|
;; Docstring's pos in a `define' depends on whether it's a var or fun def.
|
|
|
|
|
(put 'define 'scheme-doc-string-elt
|
|
|
|
|
(lambda ()
|
|
|
|
|
;; The function is called with point right after "define".
|
|
|
|
|
(forward-comment (point-max))
|
|
|
|
|
(if (eq (char-after) ?\() 2 0)))
|
|
|
|
|
|
2005-10-05 14:23:13 +00:00
|
|
|
|
(defun scheme-font-lock-syntactic-face-function (state)
|
2005-10-05 15:31:44 +00:00
|
|
|
|
(when (and (null (nth 3 state))
|
|
|
|
|
(eq (char-after (nth 8 state)) ?#)
|
|
|
|
|
(eq (char-after (1+ (nth 8 state))) ?\;))
|
|
|
|
|
;; It's a sexp-comment. Tell parse-partial-sexp where it ends.
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((pos (point))
|
|
|
|
|
(end
|
|
|
|
|
(condition-case err
|
|
|
|
|
(let ((parse-sexp-lookup-properties nil))
|
|
|
|
|
(goto-char (+ 2 (nth 8 state)))
|
|
|
|
|
;; FIXME: this doesn't handle the case where the sexp
|
|
|
|
|
;; itself contains a #; comment.
|
|
|
|
|
(forward-sexp 1)
|
|
|
|
|
(point))
|
|
|
|
|
(scan-error (nth 2 err)))))
|
|
|
|
|
(when (< pos (- end 2))
|
|
|
|
|
(put-text-property pos (- end 2)
|
|
|
|
|
'syntax-table scheme-sexp-comment-syntax-table))
|
|
|
|
|
(put-text-property (- end 1) end 'syntax-table '(12)))))
|
|
|
|
|
;; Choose the face to use.
|
|
|
|
|
(lisp-font-lock-syntactic-face-function state))
|
2005-10-05 14:23:13 +00:00
|
|
|
|
|
1997-04-10 19:41:00 +00:00
|
|
|
|
;;;###autoload
|
2005-01-28 18:57:45 +00:00
|
|
|
|
(define-derived-mode dsssl-mode scheme-mode "DSSSL"
|
1997-04-10 19:41:00 +00:00
|
|
|
|
"Major mode for editing DSSSL code.
|
1999-12-18 16:47:43 +00:00
|
|
|
|
Editing commands are similar to those of `lisp-mode'.
|
1997-04-10 19:41:00 +00:00
|
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
|
Delete converts tabs to spaces as it moves back.
|
|
|
|
|
Blank lines separate paragraphs. Semicolons start comments.
|
|
|
|
|
\\{scheme-mode-map}
|
1998-03-10 22:51:23 +00:00
|
|
|
|
Entering this mode runs the hooks `scheme-mode-hook' and then
|
|
|
|
|
`dsssl-mode-hook' and inserts the value of `dsssl-sgml-declaration' if
|
|
|
|
|
that variable's value is a string."
|
Derive from prog-mode, use derived-mode-p, and fix up various
minor style issues in lisp/progmodes.
* lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init)
(vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable ->
make-local-hook.
* lisp/progmodes/sh-script.el (sh-require-final-newline): Remove.
(sh-set-shell): Don't set require-final-newline since it's already done
by prog-mode.
* lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column
since we never set it.
* lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation):
Use read-string and standard prompt.
* lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration.
* lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl.
(meta-common-mode-syntax-table): Rename from meta-mode-syntax-table.
(meta-common-mode-map): Rename from meta-mode-map.
Remove C-m binding, which is a user preference, not mode specific.
(meta-common-mode): New major mode; replace meta-common-initialization.
* lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing
around with font-lock.
* lisp/progmodes/etags.el (select-tags-table-mode):
Derive from special-mode.
* lisp/progmodes/octave-mod.el (octave-mode):
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode)
(gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode)
(gdb-frames-mode, gdb-locals-mode, gdb-registers-mode):
Let define-derived-mode do its job.
* lisp/progmodes/cpp.el (cpp-edit-mode-map):
Move initialization into declaration.
(cpp-edit-mode): Use define-derived-mode.
(cpp-edit-load): Use derived-mode-p.
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/f90.el (f90-mode):
* lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting
require-final-newline since prog-mode does it already.
* lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string.
* lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup.
* lisp/progmodes/antlr-mode.el: Require cc-mode upfront.
(antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in
the declaration.
(antlr-directory-dependencies, antlr-show-makefile-rules):
Use derived-mode-p.
(antlr-language-option): Don't assume point-min==1.
(antlr-mode): Use define-derived-mode.
* lisp/progmodes/ada-mode.el: Use derived-mode-p.
(ada-mode): Use define-derived-mode.
Use hack-local-variables-hook.
* lisp/progmodes/vhdl-mode.el (vhdl-mode):
* lisp/progmodes/verilog-mode.el (verilog-mode):
* lisp/progmodes/vera-mode.el (vera-mode):
* lisp/progmodes/sql.el (sql-mode):
* lisp/progmodes/scheme.el (scheme-mode):
* lisp/progmodes/perl-mode.el (perl-mode):
* lisp/progmodes/octave-inf.el (inferior-octave-mode):
* lisp/progmodes/autoconf.el (autoconf-mode):
* lisp/progmodes/m4-mode.el (m4-mode):
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode):
* lisp/progmodes/idlwave.el (idlwave-mode):
* lisp/progmodes/icon.el (icon-mode):
* lisp/progmodes/idlw-help.el (idlwave-help-mode):
* lisp/progmodes/dcl-mode.el (dcl-mode):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode)
(ebrowse-member-mode, ebrowse-electric-position-mode):
Use define-derived-mode.
* lisp/progmodes/xscheme.el (xscheme-start)
(local-set-scheme-interaction-buffer, scheme-interaction-mode):
* lisp/progmodes/which-func.el (which-function):
* lisp/progmodes/vhdl-mode.el (vhdl-set-style):
* lisp/progmodes/verilog-mode.el (verilog-set-compile-command)
(verilog-modify-compile-command, verilog-error-regexp-add-xemacs)
(verilog-set-define, verilog-auto-reeval-locals):
* lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode):
* lisp/progmodes/simula.el (simula-mode):
* lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode):
* lisp/progmodes/python.el (python-check, python-mode):
* lisp/progmodes/prolog.el (prolog-mode-variables):
* lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions):
* lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame):
* lisp/progmodes/delphi.el (delphi-mode):
* lisp/progmodes/cc-styles.el (c-setup-paragraph-variables):
* lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init)
(c-font-lock-init): Move make-local-variable to their setq.
* lisp/progmodes/xscheme.el (exit-scheme-interaction-mode)
(xscheme-enter-interaction-mode, xscheme-enter-debugger-mode)
(xscheme-debugger-mode-p, xscheme-send-string-1):
* lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word)
(tcl-load-file, tcl-restart-with-file):
* lisp/progmodes/ps-mode.el (ps-run-running):
* lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint):
* lisp/progmodes/js.el (js--get-all-known-symbols):
* lisp/progmodes/inf-lisp.el (inferior-lisp-proc):
* lisp/progmodes/idlwave.el (idlwave-beginning-of-statement)
(idlwave-template, idlwave-update-buffer-routine-info)
(idlwave-update-current-buffer-info)
(idlwave-get-routine-info-from-buffers, idlwave-choose)
(idlwave-scan-class-info, idlwave-fix-keywords)
(idlwave-list-buffer-load-path-shadows):
* lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add)
(idlwave-toolbar-remove):
* lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action)
(idlwave-shell-file-name, idlwave-shell-electric-debug-all-off)
(idlwave-shell-menu-def):
* lisp/progmodes/idlw-complete-structtag.el
(idlwave-prepare-structure-tag-completion):
* lisp/progmodes/gud.el (gud-set-buffer):
* lisp/progmodes/f90.el (f90-backslash-not-special):
* lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
2010-12-10 20:00:25 +00:00
|
|
|
|
(set (make-local-variable 'page-delimiter) "^;;;") ; ^L not valid SGML char
|
1997-04-10 19:41:00 +00:00
|
|
|
|
;; Insert a suitable SGML declaration into an empty buffer.
|
2005-01-28 18:57:45 +00:00
|
|
|
|
;; FIXME: This should use `auto-insert-alist' instead.
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(and (zerop (buffer-size))
|
1997-04-27 17:50:39 +00:00
|
|
|
|
(stringp dsssl-sgml-declaration)
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(not buffer-read-only)
|
|
|
|
|
(insert dsssl-sgml-declaration))
|
1998-03-10 22:51:23 +00:00
|
|
|
|
(setq font-lock-defaults '(dsssl-font-lock-keywords
|
|
|
|
|
nil t (("+-*/.<>=?$%_&~^:" . "w"))
|
|
|
|
|
beginning-of-defun
|
|
|
|
|
(font-lock-mark-block-function . mark-defun)))
|
2000-10-11 09:46:28 +00:00
|
|
|
|
(set (make-local-variable 'imenu-case-fold-search) nil)
|
1997-12-12 17:10:08 +00:00
|
|
|
|
(setq imenu-generic-expression dsssl-imenu-generic-expression)
|
2000-10-11 09:46:28 +00:00
|
|
|
|
(set (make-local-variable 'imenu-syntax-alist)
|
2005-01-28 18:57:45 +00:00
|
|
|
|
'(("+-*/.<>=?$%_&~^:" . "w"))))
|
1997-04-10 19:41:00 +00:00
|
|
|
|
|
|
|
|
|
;; Extra syntax for DSSSL. This isn't separated from Scheme, but
|
|
|
|
|
;; shouldn't cause much trouble in scheme-mode.
|
|
|
|
|
(put 'element 'scheme-indent-function 1)
|
|
|
|
|
(put 'mode 'scheme-indent-function 1)
|
|
|
|
|
(put 'with-mode 'scheme-indent-function 1)
|
1997-04-11 20:05:42 +00:00
|
|
|
|
(put 'make 'scheme-indent-function 1)
|
1997-04-27 17:50:39 +00:00
|
|
|
|
(put 'style 'scheme-indent-function 1)
|
|
|
|
|
(put 'root 'scheme-indent-function 1)
|
1997-04-10 19:41:00 +00:00
|
|
|
|
|
|
|
|
|
(defvar dsssl-font-lock-keywords
|
1997-04-27 17:50:39 +00:00
|
|
|
|
(eval-when-compile
|
|
|
|
|
(list
|
|
|
|
|
;; Similar to Scheme
|
|
|
|
|
(list "(\\(define\\(-\\w+\\)?\\)\\>[ ]*\\\((?\\)\\(\\sw+\\)\\>"
|
|
|
|
|
'(1 font-lock-keyword-face)
|
|
|
|
|
'(4 font-lock-function-name-face))
|
|
|
|
|
(cons
|
|
|
|
|
(concat "(\\("
|
|
|
|
|
;; (make-regexp '("case" "cond" "else" "if" "lambda"
|
|
|
|
|
;; "let" "let*" "letrec" "and" "or" "map" "with-mode"))
|
|
|
|
|
"and\\|c\\(ase\\|ond\\)\\|else\\|if\\|"
|
|
|
|
|
"l\\(ambda\\|et\\(\\|*\\|rec\\)\\)\\|map\\|or\\|with-mode"
|
|
|
|
|
"\\)\\>")
|
|
|
|
|
1)
|
|
|
|
|
;; DSSSL syntax
|
|
|
|
|
'("(\\(element\\|mode\\|declare-\\w+\\)\\>[ ]*\\(\\sw+\\)"
|
|
|
|
|
(1 font-lock-keyword-face)
|
|
|
|
|
(2 font-lock-type-face))
|
|
|
|
|
'("(\\(element\\)\\>[ ]*(\\(\\S)+\\))"
|
|
|
|
|
(1 font-lock-keyword-face)
|
|
|
|
|
(2 font-lock-type-face))
|
1998-02-20 14:58:27 +00:00
|
|
|
|
'("\\<\\sw+:\\>" . font-lock-constant-face) ; trailing `:' c.f. scheme
|
1997-04-27 17:50:39 +00:00
|
|
|
|
;; SGML markup (from sgml-mode) :
|
|
|
|
|
'("<\\([!?][-a-z0-9]+\\)" 1 font-lock-keyword-face)
|
|
|
|
|
'("<\\(/?[-a-z0-9]+\\)" 1 font-lock-function-name-face)))
|
1997-04-10 19:41:00 +00:00
|
|
|
|
"Default expressions to highlight in DSSSL mode.")
|
|
|
|
|
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(defvar calculate-lisp-indent-last-sexp)
|
|
|
|
|
|
2011-09-13 06:55:10 +00:00
|
|
|
|
|
|
|
|
|
;; FIXME this duplicates almost all of lisp-indent-function.
|
|
|
|
|
;; Extract common code to a subroutine.
|
1990-05-29 16:50:24 +00:00
|
|
|
|
(defun scheme-indent-function (indent-point state)
|
2011-09-13 06:55:10 +00:00
|
|
|
|
"Scheme mode function for the value of the variable `lisp-indent-function'.
|
|
|
|
|
This behaves like the function `lisp-indent-function', except that:
|
|
|
|
|
|
|
|
|
|
i) it checks for a non-nil value of the property `scheme-indent-function'
|
2011-09-13 17:44:25 +00:00
|
|
|
|
\(or the deprecated `scheme-indent-hook'), rather than `lisp-indent-function'.
|
2011-09-13 06:55:10 +00:00
|
|
|
|
|
2011-09-13 17:57:04 +00:00
|
|
|
|
ii) if that property specifies a function, it is called with three
|
2011-09-13 06:55:10 +00:00
|
|
|
|
arguments (not two), the third argument being the default (i.e., current)
|
|
|
|
|
indentation."
|
1990-05-29 16:50:24 +00:00
|
|
|
|
(let ((normal-indent (current-column)))
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(goto-char (1+ (elt state 1)))
|
|
|
|
|
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
|
|
|
|
|
(if (and (elt state 2)
|
|
|
|
|
(not (looking-at "\\sw\\|\\s_")))
|
2002-07-03 12:01:24 +00:00
|
|
|
|
;; car of form doesn't seem to be a symbol
|
1997-04-10 19:41:00 +00:00
|
|
|
|
(progn
|
|
|
|
|
(if (not (> (save-excursion (forward-line 1) (point))
|
|
|
|
|
calculate-lisp-indent-last-sexp))
|
|
|
|
|
(progn (goto-char calculate-lisp-indent-last-sexp)
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(parse-partial-sexp (point)
|
|
|
|
|
calculate-lisp-indent-last-sexp 0 t)))
|
|
|
|
|
;; Indent under the list or under the first sexp on the same
|
|
|
|
|
;; line as calculate-lisp-indent-last-sexp. Note that first
|
|
|
|
|
;; thing on that line has to be complete sexp since we are
|
|
|
|
|
;; inside the innermost containing sexp.
|
|
|
|
|
(backward-prefix-chars)
|
|
|
|
|
(current-column))
|
|
|
|
|
(let ((function (buffer-substring (point)
|
|
|
|
|
(progn (forward-sexp 1) (point))))
|
|
|
|
|
method)
|
|
|
|
|
(setq method (or (get (intern-soft function) 'scheme-indent-function)
|
|
|
|
|
(get (intern-soft function) 'scheme-indent-hook)))
|
|
|
|
|
(cond ((or (eq method 'defun)
|
|
|
|
|
(and (null method)
|
|
|
|
|
(> (length function) 3)
|
|
|
|
|
(string-match "\\`def" function)))
|
|
|
|
|
(lisp-indent-defform state indent-point))
|
|
|
|
|
((integerp method)
|
|
|
|
|
(lisp-indent-specform method state
|
|
|
|
|
indent-point normal-indent))
|
|
|
|
|
(method
|
1997-10-16 18:07:23 +00:00
|
|
|
|
(funcall method state indent-point normal-indent)))))))
|
1997-04-10 19:41:00 +00:00
|
|
|
|
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
|
|
|
|
;;; Let is different in Scheme
|
|
|
|
|
|
|
|
|
|
(defun would-be-symbol (string)
|
|
|
|
|
(not (string-equal (substring string 0 1) "(")))
|
|
|
|
|
|
|
|
|
|
(defun next-sexp-as-string ()
|
1999-12-18 16:47:43 +00:00
|
|
|
|
;; Assumes that it is protected by a save-excursion
|
1990-05-29 16:50:24 +00:00
|
|
|
|
(forward-sexp 1)
|
|
|
|
|
(let ((the-end (point)))
|
|
|
|
|
(backward-sexp 1)
|
|
|
|
|
(buffer-substring (point) the-end)))
|
|
|
|
|
|
|
|
|
|
;; This is correct but too slow.
|
|
|
|
|
;; The one below works almost always.
|
|
|
|
|
;;(defun scheme-let-indent (state indent-point)
|
|
|
|
|
;; (if (would-be-symbol (next-sexp-as-string))
|
|
|
|
|
;; (scheme-indent-specform 2 state indent-point)
|
|
|
|
|
;; (scheme-indent-specform 1 state indent-point)))
|
|
|
|
|
|
1997-10-16 18:07:23 +00:00
|
|
|
|
(defun scheme-let-indent (state indent-point normal-indent)
|
1990-05-29 16:50:24 +00:00
|
|
|
|
(skip-chars-forward " \t")
|
1994-03-12 01:23:16 +00:00
|
|
|
|
(if (looking-at "[-a-zA-Z0-9+*/?!@$%^&_:~]")
|
1997-10-16 18:07:23 +00:00
|
|
|
|
(lisp-indent-specform 2 state indent-point normal-indent)
|
|
|
|
|
(lisp-indent-specform 1 state indent-point normal-indent)))
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
|
|
|
|
;; (put 'begin 'scheme-indent-function 0), say, causes begin to be indented
|
|
|
|
|
;; like defun if the first form is placed on the next line, otherwise
|
|
|
|
|
;; it is indented like any other form (i.e. forms line up under first).
|
|
|
|
|
|
|
|
|
|
(put 'begin 'scheme-indent-function 0)
|
|
|
|
|
(put 'case 'scheme-indent-function 1)
|
|
|
|
|
(put 'delay 'scheme-indent-function 0)
|
|
|
|
|
(put 'do 'scheme-indent-function 2)
|
|
|
|
|
(put 'lambda 'scheme-indent-function 1)
|
|
|
|
|
(put 'let 'scheme-indent-function 'scheme-let-indent)
|
|
|
|
|
(put 'let* 'scheme-indent-function 1)
|
|
|
|
|
(put 'letrec 'scheme-indent-function 1)
|
2008-02-22 11:12:09 +00:00
|
|
|
|
(put 'let-values 'scheme-indent-function 1) ; SRFI 11
|
|
|
|
|
(put 'let*-values 'scheme-indent-function 1) ; SRFI 11
|
1997-12-13 22:21:03 +00:00
|
|
|
|
(put 'sequence 'scheme-indent-function 0) ; SICP, not r4rs
|
|
|
|
|
(put 'let-syntax 'scheme-indent-function 1)
|
|
|
|
|
(put 'letrec-syntax 'scheme-indent-function 1)
|
|
|
|
|
(put 'syntax-rules 'scheme-indent-function 1)
|
2002-10-29 18:48:30 +00:00
|
|
|
|
(put 'syntax-case 'scheme-indent-function 2) ; not r5rs
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
|
|
|
|
(put 'call-with-input-file 'scheme-indent-function 1)
|
|
|
|
|
(put 'with-input-from-file 'scheme-indent-function 1)
|
|
|
|
|
(put 'with-input-from-port 'scheme-indent-function 1)
|
|
|
|
|
(put 'call-with-output-file 'scheme-indent-function 1)
|
|
|
|
|
(put 'with-output-to-file 'scheme-indent-function 1)
|
|
|
|
|
(put 'with-output-to-port 'scheme-indent-function 1)
|
1997-12-13 22:21:03 +00:00
|
|
|
|
(put 'call-with-values 'scheme-indent-function 1) ; r5rs?
|
|
|
|
|
(put 'dynamic-wind 'scheme-indent-function 3) ; r5rs?
|
1990-05-29 16:50:24 +00:00
|
|
|
|
|
|
|
|
|
;;;; MIT Scheme specific indentation.
|
|
|
|
|
|
|
|
|
|
(if scheme-mit-dialect
|
|
|
|
|
(progn
|
|
|
|
|
(put 'fluid-let 'scheme-indent-function 1)
|
|
|
|
|
(put 'in-package 'scheme-indent-function 1)
|
|
|
|
|
(put 'local-declare 'scheme-indent-function 1)
|
|
|
|
|
(put 'macro 'scheme-indent-function 1)
|
|
|
|
|
(put 'make-environment 'scheme-indent-function 0)
|
|
|
|
|
(put 'named-lambda 'scheme-indent-function 1)
|
|
|
|
|
(put 'using-syntax 'scheme-indent-function 1)
|
|
|
|
|
|
|
|
|
|
(put 'with-input-from-string 'scheme-indent-function 1)
|
|
|
|
|
(put 'with-output-to-string 'scheme-indent-function 0)
|
|
|
|
|
(put 'with-values 'scheme-indent-function 1)
|
|
|
|
|
|
|
|
|
|
(put 'syntax-table-define 'scheme-indent-function 2)
|
|
|
|
|
(put 'list-transform-positive 'scheme-indent-function 1)
|
|
|
|
|
(put 'list-transform-negative 'scheme-indent-function 1)
|
|
|
|
|
(put 'list-search-positive 'scheme-indent-function 1)
|
|
|
|
|
(put 'list-search-negative 'scheme-indent-function 1)
|
|
|
|
|
|
|
|
|
|
(put 'access-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'assignment-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'combination-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'comment-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'conditional-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'disjunction-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'declaration-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'definition-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'delay-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'in-package-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'lambda-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'lambda-components* 'scheme-indent-function 1)
|
|
|
|
|
(put 'lambda-components** 'scheme-indent-function 1)
|
|
|
|
|
(put 'open-block-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'pathname-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'procedure-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'sequence-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'unassigned\?-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'unbound\?-components 'scheme-indent-function 1)
|
|
|
|
|
(put 'variable-components 'scheme-indent-function 1)))
|
1992-03-16 20:39:07 +00:00
|
|
|
|
|
|
|
|
|
(provide 'scheme)
|
1992-05-30 21:11:25 +00:00
|
|
|
|
|
|
|
|
|
;;; scheme.el ends here
|