diff options
| author | Chong Yidong | 2011-06-18 12:23:11 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-06-18 12:23:11 -0400 |
| commit | 6d10d800bd766822d7563b0cbb16b51ccd7f79ed (patch) | |
| tree | 581048db06f56ff52b0f1536ee34dea8ea1ca93b | |
| parent | 28dec25a9fa1823e27276b717257d3dcbff16f9f (diff) | |
| download | emacs-6d10d800bd766822d7563b0cbb16b51ccd7f79ed.tar.gz emacs-6d10d800bd766822d7563b0cbb16b51ccd7f79ed.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/delphi.el | 24 |
2 files changed, 14 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c707a4b97bd..755afbfeff6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-06-18 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * progmodes/delphi.el (delphi-mode-syntax-table): Use defvar. | ||
| 4 | (delphi-mode): Use define-derived-mode to inherit from prog-mode. | ||
| 5 | Remove unused argument. | ||
| 6 | |||
| 1 | 2011-06-18 Martin Rudalics <rudalics@gmx.at> | 7 | 2011-06-18 Martin Rudalics <rudalics@gmx.at> |
| 2 | 8 | ||
| 3 | * window.el (display-buffer-default-specifiers): Remove | 9 | * window.el (display-buffer-default-specifiers): Remove |
diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el index c809079381f..e8e2f8ffbf0 100644 --- a/lisp/progmodes/delphi.el +++ b/lisp/progmodes/delphi.el | |||
| @@ -1959,12 +1959,12 @@ comment block. If not in a // comment, just does a normal newline." | |||
| 1959 | kmap) | 1959 | kmap) |
| 1960 | "Keymap used in Delphi mode.") | 1960 | "Keymap used in Delphi mode.") |
| 1961 | 1961 | ||
| 1962 | (defconst delphi-mode-syntax-table (make-syntax-table) | 1962 | (defvar delphi-mode-syntax-table nil |
| 1963 | "Delphi mode's syntax table. It is just a standard syntax table. | 1963 | "Delphi mode's syntax table. It is just a standard syntax table. |
| 1964 | This is ok since we do our own keyword/comment/string face coloring.") | 1964 | This is ok since we do our own keyword/comment/string face coloring.") |
| 1965 | 1965 | ||
| 1966 | ;;;###autoload | 1966 | ;;;###autoload |
| 1967 | (defun delphi-mode (&optional skip-initial-parsing) | 1967 | (define-derived-mode delphi-mode prog-mode "Delphi" |
| 1968 | "Major mode for editing Delphi code. \\<delphi-mode-map> | 1968 | "Major mode for editing Delphi code. \\<delphi-mode-map> |
| 1969 | \\[delphi-tab]\t- Indents the current line (or region, if Transient Mark mode | 1969 | \\[delphi-tab]\t- Indents the current line (or region, if Transient Mark mode |
| 1970 | \t is enabled and the region is active) of Delphi code. | 1970 | \t is enabled and the region is active) of Delphi code. |
| @@ -2007,14 +2007,6 @@ Coloring: | |||
| 2007 | 2007 | ||
| 2008 | Turning on Delphi mode calls the value of the variable `delphi-mode-hook' | 2008 | Turning on Delphi mode calls the value of the variable `delphi-mode-hook' |
| 2009 | with no args, if that value is non-nil." | 2009 | with no args, if that value is non-nil." |
| 2010 | (interactive) | ||
| 2011 | (kill-all-local-variables) | ||
| 2012 | (use-local-map delphi-mode-map) | ||
| 2013 | (setq major-mode 'delphi-mode) ;FIXME: Use define-derived-mode. | ||
| 2014 | (setq mode-name "Delphi") | ||
| 2015 | |||
| 2016 | (setq local-abbrev-table delphi-mode-abbrev-table) | ||
| 2017 | (set-syntax-table delphi-mode-syntax-table) | ||
| 2018 | 2010 | ||
| 2019 | ;; Buffer locals: | 2011 | ;; Buffer locals: |
| 2020 | (mapc #'(lambda (var) | 2012 | (mapc #'(lambda (var) |
| @@ -2033,12 +2025,12 @@ with no args, if that value is non-nil." | |||
| 2033 | (add-hook 'after-change-functions 'delphi-after-change nil t) | 2025 | (add-hook 'after-change-functions 'delphi-after-change nil t) |
| 2034 | 2026 | ||
| 2035 | (widen) | 2027 | (widen) |
| 2036 | (unless skip-initial-parsing | 2028 | |
| 2037 | (delphi-save-excursion | 2029 | (delphi-save-excursion |
| 2038 | (let ((delphi-verbose t)) | 2030 | (let ((delphi-verbose t)) |
| 2039 | (delphi-progress-start) | 2031 | (delphi-progress-start) |
| 2040 | (delphi-parse-region (point-min) (point-max)) | 2032 | (delphi-parse-region (point-min) (point-max)) |
| 2041 | (delphi-progress-done)))) | 2033 | (delphi-progress-done))) |
| 2042 | 2034 | ||
| 2043 | (run-mode-hooks 'delphi-mode-hook)) | 2035 | (run-mode-hooks 'delphi-mode-hook)) |
| 2044 | 2036 | ||