1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Use define-derived-mode in delphi-mode.

* lisp/progmodes/delphi.el (delphi-mode-syntax-table): Use defvar.
(delphi-mode): Use define-derived-mode to inherit from prog-mode.
Remove unused argument.
This commit is contained in:
Chong Yidong 2011-06-18 12:23:11 -04:00
parent 28dec25a9f
commit 6d10d800bd
2 changed files with 14 additions and 16 deletions

View file

@ -1,3 +1,9 @@
2011-06-18 Chong Yidong <cyd@stupidchicken.com>
* progmodes/delphi.el (delphi-mode-syntax-table): Use defvar.
(delphi-mode): Use define-derived-mode to inherit from prog-mode.
Remove unused argument.
2011-06-18 Martin Rudalics <rudalics@gmx.at> 2011-06-18 Martin Rudalics <rudalics@gmx.at>
* window.el (display-buffer-default-specifiers): Remove * window.el (display-buffer-default-specifiers): Remove

View file

@ -1959,12 +1959,12 @@ comment block. If not in a // comment, just does a normal newline."
kmap) kmap)
"Keymap used in Delphi mode.") "Keymap used in Delphi mode.")
(defconst delphi-mode-syntax-table (make-syntax-table) (defvar delphi-mode-syntax-table nil
"Delphi mode's syntax table. It is just a standard syntax table. "Delphi mode's syntax table. It is just a standard syntax table.
This is ok since we do our own keyword/comment/string face coloring.") This is ok since we do our own keyword/comment/string face coloring.")
;;;###autoload ;;;###autoload
(defun delphi-mode (&optional skip-initial-parsing) (define-derived-mode delphi-mode prog-mode "Delphi"
"Major mode for editing Delphi code. \\<delphi-mode-map> "Major mode for editing Delphi code. \\<delphi-mode-map>
\\[delphi-tab]\t- Indents the current line (or region, if Transient Mark mode \\[delphi-tab]\t- Indents the current line (or region, if Transient Mark mode
\t is enabled and the region is active) of Delphi code. \t is enabled and the region is active) of Delphi code.
@ -2007,14 +2007,6 @@ Coloring:
Turning on Delphi mode calls the value of the variable `delphi-mode-hook' Turning on Delphi mode calls the value of the variable `delphi-mode-hook'
with no args, if that value is non-nil." with no args, if that value is non-nil."
(interactive)
(kill-all-local-variables)
(use-local-map delphi-mode-map)
(setq major-mode 'delphi-mode) ;FIXME: Use define-derived-mode.
(setq mode-name "Delphi")
(setq local-abbrev-table delphi-mode-abbrev-table)
(set-syntax-table delphi-mode-syntax-table)
;; Buffer locals: ;; Buffer locals:
(mapc #'(lambda (var) (mapc #'(lambda (var)
@ -2033,12 +2025,12 @@ with no args, if that value is non-nil."
(add-hook 'after-change-functions 'delphi-after-change nil t) (add-hook 'after-change-functions 'delphi-after-change nil t)
(widen) (widen)
(unless skip-initial-parsing
(delphi-save-excursion (delphi-save-excursion
(let ((delphi-verbose t)) (let ((delphi-verbose t))
(delphi-progress-start) (delphi-progress-start)
(delphi-parse-region (point-min) (point-max)) (delphi-parse-region (point-min) (point-max))
(delphi-progress-done)))) (delphi-progress-done)))
(run-mode-hooks 'delphi-mode-hook)) (run-mode-hooks 'delphi-mode-hook))