(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)
:regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*")
\f
;;;###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'.
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)
'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))
\f
;; Inline-functions.
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))))
(provide 'f90)
-;; arch-tag: fceac97c-c147-44bd-aec0-172d4b560ef8
;;; f90.el ends here