diff options
| author | Glenn Morris | 2010-05-20 18:13:57 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-05-20 18:13:57 -0700 |
| commit | e75c1e7dc4f08f6ebc8984d2b08edce6906ccf50 (patch) | |
| tree | 5753f5810ce5e6e3948cf2bd47a787605e555add | |
| parent | 3e17a1a7d7575204bc55e10e9c6cf4a3944f8a24 (diff) | |
| download | emacs-e75c1e7dc4f08f6ebc8984d2b08edce6906ccf50.tar.gz emacs-e75c1e7dc4f08f6ebc8984d2b08edce6906ccf50.zip | |
Derive Fortran modes from prog-mode.
* progmodes/fortran.el (fortran-mode):
* progmodes/f90.el (f90-mode): Derive from prog-mode.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/progmodes/f90.el | 15 | ||||
| -rw-r--r-- | lisp/progmodes/fortran.el | 15 |
3 files changed, 13 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 15d3d691558..a39380087c5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -7,6 +7,9 @@ | |||
| 7 | 7 | ||
| 8 | 2010-05-21 Glenn Morris <rgm@gnu.org> | 8 | 2010-05-21 Glenn Morris <rgm@gnu.org> |
| 9 | 9 | ||
| 10 | * progmodes/fortran.el (fortran-mode): | ||
| 11 | * progmodes/f90.el (f90-mode): Derive from prog-mode. | ||
| 12 | |||
| 10 | * loadup.el [CANNOT_DUMP]: Update for bootstrap-emacs no longer | 13 | * loadup.el [CANNOT_DUMP]: Update for bootstrap-emacs no longer |
| 11 | having a relative path in src/Makefile.in. | 14 | having a relative path in src/Makefile.in. |
| 12 | 15 | ||
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 0a3c96d7894..64c716208e9 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el | |||
| @@ -1008,7 +1008,7 @@ Set subexpression 1 in the match-data to the name of the type." | |||
| 1008 | :regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*") | 1008 | :regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*") |
| 1009 | 1009 | ||
| 1010 | ;;;###autoload | 1010 | ;;;###autoload |
| 1011 | (defun f90-mode () | 1011 | (define-derived-mode f90-mode prog-mode "F90" |
| 1012 | "Major mode for editing Fortran 90,95 code in free format. | 1012 | "Major mode for editing Fortran 90,95 code in free format. |
| 1013 | For fixed format code, use `fortran-mode'. | 1013 | For fixed format code, use `fortran-mode'. |
| 1014 | 1014 | ||
| @@ -1065,13 +1065,9 @@ Variables controlling indentation style and extra features: | |||
| 1065 | 1065 | ||
| 1066 | Turning on F90 mode calls the value of the variable `f90-mode-hook' | 1066 | Turning on F90 mode calls the value of the variable `f90-mode-hook' |
| 1067 | with no args, if that value is non-nil." | 1067 | with no args, if that value is non-nil." |
| 1068 | (interactive) | 1068 | :group 'f90 |
| 1069 | (kill-all-local-variables) | 1069 | :syntax-table f90-mode-syntax-table |
| 1070 | (setq major-mode 'f90-mode | 1070 | :abbrev-table f90-mode-abbrev-table |
| 1071 | mode-name "F90" | ||
| 1072 | local-abbrev-table f90-mode-abbrev-table) | ||
| 1073 | (set-syntax-table f90-mode-syntax-table) | ||
| 1074 | (use-local-map f90-mode-map) | ||
| 1075 | (set (make-local-variable 'indent-line-function) 'f90-indent-line) | 1071 | (set (make-local-variable 'indent-line-function) 'f90-indent-line) |
| 1076 | (set (make-local-variable 'indent-region-function) 'f90-indent-region) | 1072 | (set (make-local-variable 'indent-region-function) 'f90-indent-region) |
| 1077 | (set (make-local-variable 'require-final-newline) mode-require-final-newline) | 1073 | (set (make-local-variable 'require-final-newline) mode-require-final-newline) |
| @@ -1094,8 +1090,7 @@ with no args, if that value is non-nil." | |||
| 1094 | 'f90-beginning-of-subprogram) | 1090 | 'f90-beginning-of-subprogram) |
| 1095 | (set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram) | 1091 | (set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram) |
| 1096 | (set (make-local-variable 'add-log-current-defun-function) | 1092 | (set (make-local-variable 'add-log-current-defun-function) |
| 1097 | #'f90-current-defun) | 1093 | #'f90-current-defun)) |
| 1098 | (run-mode-hooks 'f90-mode-hook)) | ||
| 1099 | 1094 | ||
| 1100 | 1095 | ||
| 1101 | ;; Inline-functions. | 1096 | ;; Inline-functions. |
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 3784ba787c4..c37744bfe45 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el | |||
| @@ -778,7 +778,7 @@ Used in the Fortran entry in `hs-special-modes-alist'.") | |||
| 778 | 778 | ||
| 779 | 779 | ||
| 780 | ;;;###autoload | 780 | ;;;###autoload |
| 781 | (defun fortran-mode () | 781 | (define-derived-mode fortran-mode prog-mode "Fortran" |
| 782 | "Major mode for editing Fortran code in fixed format. | 782 | "Major mode for editing Fortran code in fixed format. |
| 783 | For free format code, use `f90-mode'. | 783 | For free format code, use `f90-mode'. |
| 784 | 784 | ||
| @@ -848,13 +848,9 @@ Variables controlling indentation style and extra features: | |||
| 848 | 848 | ||
| 849 | Turning on Fortran mode calls the value of the variable `fortran-mode-hook' | 849 | Turning on Fortran mode calls the value of the variable `fortran-mode-hook' |
| 850 | with no args, if that value is non-nil." | 850 | with no args, if that value is non-nil." |
| 851 | (interactive) | 851 | :group 'fortran |
| 852 | (kill-all-local-variables) | 852 | :syntax-table fortran-mode-syntax-table |
| 853 | (setq major-mode 'fortran-mode | 853 | :abbrev-table fortran-mode-abbrev-table |
| 854 | mode-name "Fortran" | ||
| 855 | local-abbrev-table fortran-mode-abbrev-table) | ||
| 856 | (set-syntax-table fortran-mode-syntax-table) | ||
| 857 | (use-local-map fortran-mode-map) | ||
| 858 | (set (make-local-variable 'indent-line-function) 'fortran-indent-line) | 854 | (set (make-local-variable 'indent-line-function) 'fortran-indent-line) |
| 859 | (set (make-local-variable 'indent-region-function) | 855 | (set (make-local-variable 'indent-region-function) |
| 860 | (lambda (start end) | 856 | (lambda (start end) |
| @@ -906,8 +902,7 @@ with no args, if that value is non-nil." | |||
| 906 | #'fortran-current-defun) | 902 | #'fortran-current-defun) |
| 907 | (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search) | 903 | (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search) |
| 908 | (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr) | 904 | (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr) |
| 909 | (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t) | 905 | (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t)) |
| 910 | (run-mode-hooks 'fortran-mode-hook)) | ||
| 911 | 906 | ||
| 912 | 907 | ||
| 913 | (defun fortran-line-length (nchars &optional global) | 908 | (defun fortran-line-length (nchars &optional global) |