X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/7de8137710f3abf96b19c15bb7ba3a05a950b505..89ce83b20249dfb4e45f09dfdddf4c4b66d82968:/lisp/progmodes/f90.el diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 2bd7e7cc88..58397530e4 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -1,6 +1,6 @@ ;;; f90.el --- Fortran-90 mode (free format) -*- lexical-binding: t -*- -;; Copyright (C) 1995-1997, 2000-2015 Free Software Foundation, Inc. +;; Copyright (C) 1995-1997, 2000-2016 Free Software Foundation, Inc. ;; Author: Torbjörn Einarsson ;; Maintainer: Glenn Morris @@ -240,7 +240,7 @@ :group 'f90-indent) (defcustom f90-beginning-ampersand t - "Non-nil gives automatic insertion of \& at start of continuation line." + "Non-nil gives automatic insertion of `&' at start of continuation line." :type 'boolean :safe 'booleanp :group 'f90) @@ -295,7 +295,7 @@ the constant `f90-no-break-re' ensures that such tokens are not split." (defcustom f90-auto-keyword-case nil "Automatic case conversion of keywords. -The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil." +The options are `downcase-word', `upcase-word', `capitalize-word' and nil." :type '(choice (const downcase-word) (const upcase-word) (const capitalize-word) (const nil)) :safe (lambda (value) (memq value '(downcase-word @@ -649,7 +649,7 @@ forall\\|block\\|critical\\)\\)\\_>" \\|enumerator\\|procedure\\|\ logical\\|double[ \t]*precision\\|type[ \t]*(\\(?:\\sw\\|\\s_\\)+)\\|none\\)[ \t]*" (1 font-lock-keyword-face) (2 font-lock-type-face)) - '("\\_<\\(namelist\\|common\\)[ \t]*\/\\(\\(?:\\sw\\|\\s_\\)+\\)?\/" + '("\\_<\\(namelist\\|common\\)[ \t]*/\\(\\(?:\\sw\\|\\s_\\)+\\)?\/" (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) "\\_" '("\\(&\\)[ \t]*\\(!\\|$\\)" (1 font-lock-keyword-face)) @@ -898,12 +898,12 @@ Can be overridden by the value of `font-lock-maximum-decoration'.") (defconst f90-type-def-re ;; type word ;; type :: word - ;; type, stuff :: word - ;; type, bind(c) :: word - ;; type, extends(stuff) :: word + ;; type, attr-list :: word + ;; where attr-list = attr [, attr ...] + ;; and attr may include bind(c) or extends(thing) ;; NOT "type (" "\\_<\\(type\\)\\_>\\(?:\\(?:[^()\n]*\\|\ -.*,[ \t]*\\(?:bind\\|extends\\)[ \t]*(.*)[ \t]*\\)::\\)?\ +.*,[ \t]*\\(?:bind\\|extends\\)[ \t]*(.*).*\\)::\\)?\ [ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)" "Regexp matching the definition of a derived type.") @@ -954,8 +954,8 @@ Used in the F90 entry in `hs-special-modes-alist'.") ;; and also variables of derived type "type (foo)". ;; "type, foo" must be a block (?). "type[ \t,]\\(" - "[^i(!\n\"\& \t]\\|" ; not-i( - "i[^s!\n\"\& \t]\\|" ; i not-s + "[^i(!\n\"& \t]\\|" ; not-i( + "i[^s!\n\"& \t]\\|" ; i not-s "is\\(?:\\sw\\|\\s_\\)\\)\\|" ;; "abstract interface" is F2003; "submodule" is F2008. "program\\|\\(?:abstract[ \t]*\\)?interface\\|\\(?:sub\\)?module\\|" @@ -992,9 +992,9 @@ Set subexpression 1 in the match-data to the name of the type." found)) (defvar f90-imenu-generic-expression - (let ((good-char "[^!\"\&\n \t]") (not-e "[^e!\n\"\& \t]") - (not-n "[^n!\n\"\& \t]") (not-d "[^d!\n\"\& \t]") - ;; (not-ib "[^i(!\n\"\& \t]") (not-s "[^s!\n\"\& \t]") + (let ((good-char "[^!\"&\n \t]") (not-e "[^e!\n\"& \t]") + (not-n "[^n!\n\"& \t]") (not-d "[^d!\n\"& \t]") + ;; (not-ib "[^i(!\n\"& \t]") (not-s "[^s!\n\"& \t]") ) `((nil "^[ \t0-9]*program[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)" 1) ("Submodules" "^[ \t0-9]*submodule[ \t]*([^)\n]+)[ \t]*\ @@ -1015,7 +1015,7 @@ Set subexpression 1 in the match-data to the name of the type." "\\(" ;; At least three non-space characters before function/subroutine. ;; Check that the last three non-space characters do not spell E N D. - "[^!\"\&\n]*\\(" + "[^!\"&\n]*\\(" not-e good-char good-char "\\|" good-char not-n good-char "\\|" good-char good-char not-d "\\)" @@ -1154,7 +1154,7 @@ Variables controlling indentation style and extra features: Non-nil causes `f90-do-auto-fill' to break lines before delimiters (default t). `f90-beginning-ampersand' - Automatic insertion of \& at beginning of continuation lines (default t). + Automatic insertion of `&' at beginning of continuation lines (default t). `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 @@ -1378,7 +1378,7 @@ write\\)[ \t]*([^)\n]*)") ((looking-at "\\(submodule\\)[ \t]*([^)\n]+)[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>") (list (match-string 1) (match-string 2))) ((and (not (looking-at "end[ \t]*\\(function\\|subroutine\\)")) - (looking-at "[^!'\"\&\n]*\\(function\\|subroutine\\)[ \t]+\ + (looking-at "[^!'\"&\n]*\\(function\\|subroutine\\)[ \t]+\ \\(\\(?:\\sw\\|\\s_\\)+\\)")) (list (match-string 1) (match-string 2))))) ;; Following will match an un-named main program block; however @@ -1425,7 +1425,7 @@ single - statement is not continued. begin - current line is the first in a continued statement. end - current line is the last in a continued statement middle - current line is neither first nor last in a continued statement. -Comment lines embedded amongst continued lines return 'middle." +Comment lines embedded amongst continued lines return `middle'." (let (pcont cont) (save-excursion (setq pcont (if (f90-previous-statement) (f90-line-continued)))) @@ -1452,7 +1452,7 @@ if all else fails." (not (or (looking-at "end") (looking-at "\\(do\\|if\\|else\\(if\\|where\\)?\ \\|select[ \t]*\\(case\\|type\\)\\|case\\|where\\|forall\\|\ -block\\|critical\\|enum\\)\\_>") +block\\|critical\\|enum\\|associate\\)\\_>") (looking-at "\\(program\\|\\(?:sub\\)?module\\|\ \\(?:abstract[ \t]*\\)?interface\\|block[ \t]*data\\)\\_>") (looking-at "\\(contains\\|\\(?:\\sw\\|\\s_\\)+[ \t]*:\\)") @@ -2110,7 +2110,7 @@ Like `join-line', but handles F90 syntax." (if arg (forward-line 1)) (when (eq (preceding-char) ?\n) (skip-chars-forward " \t") - (if (looking-at "\&") (delete-char 1)) + (if (looking-at "&") (delete-char 1)) (beginning-of-line) (delete-region (point) (1- (point))) (skip-chars-backward " \t") @@ -2330,7 +2330,7 @@ Any other key combination is executed normally." ;; Change the keywords according to argument. (defun f90-change-keywords (change-word &optional beg end) "Change the case of F90 keywords in the region (if specified) or buffer. -CHANGE-WORD should be one of 'upcase-word, 'downcase-word, 'capitalize-word." +CHANGE-WORD should be one of `upcase-word', `downcase-word', `capitalize-word'." (save-excursion (setq beg (or beg (point-min)) end (or end (point-max))) @@ -2355,7 +2355,8 @@ CHANGE-WORD should be one of 'upcase-word, 'downcase-word, 'capitalize-word." (setq ref-point (point) ;; FIXME this does not work for constructs with ;; embedded space, eg "sync all". - back-point (save-excursion (backward-word 1) (point)) + back-point (save-excursion (backward-word-strictly 1) + (point)) saveword (buffer-substring back-point ref-point)) (funcall change-word -1) (or (string= saveword (buffer-substring back-point ref-point)) @@ -2382,8 +2383,4 @@ escape character." (provide 'f90) -;; Local Variables: -;; coding: utf-8 -;; End: - ;;; f90.el ends here