• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/progmodes/

Lines Matching +defs:beginning +defs:of +defs:defun +defs:function

10 ;; This file is part of GNU Emacs.
13 ;; it under the terms of the GNU General Public License as published by
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; You should have received a copy of the GNU General Public License
35 ;; interpretations, e.g. of blackslash in strings).
51 ;; * Implement insertion and removal of statement continuations in
59 (defvar gud-find-expr-function)
84 A non-nil value specifies tab-digit style of continuation control.
85 A value of nil specifies that continuation lines are marked
127 "*Amount of extra indentation for text within full-line comments."
143 "*Regexp to match the start of a full-line comment."
168 ;; of length one rather than a single character.
197 Also, if \\[fortran-indent-line] finds this at the beginning of a
198 line, it will convert the line into a continuation line of the
204 "*String inserted by \\[fortran-comment-region] at start of each \
237 "Number of lines to scan to identify fixed or TAB format style."
249 There are certain tokens comprised entirely of characters
257 This regexp matches certain tokens comprised entirely of
270 "Regexp matching the start of an IF statement.")
274 \\([ \t]*\\(program\\|subroutine\\|function\\|block[ \t]*data\\)\\>\
276 "Regexp possibly matching the end of a subprogram.")
280 "Regexp possibly matching the end of a subprogram, from the line start.
309 ;; Program, subroutine and function declarations, plus calls.
310 '(("\\<\\(block[ \t]*data\\|call\\|entry\\|function\\|\
313 (2 font-lock-function-name-face nil t)))
355 (and (match-beginning ,(1+ (regexp-opt-depth
399 Consists of level 3 plus all other intrinsics not already highlighted.")
421 ;; [This will be fooled by `end function' allowed by G77. Also,
426 ;; function declaration with optional type, e.g. `real',
429 "\\<function\\|subroutine\\|entry\\|block\\s-*data\\|program\\)"
444 (regexp-opt '("do" "if" "interface" "function" "map" "program"
446 "Regexp potentially indicating the start or end of a Fortran \"block\".
457 "Regexp matching the end of a Fortran \"block\", from the line start.
458 Note that only ENDDO is handled for the end of a DO-loop. Used
471 ;; That leads to the problem of not matching two consecutive IF
477 ;; fortran-beginning-if for the hoops we have to go through.
486 (regexp-opt '("interface" "function" "map" "program"
489 "Regexp matching the start of a Fortran \"block\", from the line start.
496 "^[cC*!]" fortran-end-of-block nil))
538 (define-key map "\M-\C-n" 'fortran-end-of-block)
539 (define-key map "\M-\C-p" 'fortran-beginning-of-block)
572 (fortran-comment-region (region-beginning) (region-end) 1)
577 ["Beginning of Subprogram" fortran-beginning-of-subprogram t]
578 ["End of Subprogram" fortran-end-of-subprogram t]
580 ["Subprogram" mark-defun t]
584 ["Narrow to Subprogram" narrow-to-defun t]
598 ["Toggle auto-fill" auto-fill-mode :selected auto-fill-function
617 ;; Use the 6th arg (SYSTEM-FLAG) of define-abbrev if possible.
620 (function (lambda (element)
624 (wrong-number-of-arguments
651 (";fu" "function" )
689 (defun fortran-mode ()
696 Type ;? or ;\\[help-command] to display a list of built-in abbrevs for\
716 Amount of extra indentation for text in full-line comments (default 0).
721 value of either
726 indentation for a line of code.
729 Single-character string to be inserted instead of space for
746 Single-character string to be inserted in column 5 of a continuation
749 String inserted by \\[fortran-comment-region] at start of each line in
757 Turning on Fortran mode calls the value of the variable `fortran-mode-hook'
766 (set (make-local-variable 'indent-line-function) 'fortran-indent-line)
767 (set (make-local-variable 'indent-region-function)
770 indent-region-function)
780 ;; beginning of the comment delimiter.
783 (set (make-local-variable 'comment-indent-function) 'fortran-comment-indent)
785 (set (make-local-variable 'normal-auto-fill-function) 'fortran-auto-fill)
789 (set (make-local-variable 'fill-paragraph-function) 'fortran-fill-paragraph)
797 fortran-beginning-of-subprogram))
804 (set (make-local-variable 'beginning-of-defun-function)
805 #'fortran-beginning-of-subprogram)
806 (set (make-local-variable 'end-of-defun-function)
807 #'fortran-end-of-subprogram)
808 (set (make-local-variable 'add-log-current-defun-function)
809 #'fortran-current-defun)
811 (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr)
816 (defun fortran-gud-find-expr ()
817 ;; Consider \n as punctuation (end of expression).
824 the value of `comment-column' (leaving at least one space after code)."
830 (defun fortran-indent-comment ()
832 Existing comments of all types are recognized and aligned.
834 if the value of `comment-start' is not nil and allows such comments.
838 (beginning-of-line)
839 ;; Recognize existing comments of either kind.
841 (goto-char (match-beginning 0))
852 (end-of-line)
860 (beginning-of-line)
869 (defun fortran-comment-region (beg-region end-region arg)
871 Inserts the string variable `fortran-comment-region' at the beginning of
879 (beginning-of-line)
898 (defun fortran-abbrev-start ()
914 (defun fortran-abbrev-help ()
921 (defun fortran-prepare-abbrev-list-buffer ()
931 (defun fortran-column-ruler ()
933 The ruler is defined by the value of `fortran-column-ruler-fixed' in fixed
942 (beginning-of-line)
945 (line-beginning-position 2)
949 (defun fortran-window-create ()
966 (defun fortran-window-create-momentarily (&optional arg)
984 (defun fortran-split-line ()
990 (beginning-of-line)
992 (< (match-beginning 0) pos))))
999 (defun fortran-remove-continuation ()
1007 (defun fortran-join-line (arg)
1018 (beginning-of-line)
1024 (defun fortran-numerical-continuation-char ()
1025 "Return a digit for tab-digit style of continuation lines.
1035 (defun fortran-electric-line-number (arg)
1036 "Self insert, but if part of a Fortran line number indent it automatically.
1045 (beginning-of-line)
1052 (eq ?\t (char-after (line-beginning-position)))
1058 (line-beginning-position)
1068 (defun fortran-check-end-prog-re ()
1071 ;; match of whitespace, avoiding possible column 73+ stuff.
1076 (+ 72 (line-beginning-position)))))))
1079 ;; case of un-marked main programs not at the start of the file.
1080 (defun fortran-beginning-of-subprogram ()
1081 "Move point to the beginning of the current Fortran subprogram."
1085 (beginning-of-line -1)
1092 (defun fortran-end-of-subprogram ()
1093 "Move point to the end of the current Fortran subprogram."
1098 (beginning-of-line)
1102 (beginning-of-line 2)
1107 (goto-char (match-beginning 0))
1110 (defun fortran-previous-statement ()
1111 "Move point to beginning of the previous Fortran statement.
1117 (beginning-of-line)
1142 (defun fortran-next-statement ()
1143 "Move point to beginning of the next Fortran statement.
1149 (beginning-of-line)
1160 (defun fortran-looking-at-if-then ()
1161 "Return non-nil if at the start of a line with an IF ... THEN statement."
1164 (i (fortran-beginning-if)))
1168 (beginning-of-line)
1172 (defun fortran-end-of-block (&optional num)
1173 "Move point forward to the end of the current code block.
1175 If NUM is negative, go backward to the start of a block. Does
1176 not check for consistency of block types. Interactively, pushes
1180 (and num (< num 0) (fortran-beginning-of-block (- num)))
1183 (end-of-line)
1191 (beginning-of-line)
1202 (end-of-line))
1205 (defun fortran-beginning-of-block (&optional num)
1206 "Move point backwards to the start of the current code block.
1208 blocks. If NUM is negative, go forward to the end of a block.
1209 Does not check for consistency of block types. Interactively,
1213 (and num (< num 0) (fortran-end-of-block (- num)))
1216 (beginning-of-line)
1224 (beginning-of-line)
1240 (defun fortran-blink-match (regex keyword find-begin)
1242 Use function FIND-BEGIN to match it."
1243 (let ((top-of-window (window-start))
1249 (beginning-of-line)
1254 (if (< matching top-of-window)
1257 (beginning-of-line)
1268 (defun fortran-blink-matching-if ()
1271 "if" #'fortran-beginning-if))
1273 (defun fortran-blink-matching-do ()
1275 (fortran-blink-match "end[ \t]*do\\b" "do" #'fortran-beginning-do))
1277 (defun fortran-mark-do ()
1278 "Put mark at end of Fortran DO [WHILE]-ENDDO construct, point at beginning.
1283 (if (not (setq do-point (fortran-beginning-do)))
1289 (defun fortran-end-do ()
1293 (if (save-excursion (beginning-of-line)
1297 (match-beginning 0)
1316 (defun fortran-beginning-do ()
1322 (beginning-of-line)
1326 (match-beginning 0)
1345 (defun fortran-mark-if ()
1346 "Put mark at end of Fortran IF-ENDIF construct, point at beginning.
1351 (if (not (setq if-point (fortran-beginning-if)))
1358 (defun fortran-end-if ()
1362 (if (save-excursion (beginning-of-line)
1366 (match-beginning 0)
1399 (defun fortran-beginning-if ()
1405 ;; move to beginning of current statement. Note:
1428 (match-beginning 0)
1463 (defun fortran-indent-line ()
1468 (beginning-of-line)
1473 (beginning-of-line)
1479 (and auto-fill-function
1480 (> (save-excursion (end-of-line) (current-column))
1483 (end-of-line)
1489 (defun fortran-auto-fill ()
1490 "Function to use for `normal-auto-fill-function' in Fortran mode."
1494 (beginning-of-line)
1500 (beginning-of-line)
1508 ;; Historically this was a separate function which advertised itself
1512 (defun fortran-indent-subprogram ()
1516 (mark-defun)
1521 (defun fortran-calculate-indent ()
1571 (beginning-of-line)
1625 (defun fortran-current-line-indentation ()
1626 "Indentation of current line, ignoring Fortran line number or continuation.
1627 This is the column position of the first non-whitespace character
1629 For comment lines, returns indentation of the first
1632 (beginning-of-line)
1648 (defun fortran-indent-to-column (col)
1658 (beginning-of-line)
1703 ;; Put body of statement where specified.
1708 (goto-char (match-beginning 0))
1713 (defun fortran-line-number-indented-correctly-p ()
1717 (beginning-of-line)
1724 (defun fortran-check-for-matching-do ()
1730 (beginning-of-line)
1738 (beginning-of-line)
1741 (narrow-to-defun)
1752 (defun fortran-find-comment-start-skip (&optional all)
1765 (if (and (or all (> (match-beginning 0) (line-beginning-position)))
1767 (not (fortran-is-in-string-p (match-beginning 0))))
1768 ;; Recurse for rest of line.
1776 (defun fortran-is-in-string-p (where)
1783 (beginning-of-line)
1789 parse-limit end-of-line)
1790 ;; Move to start of current statement.
1798 ;; - at end of line?
1808 ;; If we are at beginning of code line, skip any
1818 (setq end-of-line (line-end-position))
1819 (setq parse-limit (min where end-of-line))
1823 (if (re-search-forward quoted-comment-start end-of-line t)
1836 (defun fortran-fill ()
1838 (let* ((auto-fill-function #'fortran-auto-fill)
1840 (bol (line-beginning-position))
1906 ;; line of code is longer than it should be. Otherwise
1912 (beginning-of-line)
1915 (goto-char (match-beginning 0))
1928 (end-of-line))))
1930 (defun fortran-break-line ()
1932 (let ((bol (line-beginning-position))
1937 (match-beginning 0) (line-end-position))))))
1942 (end-of-line)
1950 (end-of-line)
1955 (defun fortran-analyze-file-format ()
1974 (defun fortran-fill-paragraph (&optional justify)
1976 Intended as the value of `fill-paragraph-function'.
1985 (defun fortran-fill-statement ()
1988 (let ((auto-fill-function #'fortran-auto-fill))
1990 (beginning-of-line)
1996 ;; Find beginning of statement.
2009 (defun fortran-strip-sequence-nos (&optional do-space)
2022 (defun fortran-current-defun ()
2023 "Function to use for `add-log-current-defun-function' in Fortran mode."
2025 ;; We must be inside function body for this to work.
2026 (fortran-beginning-of-subprogram)
2030 (concat "^[ \t]*\\(program\\|subroutine\\|function"
2031 "\\|[ \ta-z0-9*()]*[ \t]+function\\|"
2033 (save-excursion (fortran-end-of-subprogram)
2042 (end-of-line))