• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/progmodes/

Lines Matching +defs:comment +defs:start +defs:skip

75 (defgroup fortran-comment nil
115 (defcustom fortran-comment-indent-style 'fixed
117 nil forces comment lines not to be touched;
118 `fixed' indents to `fortran-comment-line-extra-indent' columns beyond
122 `fortran-comment-line-extra-indent'."
126 (defcustom fortran-comment-line-extra-indent 0
130 :group 'fortran-comment)
132 (defcustom fortran-comment-line-start "C"
133 "*Delimiter inserted to start new full-line comment.
137 :group 'fortran-comment)
141 (defcustom fortran-comment-line-start-skip
143 "*Regexp to match the start of a full-line comment."
146 :group 'fortran-comment)
170 (defcustom fortran-comment-indent-char " "
171 "*Single-character string inserted for Fortran comment indentation.
174 :group 'fortran-comment)
203 (defcustom fortran-comment-region "c$$$"
204 "*String inserted by \\[fortran-comment-region] at start of each \
207 :group 'fortran-comment)
269 (defvar fortran-if-start-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?if[ \t]*("
270 "Regexp matching the start of an IF statement.")
280 "Regexp possibly matching the end of a subprogram, from the line start.
352 `(font-lock-match-c-style-declaration-item-and-skip-to-next
402 ;; represent the standard comment syntax in an Emacs syntax table.
404 ;; standard comment will throw fontification off on the wrong track.
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.
461 (defconst fortran-start-block-re
489 "Regexp matching the start of a Fortran \"block\", from the line start.
495 `(fortran-mode ,fortran-start-block-re ,fortran-end-block-re
534 (define-key map ";" 'fortran-abbrev-start)
535 (define-key map "\C-c;" 'fortran-comment-region)
536 (define-key map "\M-;" 'fortran-indent-comment)
570 ["Comment Region" fortran-comment-region mark-active]
572 (fortran-comment-region (region-beginning) (region-end) 1)
704 `fortran-comment-line-start'
715 `fortran-comment-line-extra-indent'
717 `fortran-comment-indent-style'
720 fixed indent to `fortran-comment-line-extra-indent' beyond the
725 relative indent to `fortran-comment-line-extra-indent' beyond the
728 `fortran-comment-indent-char'
730 full-line comment indentation (default \" \").
748 `fortran-comment-region'
749 String inserted by \\[fortran-comment-region] at start of each line in
768 (lambda (start end)
771 (indent-region start end nil))))
773 ;; The syntax tables don't understand the column-0 comment-markers.
774 (set (make-local-variable 'comment-use-syntax) nil)
775 (set (make-local-variable 'comment-padding) "$$$")
776 (set (make-local-variable 'comment-start) fortran-comment-line-start)
777 (set (make-local-variable 'comment-start-skip)
778 ;; We can't reuse `fortran-comment-line-start-skip' directly because
780 ;; beginning of the comment delimiter.
781 ;; (concat "\\(\\)\\(![ \t]*\\|" fortran-comment-line-start-skip "\\)")
783 (set (make-local-variable 'comment-indent-function) 'fortran-comment-indent)
821 (defsubst fortran-comment-indent ()
822 "Return the indentation appropriate for the current comment line.
823 This is 0 for a line matching `fortran-comment-line-start-skip', else
824 the value of `comment-column' (leaving at least one space after code)."
825 (if (looking-at fortran-comment-line-start-skip) 0
827 (skip-chars-backward " \t")
828 (max (1+ (current-column)) comment-column))))
830 (defun fortran-indent-comment ()
831 "Align or create comment on current line.
833 If the line has no comment, a side-by-side comment is inserted and aligned,
834 if the value of `comment-start' is not nil and allows such comments.
835 Otherwise, a separate-line comment is inserted, on this line
840 (cond ((fortran-find-comment-start-skip 'all)
844 (unless (= (current-column) (fortran-comment-indent))
846 (indent-to (fortran-comment-indent)))))
847 ;; No existing comment.
850 ((and comment-start (not (looking-at "[ \t]*$"))
851 (string-match comment-start-skip (concat " " comment-start)))
854 (indent-to (fortran-comment-indent))
855 (insert comment-start))
856 ;; Else insert separate-line comment, making a new line if nec.
863 (insert fortran-comment-line-start)
864 (insert-char (if (stringp fortran-comment-indent-char)
865 (aref fortran-comment-indent-char 0)
866 fortran-comment-indent-char)
869 (defun fortran-comment-region (beg-region end-region arg)
871 Inserts the string variable `fortran-comment-region' at the beginning of
881 (let ((com (regexp-quote fortran-comment-region))) ; uncomment
888 (insert fortran-comment-region) ; comment
891 (insert fortran-comment-region)))
898 (defun fortran-abbrev-start ()
943 (if (eq (window-start (selected-window))
991 (and (fortran-find-comment-start-skip 'all)
1062 (skip-chars-backward " \t")
1079 ;; case of un-marked main programs not at the start of the file.
1113 non-comment Fortran statement in the file, and nil otherwise.
1120 (not (looking-at fortran-comment-line-start-skip))
1127 (or (looking-at fortran-comment-line-start-skip)
1133 (looking-at (concat "[ \t]*" comment-start-skip)))))
1145 non-comment Fortran statement in the file, and nil otherwise.
1153 (or (looking-at fortran-comment-line-start-skip)
1156 (looking-at (concat "[ \t]*" comment-start-skip)))))
1161 "Return non-nil if at the start of a line with an IF ... THEN statement."
1175 If NUM is negative, go backward to the start of a block. Does
1192 (if (if (looking-at (concat "^[0-9 \t]*" fortran-if-start-re))
1194 (looking-at fortran-start-block-re))
1206 "Move point backwards to the start of the current code block.
1225 (if (if (looking-at (concat "^[0-9 \t]*" fortran-if-start-re))
1227 (looking-at fortran-start-block-re))
1236 (if (> count 0) (error "Missing block start"))))
1243 (let ((top-of-window (window-start))
1250 (skip-chars-forward " \t0-9")
1294 (skip-chars-forward " \t0-9")
1306 (skip-chars-forward " \t0-9")
1323 (skip-chars-forward " \t0-9")
1335 (skip-chars-forward " \t0-9")
1363 (skip-chars-forward " \t0-9")
1376 (skip-chars-forward " \t0-9")
1379 ((looking-at fortran-if-start-re)
1411 (skip-chars-forward " \t0-9")
1413 (looking-at fortran-if-start-re)
1437 (skip-chars-forward " \t0-9")
1438 (cond ((looking-at fortran-if-start-re)
1474 (if (fortran-find-comment-start-skip)
1475 (fortran-indent-comment))))
1501 (if (fortran-find-comment-start-skip)
1502 (fortran-indent-comment))))
1535 (skip-chars-forward " \t0-9")
1573 ;; Check for directive before comment, so as not to indent.
1576 ((looking-at fortran-comment-line-start-skip)
1577 (cond ((eq fortran-comment-indent-style 'relative)
1578 (setq icol (+ icol fortran-comment-line-extra-indent)))
1579 ((eq fortran-comment-indent-style 'fixed)
1581 fortran-comment-line-extra-indent))))
1587 (skip-chars-forward " \t")
1599 (skip-chars-forward " \t0-9")
1629 For comment lines, returns indentation of the first
1630 non-indentation text within the comment."
1633 (cond ((looking-at fortran-comment-line-start-skip)
1635 (skip-chars-forward
1636 (if (stringp fortran-comment-indent-char)
1637 fortran-comment-indent-char
1638 (char-to-string fortran-comment-indent-char))))
1643 (skip-chars-forward "[ \t0-9]")))
1645 (skip-chars-forward " \t")
1659 (if (looking-at fortran-comment-line-start-skip)
1660 (if fortran-comment-indent-style
1661 (let* ((char (if (stringp fortran-comment-indent-char)
1662 (aref fortran-comment-indent-char 0)
1663 fortran-comment-indent-char))
1666 (skip-chars-backward chars)
1667 (delete-region (point) (progn (skip-chars-forward chars)
1701 (skip-chars-forward "0-9")))))
1706 ;; Indent any comment following code on the same line.
1707 (when (fortran-find-comment-start-skip)
1709 (unless (= (current-column) (fortran-comment-indent))
1711 (indent-to (fortran-comment-indent)))))))
1718 (skip-chars-forward " \t")
1721 (progn (skip-chars-forward "0-9")
1732 (skip-chars-forward " \t")
1733 (skip-chars-forward "0") ; skip past leading zeros
1736 (skip-chars-forward "0-9")
1752 (defun fortran-find-comment-start-skip (&optional all)
1753 "Move to past `comment-start-skip' found on current line.
1754 Return non-nil if `comment-start-skip' found, nil if not.
1755 If ALL is nil, only match comments that start in column > 0."
1757 ;; (comment-search-forward (line-end-position) t))
1758 (when (or all comment-start-skip)
1760 (css (if comment-start-skip
1761 (concat fortran-comment-line-start-skip
1762 "\\|" comment-start-skip)
1763 fortran-comment-line-start-skip)))
1769 (fortran-find-comment-start-skip all)))
1782 ((save-excursion ; comment lines too
1784 (looking-at fortran-comment-line-start-skip)) nil)
1786 (quoted-comment-start (if comment-start
1787 (regexp-quote comment-start)))
1790 ;; Move to start of current statement.
1796 ;; - comment line?
1797 (looking-at fortran-comment-line-start-skip)
1800 ;; - not in a string and after comment-start?
1802 comment-start
1803 (equal comment-start
1808 ;; If we are at beginning of code line, skip any
1810 (if (bolp) (skip-chars-forward " \t0-9"))
1820 ;; Parse max up to comment-start, if non-nil and in current line.
1821 (if comment-start
1823 (if (re-search-forward quoted-comment-start end-of-line t)
1848 ;; OK to break quotes on comment lines.
1849 (unless (looking-at fortran-comment-line-start-skip)
1850 (let (fcpoint start)
1855 (setq start
1864 (if (> (- (point) start)
1867 start))))))
1888 ;; to start from (1- fill-column) above.
1905 ;; If we are in an in-line comment, don't break unless the
1909 ;; Need to use fortran-find-comment-start-skip to make sure that
1913 (if (not (fortran-find-comment-start-skip))
1933 (comment-string
1935 (if (fortran-find-comment-start-skip)
1947 (if comment-string
1952 (indent-to (fortran-comment-indent))
1953 (insert comment-string)))))
1957 Use `fortran-tab-mode-default' if no non-comment statements are found
1975 "Fill surrounding comment block as paragraphs, else fill statement.
1977 A comment block is filled by calling `fill-comment-paragraph' with
1981 (or (fill-comment-paragraph justify)
1992 (looking-at fortran-comment-line-start-skip)
1993 (and comment-start-skip
1994 (looking-at (concat "[ \t]*" comment-start-skip)))))
2028 ;; Search for fortran subprogram start.
2041 (skip-chars-backward " \t"))