diff options
Diffstat (limited to 'lisp/progmodes/fortran.el')
-rw-r--r-- | lisp/progmodes/fortran.el | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 9ce55c27780..43cb61cba6b 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -59,7 +59,8 @@ (defvar gud-find-expr-function) (defvar imenu-case-fold-search) (defvar imenu-syntax-alist) - +(defvar comment-region-function) +(defvar uncomment-region-function) (defgroup fortran nil "Major mode for editing fixed format Fortran code." @@ -100,7 +101,7 @@ with a character in column 6." "String to appear in mode line in TAB format buffers." :type 'string :group 'fortran-indent) -(put 'fortran-tab-mode-string 'safe-local-variable 'stringp) +(put 'fortran-tab-mode-string 'risky-local-variable t) (defcustom fortran-do-indent 3 "Extra indentation applied to DO blocks." @@ -593,7 +594,8 @@ Used in the Fortran entry in `hs-special-modes-alist'.") (let ((map (make-sparse-keymap))) (define-key map ";" 'fortran-abbrev-start) (define-key map "\C-c;" 'fortran-comment-region) - (define-key map "\M-;" 'fortran-indent-comment) + ;; The default comment-dwim does at least as much as this. +;;; (define-key map "\M-;" 'fortran-indent-comment) (define-key map "\M-\n" 'fortran-split-line) (define-key map "\M-\C-n" 'fortran-end-of-block) (define-key map "\M-\C-p" 'fortran-beginning-of-block) @@ -841,6 +843,11 @@ with no args, if that value is non-nil." ;; (concat "\\(\\)\\(![ \t]*\\|" fortran-comment-line-start-skip "\\)") "\\(\\)\\(?:^[CcDd*]\\|!\\)\\(?:\\([^ \t\n]\\)\\2+\\)?[ \t]*") (set (make-local-variable 'comment-indent-function) 'fortran-comment-indent) + (set (make-local-variable 'comment-region-function) 'fortran-comment-region) + (set (make-local-variable 'uncomment-region-function) + 'fortran-uncomment-region) + (set (make-local-variable 'comment-insert-comment-function) + 'fortran-indent-comment) (set (make-local-variable 'abbrev-all-caps) t) (set (make-local-variable 'normal-auto-fill-function) 'fortran-auto-fill) (set (make-local-variable 'indent-tabs-mode) (fortran-analyze-file-format)) @@ -981,6 +988,11 @@ With non-nil ARG, uncomments the region." (set-marker end-region-mark nil) (set-marker save-point nil))) +;; uncomment-region calls this with 3 args. +(defun fortran-uncomment-region (start end &optional ignored) + "Uncomment every line in the region." + (fortran-comment-region start end t)) + (defun fortran-abbrev-start () "Typing ;\\[help-command] or ;? lists all the Fortran abbrevs. |