X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5df4f04cd32af723742c81095b38ae83b3c2b462..a3e44e793796153ff1534be9c74fcab50b45de30:/lisp/progmodes/f90.el diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index a4a986bd4a..111c12754e 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -657,6 +657,7 @@ Can be overridden by the value of `font-lock-maximum-decoration'.") (define-key map "\C-c\C-f" 'f90-fill-region) (define-key map "\C-c\C-p" 'f90-previous-statement) (define-key map "\C-c\C-n" 'f90-next-statement) + (define-key map "\C-c]" 'f90-insert-end) (define-key map "\C-c\C-w" 'f90-insert-end) ;; Standard tab binding will call this, and also handle regions. ;;; (define-key map "\t" 'f90-indent-line) @@ -1008,7 +1009,7 @@ Set subexpression 1 in the match-data to the name of the type." :regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*") ;;;###autoload -(defun f90-mode () +(define-derived-mode f90-mode prog-mode "F90" "Major mode for editing Fortran 90,95 code in free format. For fixed format code, use `fortran-mode'. @@ -1065,16 +1066,10 @@ Variables controlling indentation style and extra features: Turning on F90 mode calls the value of the variable `f90-mode-hook' with no args, if that value is non-nil." - (interactive) - (kill-all-local-variables) - (setq major-mode 'f90-mode - mode-name "F90" - local-abbrev-table f90-mode-abbrev-table) - (set-syntax-table f90-mode-syntax-table) - (use-local-map f90-mode-map) + :group 'f90 + :abbrev-table f90-mode-abbrev-table (set (make-local-variable 'indent-line-function) 'f90-indent-line) (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 'comment-start) "!") (set (make-local-variable 'comment-start-skip) "!+ *") (set (make-local-variable 'comment-indent-function) 'f90-comment-indent) @@ -1094,8 +1089,7 @@ with no args, if that value is non-nil." 'f90-beginning-of-subprogram) (set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram) (set (make-local-variable 'add-log-current-defun-function) - #'f90-current-defun) - (run-mode-hooks 'f90-mode-hook)) + #'f90-current-defun)) ;; Inline-functions. @@ -2211,7 +2205,7 @@ CHANGE-WORD should be one of 'upcase-word, 'downcase-word, 'capitalize-word." With optional argument ALL, change the default for all present and future F90 buffers. F90 mode normally treats backslash as an escape character." - (or (eq major-mode 'f90-mode) + (or (derived-mode-p 'f90-mode) (error "This function should only be used in F90 buffers")) (when (equal (char-syntax ?\\ ) ?\\ ) (or all (set-syntax-table (copy-syntax-table (syntax-table)))) @@ -2220,5 +2214,4 @@ escape character." (provide 'f90) -;; arch-tag: fceac97c-c147-44bd-aec0-172d4b560ef8 ;;; f90.el ends here