Commit e75c1e7d authored by Glenn Morris's avatar Glenn Morris
Browse files

Derive Fortran modes from prog-mode.

* progmodes/fortran.el (fortran-mode):
* progmodes/f90.el (f90-mode): Derive from prog-mode.
parent 3e17a1a7
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
2010-05-21 Glenn Morris <rgm@gnu.org> 2010-05-21 Glenn Morris <rgm@gnu.org>
* progmodes/fortran.el (fortran-mode):
* progmodes/f90.el (f90-mode): Derive from prog-mode.
* loadup.el [CANNOT_DUMP]: Update for bootstrap-emacs no longer * loadup.el [CANNOT_DUMP]: Update for bootstrap-emacs no longer
having a relative path in src/Makefile.in. having a relative path in src/Makefile.in.
......
...@@ -1008,7 +1008,7 @@ Set subexpression 1 in the match-data to the name of the type." ...@@ -1008,7 +1008,7 @@ Set subexpression 1 in the match-data to the name of the type."
:regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*") :regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*")
;;;###autoload ;;;###autoload
(defun f90-mode () (define-derived-mode f90-mode prog-mode "F90"
"Major mode for editing Fortran 90,95 code in free format. "Major mode for editing Fortran 90,95 code in free format.
For fixed format code, use `fortran-mode'. For fixed format code, use `fortran-mode'.
...@@ -1065,13 +1065,9 @@ Variables controlling indentation style and extra features: ...@@ -1065,13 +1065,9 @@ Variables controlling indentation style and extra features:
Turning on F90 mode calls the value of the variable `f90-mode-hook' Turning on F90 mode calls the value of the variable `f90-mode-hook'
with no args, if that value is non-nil." with no args, if that value is non-nil."
(interactive) :group 'f90
(kill-all-local-variables) :syntax-table f90-mode-syntax-table
(setq major-mode 'f90-mode :abbrev-table f90-mode-abbrev-table
mode-name "F90"
local-abbrev-table f90-mode-abbrev-table)
(set-syntax-table f90-mode-syntax-table)
(use-local-map f90-mode-map)
(set (make-local-variable 'indent-line-function) 'f90-indent-line) (set (make-local-variable 'indent-line-function) 'f90-indent-line)
(set (make-local-variable 'indent-region-function) 'f90-indent-region) (set (make-local-variable 'indent-region-function) 'f90-indent-region)
(set (make-local-variable 'require-final-newline) mode-require-final-newline) (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,8 +1090,7 @@ with no args, if that value is non-nil."
'f90-beginning-of-subprogram) 'f90-beginning-of-subprogram)
(set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram) (set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram)
(set (make-local-variable 'add-log-current-defun-function) (set (make-local-variable 'add-log-current-defun-function)
#'f90-current-defun) #'f90-current-defun))
(run-mode-hooks 'f90-mode-hook))
;; Inline-functions. ;; Inline-functions.
......
...@@ -778,7 +778,7 @@ Used in the Fortran entry in `hs-special-modes-alist'.") ...@@ -778,7 +778,7 @@ Used in the Fortran entry in `hs-special-modes-alist'.")
;;;###autoload ;;;###autoload
(defun fortran-mode () (define-derived-mode fortran-mode prog-mode "Fortran"
"Major mode for editing Fortran code in fixed format. "Major mode for editing Fortran code in fixed format.
For free format code, use `f90-mode'. For free format code, use `f90-mode'.
...@@ -848,13 +848,9 @@ Variables controlling indentation style and extra features: ...@@ -848,13 +848,9 @@ Variables controlling indentation style and extra features:
Turning on Fortran mode calls the value of the variable `fortran-mode-hook' Turning on Fortran mode calls the value of the variable `fortran-mode-hook'
with no args, if that value is non-nil." with no args, if that value is non-nil."
(interactive) :group 'fortran
(kill-all-local-variables) :syntax-table fortran-mode-syntax-table
(setq major-mode 'fortran-mode :abbrev-table fortran-mode-abbrev-table
mode-name "Fortran"
local-abbrev-table fortran-mode-abbrev-table)
(set-syntax-table fortran-mode-syntax-table)
(use-local-map fortran-mode-map)
(set (make-local-variable 'indent-line-function) 'fortran-indent-line) (set (make-local-variable 'indent-line-function) 'fortran-indent-line)
(set (make-local-variable 'indent-region-function) (set (make-local-variable 'indent-region-function)
(lambda (start end) (lambda (start end)
...@@ -906,8 +902,7 @@ with no args, if that value is non-nil." ...@@ -906,8 +902,7 @@ with no args, if that value is non-nil."
#'fortran-current-defun) #'fortran-current-defun)
(set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search) (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search)
(set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr) (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr)
(add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t) (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t))
(run-mode-hooks 'fortran-mode-hook))
(defun fortran-line-length (nchars &optional global) (defun fortran-line-length (nchars &optional global)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment