From: Juanma Barranquero Date: Mon, 21 Oct 2002 09:06:12 +0000 (+0000) Subject: (f90-insert-end): Fix typo. X-Git-Tag: emacs-pretest-21.2.92~27 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6523919b9cc5e9ec3e94c5021d801ddbc30515cf;p=emacs.git (f90-insert-end): Fix typo. --- diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index f13bfb93317..b79eed5a638 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -60,13 +60,13 @@ ;; f90-comment-region (C-c;) toggles insertion of f90-comment-region in region. ;; One common convention for free vs. fixed format is that free-format files -;; have the ending .f90 while the fixed format files have the ending .f. +;; have the ending .f90 while the fixed format files have the ending .f. ;; To make f90-mode work, put this file in, for example, your directory ;; ~/lisp, and be sure that you have the following in your .emacs-file ;; (setq load-path (append load-path '("~/lisp"))) ;; (autoload 'f90-mode "f90" ;; "Major mode for editing Fortran 90 code in free format." t) -;; (setq auto-mode-alist (append auto-mode-alist +;; (setq auto-mode-alist (append auto-mode-alist ;; (list '("\\.f90$" . f90-mode)))) ;; Once you have entered f90-mode, you may get more info by using ;; the command describe-mode (C-h m). For online help describing various @@ -386,7 +386,7 @@ whether to blink the matching beginning." '("\\<\\(namelist\\|common\\)[ \t]*\/\\(\\sw+\\)?\/" (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) "\\" "\\<\\(then\\|continue\\|format\\|include\\|stop\\|return\\)\\>" - '("\\<\\(exit\\|cycle\\)[ \t]*\\(\\sw+\\)?\\>" + '("\\<\\(exit\\|cycle\\)[ \t]*\\(\\sw+\\)?\\>" (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) '("\\<\\(case\\)[ \t]*\\(default\\|(\\)" . 1) '("\\<\\(do\\|go *to\\)\\>[ \t]*\\([0-9]+\\)" @@ -428,7 +428,7 @@ whether to blink the matching beginning." (modify-syntax-entry ?\" "\"" f90-mode-syntax-table) ; string quote (modify-syntax-entry ?\` "w" f90-mode-syntax-table) ; for abbrevs (modify-syntax-entry ?\r " " f90-mode-syntax-table) ; return is whitespace - (modify-syntax-entry ?+ "." f90-mode-syntax-table) + (modify-syntax-entry ?+ "." f90-mode-syntax-table) (modify-syntax-entry ?- "." f90-mode-syntax-table) (modify-syntax-entry ?= "." f90-mode-syntax-table) (modify-syntax-entry ?* "." f90-mode-syntax-table) @@ -464,7 +464,7 @@ whether to blink the matching beginning." (define-key f90-mode-map "*" 'f90-electric-insert) (define-key f90-mode-map "/" 'f90-electric-insert)) - + ;; menus (if (string-match "XEmacs" emacs-version) (defvar f90-xemacs-menu @@ -487,10 +487,10 @@ whether to blink the matching beginning." ["Upcase Keywords (region)" f90-upcase-region-keywords t] ["Capitalize Keywords (buffer)" f90-capitalize-keywords t] - ["Capitalize Keywords (region)" + ["Capitalize Keywords (region)" f90-capitalize-region-keywords t] ["Downcase Keywords (buffer)" f90-downcase-keywords t] - ["Downcase Keywords (region)" + ["Downcase Keywords (region)" f90-downcase-region-keywords t] "-----" ["Toggle abbrev-mode" abbrev-mode t] @@ -500,27 +500,27 @@ whether to blink the matching beginning." (defvar f90-change-case-menu (let ((map (make-sparse-keymap "Change Keyword Case"))) - + (define-key map [dkr] (cons "Downcase Keywords (region)" 'f90-downcase-region-keywords)) (put 'f90-downcase-region-keywords 'menu-enable 'mark-active) - + (define-key map [ckr] (cons "Capitalize Keywords (region)" 'f90-capitalize-region-keywords)) (put 'f90-capitalize-region-keywords 'menu-enable 'mark-active) - + (define-key map [ukr] (cons "Upcase Keywords (region)" 'f90-upcase-region-keywords)) (put 'f90-upcase-region-keywords 'menu-enable 'mark-active) - + (define-key map [line] (list "-----------------")) - + (define-key map [dkb] (cons "Downcase Keywords (buffer)" 'f90-downcase-keywords)) - + (define-key map [ckb] (cons "Capitalize Keywords (buffer)" 'f90-capitalize-keywords)) - + (define-key map [ukb] (cons "Upcase Keywords (buffer)" 'f90-upcase-keywords)) map) @@ -532,35 +532,35 @@ whether to blink the matching beginning." (defalias 'f90-font-lock-off 'font-lock-mode) (put 'f90-font-lock-on 'menu-enable 'font-lock-mode) (put 'f90-font-lock-off 'menu-enable '(not font-lock-mode)) - + (defun f90-font-lock-1 () (interactive) "Set font-lock-keywords to f90-font-lock-keywords-1." (font-lock-mode 1) (setq font-lock-keywords f90-font-lock-keywords-1) (font-lock-fontify-buffer)) - + (defun f90-font-lock-2 () (interactive) "Set font-lock-keywords to f90-font-lock-keywords-2." (font-lock-mode 1) (setq font-lock-keywords f90-font-lock-keywords-2) (font-lock-fontify-buffer)) - + (defun f90-font-lock-3 () (interactive) "Set font-lock-keywords to f90-font-lock-keywords-3." (font-lock-mode 1) (setq font-lock-keywords f90-font-lock-keywords-3) (font-lock-fontify-buffer)) - + (defun f90-font-lock-4 () (interactive) "Set font-lock-keywords to f90-font-lock-keywords-4." (font-lock-mode 1) (setq font-lock-keywords f90-font-lock-keywords-4) (font-lock-fontify-buffer)) - + (defvar f90-font-lock-menu (let ((map (make-sparse-keymap "f90-font-lock-menu"))) (define-key map [h4] (cons "Maximum highlighting (level 4)" @@ -581,8 +581,8 @@ whether to blink the matching beginning." (defalias 'f90-font-lock-menu f90-font-lock-menu) (define-key f90-mode-map [menu-bar] (make-sparse-keymap)) - (define-key f90-mode-map [menu-bar f90] - (cons "F90" (make-sparse-keymap "f90"))) + (define-key f90-mode-map [menu-bar f90] + (cons "F90" (make-sparse-keymap "f90"))) (define-key f90-mode-map [menu-bar f90 f90-imenu-menu] '("Add imenu Menu" . f90-add-imenu-menu)) @@ -605,24 +605,24 @@ whether to blink the matching beginning." '("Join with Next Line" . f90-join-lines)) (define-key f90-mode-map [menu-bar f90 f90-break-line] '("Break Line at Point" . f90-break-line)) - + (define-key f90-mode-map [menu-bar f90 line3] '("----")) - + (define-key f90-mode-map [menu-bar f90 f90-fill-region] '("Fill Region" . f90-fill-region)) (put 'f90-fill-region 'menu-enable 'mark-active) - + (define-key f90-mode-map [menu-bar f90 indent-region] '("Indent Region" . indent-region)) - + (define-key f90-mode-map [menu-bar f90 f90-comment-region] '("(Un)Comment Region" . f90-comment-region)) (put 'f90-comment-region 'menu-enable 'mark-active) - + (define-key f90-mode-map [menu-bar f90 line4] '("----")) - + (define-key f90-mode-map [menu-bar f90 f90-end-of-subprogram] '("End of Subprogram" . f90-end-of-subprogram)) (define-key f90-mode-map [menu-bar f90 f90-beginning-of-subprogram] @@ -634,16 +634,16 @@ whether to blink the matching beginning." ) ;; Regexps for finding program structures. -(defconst f90-blocks-re +(defconst f90-blocks-re "\\(block[ \t]*data\\|do\\|if\\|interface\\|function\\|module\\|\ program\\|select\\|subroutine\\|type\\|where\\|forall\\)\\>") -(defconst f90-program-block-re +(defconst f90-program-block-re "\\(program\\|module\\|subroutine\\|function\\)") -(defconst f90-else-like-re +(defconst f90-else-like-re "\\(else\\([ \t]*if\\|where\\)?\\|case[ \t]*\\(default\\|(\\)\\)") -(defconst f90-end-if-re +(defconst f90-end-if-re "end[ \t]*\\(if\\|select\\|where\\|forall\\)\\>") -(defconst f90-end-type-re +(defconst f90-end-type-re "end[ \t]*\\(type\\|interface\\|block[ \t]*data\\)") (defconst f90-type-def-re "\\<\\(type\\)\\>\\([^(\n]*::\\)?[ \t]*\\(\\sw+\\)") @@ -665,7 +665,7 @@ program\\|select\\|subroutine\\|type\\|where\\|forall\\)\\>") '("Modules" "^[ \t0-9]*module[ \t]+\\(\\sw+\\)[ \t]*\\(!\\|$\\)" 1) '("Types" "^[ \t0-9]*type[ \t]+\\(\\sw+\\)" 1) (list - "Procedures" + "Procedures" (concat "^[ \t0-9]*" "\\(" @@ -776,8 +776,8 @@ program\\|select\\|subroutine\\|type\\|where\\|forall\\)\\>") \\[f90-indent-new-line] corrects current indentation and creates new\ indented line. -\\[f90-indent-line] indents the current line correctly. -\\[f90-indent-subprogram] indents the current subprogram. +\\[f90-indent-line] indents the current line correctly. +\\[f90-indent-subprogram] indents the current subprogram. Type `? or `\\[help-command] to display a list of built-in\ abbrevs for F90 keywords. @@ -799,7 +799,7 @@ Variables controlling indentation style and extra features: f90-continuation-indent Extra indentation applied to continuation lines. (default 5) f90-comment-region - String inserted by \\[f90-comment-region] at start of each line in + String inserted by \\[f90-comment-region] at start of each line in region. (default \"!!!$\") f90-indented-comment-re Regexp determining the type of comment to be intended like code. @@ -813,9 +813,9 @@ Variables controlling indentation style and extra features: f90-break-before-delimiters Non-nil causes `f90-do-auto-fill' to break lines before delimiters. (default t) - f90-beginning-ampersand + f90-beginning-ampersand Automatic insertion of \& at beginning of continuation lines. (default t) - f90-smart-end + f90-smart-end From an END statement, check and fill the end using matching block start. Allowed values are 'blink, 'no-blink, and nil, which determine whether to blink the matching beginning.) (default 'blink) @@ -865,7 +865,7 @@ with no args, if that value is non-nil." (add-submenu nil f90-xemacs-menu))))) ;; XEmacs: (Don't need a special case, since both emacsen work alike -sb) (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults + (setq font-lock-defaults '((f90-font-lock-keywords f90-font-lock-keywords-1 f90-font-lock-keywords-2 f90-font-lock-keywords-3 @@ -892,7 +892,7 @@ with no args, if that value is non-nil." f90-cache-position (point-min)))) (nth 3 (parse-partial-sexp beg-pnt (point))))) - + (defsubst f90-in-comment () (let ((beg-pnt (if (and f90-cache-position (> (point) f90-cache-position)) @@ -1009,7 +1009,7 @@ Name is nil if the statement has no label." (defsubst f90-looking-at-type-like () "Return (kind name) at the start of a type/interface/block-data block. Name is non-nil only for type." - (cond + (cond ((looking-at f90-type-def-re) (list (f90-match-piece 1) (f90-match-piece 3))) ((looking-at "\\(interface\\|block[\t]*data\\)\\>") @@ -1029,7 +1029,7 @@ Name is non-nil only for type." (defsubst f90-looking-at-program-block-end () "Return list of type and name of end of block." - (if (looking-at (concat "end[ \t]*" f90-blocks-re + (if (looking-at (concat "end[ \t]*" f90-blocks-re "?\\([ \t]+\\(\\sw+\\)\\)?\\>")) (list (f90-match-piece 1) (f90-match-piece 3)))) @@ -1132,8 +1132,8 @@ Does not check type and subprogram indentation." (setq icol (- icol f90-do-indent)))) (end-of-line)) icol))) - - + + (defun f90-calculate-indent () "Calculate the indent column based on previous statements." (interactive) @@ -1156,7 +1156,7 @@ Does not check type and subprogram indentation." (cond ((or (f90-looking-at-if-then) (f90-looking-at-where-or-forall) (f90-looking-at-select-case) - (looking-at f90-else-like-re)) + (looking-at f90-else-like-re)) (setq icol (+ icol f90-if-indent))) ((f90-looking-at-do) (setq icol (+ icol f90-do-indent))) @@ -1214,12 +1214,12 @@ Return (type name) or nil if not found." (interactive) (let ((count 1) (case-fold-search t) matching-beg) (beginning-of-line) (skip-chars-forward " \t0-9") - (if (setq matching-beg (f90-looking-at-program-block-start)) + (if (setq matching-beg (f90-looking-at-program-block-start)) (setq count (- count 1))) (while (and (not (zerop count)) (re-search-backward f90-program-block-re nil 'move)) (beginning-of-line) (skip-chars-forward " \t0-9") - (cond + (cond ((setq matching-beg (f90-looking-at-program-block-start)) (setq count (- count 1))) ((f90-looking-at-program-block-end) @@ -1376,7 +1376,7 @@ If run in the middle of a line, the line is not broken." (< (point) end-region-mark)) (if (looking-at "[ \t]*!") (f90-indent-to (f90-comment-indent)) - (if (not (zerop (- (current-indentation) + (if (not (zerop (- (current-indentation) (+ ind-curr f90-continuation-indent)))) (f90-indent-to (+ ind-curr f90-continuation-indent) 'no-line-no)))) ;; process all following lines @@ -1408,7 +1408,7 @@ If run in the middle of a line, the line is not broken." ((setq end-struct (f90-looking-at-program-block-end)) (setq beg-struct (car block-list) block-list (cdr block-list)) - (if f90-smart-end + (if f90-smart-end (save-excursion (f90-block-match (car beg-struct)(car (cdr beg-struct)) (car end-struct)(car (cdr end-struct))))) @@ -1428,7 +1428,7 @@ If run in the middle of a line, the line is not broken." (< (point) end-region-mark)) (if (looking-at "[ \t]*!") (f90-indent-to (f90-comment-indent)) - (if (not (zerop (- (current-indentation) + (if (not (zerop (- (current-indentation) (+ ind-curr f90-continuation-indent)))) (f90-indent-to (+ ind-curr f90-continuation-indent) 'no-line-no))))) @@ -1474,7 +1474,7 @@ If run in the middle of a line, the line is not broken." (newline 1) (if f90-beginning-ampersand (insert "&"))))) (f90-indent-line)) - + (defun f90-find-breakpoint () "From fill-column, search backward for break-delimiter." (let ((bol (f90-get-beg-of-line))) @@ -1561,20 +1561,20 @@ Leave point at the end of line." (if end-block (progn (message "END %s does not match %s." end-block beg-block) - (end-of-line) + (end-of-line) (throw 'no-match nil)) (message "Inserting %s." beg-block) (insert (concat " " beg-block))) (search-forward end-block)) (if (not (f90-equal-symbols beg-name end-name)) - (cond ((and beg-name (not end-name)) + (cond ((and beg-name (not end-name)) (message "Inserting %s." beg-name) (insert (concat " " beg-name))) - ((and beg-name end-name) + ((and beg-name end-name) (message "Replacing %s with %s." end-name beg-name) (search-forward end-name) (replace-match beg-name)) - ((and (not beg-name) end-name) + ((and (not beg-name) end-name) (message "Deleting %s." end-name) (search-forward end-name) (replace-match ""))) @@ -1594,12 +1594,12 @@ Leave point at the end of line." (setq end-name (car (cdr end-struct))) (save-excursion (beginning-of-line) - (while + (while (and (not (zerop count)) (let ((stop nil) notexist) (while (not stop) (setq notexist - (not (re-search-backward + (not (re-search-backward (concat "\\(" f90-blocks-re "\\)") nil t))) (if notexist (setq stop t) @@ -1637,7 +1637,7 @@ Leave point at the end of line." (f90-block-match beg-block beg-name end-block end-name))))))) (defun f90-insert-end () - "Inserts an complete end statement matching beginning of present block." + "Inserts a complete end statement matching beginning of present block." (interactive) (let ((f90-smart-end (if f90-smart-end f90-smart-end 'blink))) (insert "end") @@ -1646,7 +1646,7 @@ Leave point at the end of line." ;; abbrevs and keywords (defun f90-abbrev-start () - "Typing `\\[help-command] or `? lists all the F90 abbrevs. + "Typing `\\[help-command] or `? lists all the F90 abbrevs. Any other key combination is executed normally." (interactive) (let (e c) @@ -1715,7 +1715,7 @@ Any other key combination is executed normally." (save-excursion (setq beg (if beg beg (point-min))) (setq end (if end end (point-max))) - (let ((keyword-re + (let ((keyword-re (concat "\\(" f90-keywords-re "\\|" f90-procedures-re "\\|" f90-hpf-keywords-re "\\|" f90-operators-re "\\)"))