diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-12-10 15:00:25 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-12-10 15:00:25 -0500 |
commit | 175069efeb080517afefdd44a06f7a779ea8c25c (patch) | |
tree | 830e1af997994dd8d9b3fb3d6000810d138f9a9d /lisp/progmodes/xscheme.el | |
parent | fe646d2c4e800f7174915b26b9fdb6252bbd0453 (diff) | |
download | emacs-175069efeb080517afefdd44a06f7a779ea8c25c.tar.gz |
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.
Diffstat (limited to 'lisp/progmodes/xscheme.el')
-rw-r--r-- | lisp/progmodes/xscheme.el | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 217424b9424..f83a67f4adf 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -186,8 +186,7 @@ With argument, asks for a command line." (setq-default xscheme-process-command-line command-line) (switch-to-buffer (xscheme-start-process command-line process-name buffer-name)) - (make-local-variable 'xscheme-process-command-line) - (setq xscheme-process-command-line command-line)) + (set (make-local-variable 'xscheme-process-command-line) command-line)) (defun xscheme-read-command-line (arg) (let ((default @@ -278,13 +277,11 @@ With argument, asks for a command line." xscheme-buffer-name t))) (let ((process-name (verify-xscheme-buffer buffer-name t))) - (make-local-variable 'xscheme-buffer-name) - (setq xscheme-buffer-name buffer-name) - (make-local-variable 'xscheme-process-name) - (setq xscheme-process-name process-name) - (make-local-variable 'xscheme-runlight) - (setq xscheme-runlight (with-current-buffer buffer-name - xscheme-runlight)))) + (set (make-local-variable 'xscheme-buffer-name) buffer-name) + (set (make-local-variable 'xscheme-process-name) process-name) + (set (make-local-variable 'xscheme-runlight) + (with-current-buffer buffer-name + xscheme-runlight)))) (defun local-clear-scheme-interaction-buffer () "Make the current buffer use the default scheme interaction buffer." @@ -386,21 +383,19 @@ Entry to this mode calls the value of scheme-interaction-mode-hook with no args, if that value is non-nil. Likewise with the value of scheme-mode-hook. scheme-interaction-mode-hook is called after scheme-mode-hook." + ;; FIXME: Use define-derived-mode. (interactive "P") (if (not preserve) (let ((previous-mode major-mode)) (kill-all-local-variables) - (make-local-variable 'xscheme-previous-mode) - (make-local-variable 'xscheme-buffer-name) (make-local-variable 'xscheme-process-name) (make-local-variable 'xscheme-previous-process-state) (make-local-variable 'xscheme-runlight-string) (make-local-variable 'xscheme-runlight) - (make-local-variable 'xscheme-last-input-end) - (setq xscheme-previous-mode previous-mode) + (set (make-local-variable 'xscheme-previous-mode) previous-mode) (let ((buffer (current-buffer))) - (setq xscheme-buffer-name (buffer-name buffer)) - (setq xscheme-last-input-end (make-marker)) + (set (make-local-variable 'xscheme-buffer-name) (buffer-name buffer)) + (set (make-local-variable 'xscheme-last-input-end) (make-marker)) (let ((process (get-buffer-process buffer))) (if process (progn @@ -420,7 +415,7 @@ with no args, if that value is non-nil. (defun exit-scheme-interaction-mode () "Take buffer out of scheme interaction mode" (interactive) - (if (not (eq major-mode 'scheme-interaction-mode)) + (if (not (derived-mode-p 'scheme-interaction-mode)) (error "Buffer not in scheme interaction mode")) (let ((previous-state xscheme-previous-process-state)) (funcall xscheme-previous-mode) @@ -437,7 +432,7 @@ with no args, if that value is non-nil. (defun scheme-interaction-mode-initialize () (use-local-map scheme-interaction-mode-map) - (setq major-mode 'scheme-interaction-mode) + (setq major-mode 'scheme-interaction-mode) ;FIXME: Use define-derived-mode. (setq mode-name "Scheme Interaction")) (defun scheme-interaction-mode-commands (keymap) @@ -469,8 +464,8 @@ with no args, if that value is non-nil. (defun xscheme-enter-interaction-mode () (with-current-buffer (xscheme-process-buffer) - (if (not (eq major-mode 'scheme-interaction-mode)) - (if (eq major-mode 'scheme-debugger-mode) + (if (not (derived-mode-p 'scheme-interaction-mode)) + (if (derived-mode-p 'scheme-debugger-mode) (scheme-interaction-mode-initialize) (scheme-interaction-mode t))))) @@ -494,7 +489,7 @@ Commands: (defun scheme-debugger-mode-initialize () (use-local-map scheme-debugger-mode-map) - (setq major-mode 'scheme-debugger-mode) + (setq major-mode 'scheme-debugger-mode) ;FIXME: Use define-derived-mode. (setq mode-name "Scheme Debugger")) (defun scheme-debugger-mode-commands (keymap) @@ -518,9 +513,9 @@ Commands: (defun xscheme-enter-debugger-mode (prompt-string) (with-current-buffer (xscheme-process-buffer) - (if (not (eq major-mode 'scheme-debugger-mode)) + (if (not (derived-mode-p 'scheme-debugger-mode)) (progn - (if (not (eq major-mode 'scheme-interaction-mode)) + (if (not (derived-mode-p 'scheme-interaction-mode)) (scheme-interaction-mode t)) (scheme-debugger-mode-initialize))))) @@ -528,7 +523,7 @@ Commands: (let ((buffer (xscheme-process-buffer))) (and buffer (with-current-buffer buffer - (eq major-mode 'scheme-debugger-mode))))) + (derived-mode-p 'scheme-debugger-mode))))) ;;;; Evaluation Commands @@ -550,7 +545,7 @@ The strings are concatenated and terminated by a newline." (defun xscheme-send-string-1 (strings) (let ((string (apply 'concat strings))) (xscheme-send-string-2 string) - (if (eq major-mode 'scheme-interaction-mode) + (if (derived-mode-p 'scheme-interaction-mode) (xscheme-insert-expression string)))) (defun xscheme-send-string-2 (string) |