summaryrefslogtreecommitdiff
path: root/lisp/progmodes/fortran.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-11-11 00:56:44 +0000
committerMiles Bader <miles@gnu.org>2007-11-11 00:56:44 +0000
commitf23d76bdefbd4c06e14d69e99e50d35ce91c8226 (patch)
treeded28d1da6df2d0135514bac83074f4ca1c9099a /lisp/progmodes/fortran.el
parente2d092da5980a7d05a5428074f8eb4925fa801e8 (diff)
parenta457417ee5ba797ab1c91d35ee957bb7a7f8d4b6 (diff)
downloademacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.tar.gz
emacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.tar.bz2
emacs-f23d76bdefbd4c06e14d69e99e50d35ce91c8226.zip
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
Diffstat (limited to 'lisp/progmodes/fortran.el')
-rw-r--r--lisp/progmodes/fortran.el18
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.