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

Lines Matching +defs:last +defs:line

149   "*Non-nil means TAB in Delphi mode should always reindent the current line,
150 regardless of where in the line point is when the TAB command is used."
156 line, insert a blank line and move to the default indent column of the blank
157 line. If nil, then no indentation occurs, and NEWLINE does the usual
213 '(comment-single-line comment-multi-line-1 comment-multi-line-2)
420 (defvar delphi-progress-last-reported-point nil
421 "The last point at which progress was reported.")
432 (setq delphi-progress-last-reported-point nil))
436 (setq delphi-progress-last-reported-point nil)
443 ;; If enough distance has elapsed since the last reported point, then report
445 (cond ((null delphi-progress-last-reported-point)
447 (setq delphi-progress-last-reported-point p))
450 (>= (abs (- p delphi-progress-last-reported-point)) step-size))
452 (setq delphi-progress-last-reported-point p)
456 (defun delphi-next-line-start (&optional from-point)
457 ;; Returns the first point of the next line.
461 (end-of-line)
480 '((comment-single-line . "//")
481 (comment-multi-line-1 . "{")
482 (comment-multi-line-2 . "(*")
489 '((comment-single-line . "\n")
490 (comment-multi-line-1 . "}")
491 (comment-multi-line-2 . "*)")
499 '((comment-single-line . "\n")
500 (comment-multi-line-1 . "}")
501 (comment-multi-line-2 . "\\*)")
574 (let ((kind (cond ((match-beginning 1) 'comment-single-line)
575 ((match-beginning 2) 'comment-multi-line-1)
576 ((match-beginning 3) 'comment-multi-line-2)
754 ;; line after the change.
757 (progn (goto-char change-end) (end-of-line) (point)))
803 (defun delphi-line-indent-of (from-token &optional offset &rest terminators)
804 ;; Returns the column of first non-space character on the token's line, plus
808 (last-token from-token)
817 ;; Stop at the beginning of the line or an open group.
822 (unless (delphi-is kind delphi-whitespace) (setq last-token token))
824 (delphi-indent-of last-token offset)))
826 (defun delphi-stmt-line-indent-of (from-token &optional offset)
827 ;; Like `delphi-line-indent-of' except is also stops on a use clause, and
830 (last-token from-token)
837 (delphi-is (delphi-token-kind last-token)
847 ;; Stop at the beginning of the line, an open group, or a use clause
849 (unless (delphi-is kind delphi-whitespace) (setq last-token token))
851 (delphi-indent-of last-token offset)))
853 (defun delphi-open-group-indent (token last-token &optional offset)
856 (if last-token
857 (delphi-indent-of last-token offset)
858 ;; There is nothing following the ( or [. Indent from its line.
859 (delphi-stmt-line-indent-of token delphi-indent-level))))
861 (defun delphi-composite-type-start (token last-token)
862 ;; Returns true (actually the last-token) if the pair equals (= class) or (=
865 (delphi-is (delphi-token-kind last-token) delphi-composite-types))
866 last-token))
898 (last-token nil)
912 ((delphi-composite-type-start token last-token)
913 (throw 'done (if stop-on-class last-token token)))
916 (setq last-token token))
970 (if (not (eq 'comment-single-line (delphi-token-kind comment)))
978 ((eq kind 'comment-single-line)
988 (if (not (eq 'comment-single-line (delphi-token-kind comment)))
996 ((eq kind 'comment-single-line)
1002 (defun delphi-on-first-comment-line (comment)
1003 ;; Returns true if the current point is on the first line of the comment.
1008 (end-of-line)
1015 (delphi-on-first-comment-line comment))
1020 (beginning-of-line)
1021 (cond ((eq 'comment-single-line kind)
1027 ;; Indent multi-line comment terminators to the comment start.
1034 (defun delphi-is-use-clause-end (at-token last-token last-colon from-kind)
1036 (when (and last-token
1037 (not last-colon)
1078 (last-colon nil)
1079 (last-token nil))
1086 (throw 'done (delphi-open-group-indent token last-token)))
1108 ((delphi-is-use-clause-end token last-token last-colon from-kind)
1113 ((and last-token
1115 (not (delphi-is (delphi-token-kind last-token)
1117 (throw 'done (delphi-stmt-line-indent-of last-token 0)))
1124 ((eq 'colon token-kind) (setq last-colon token))
1130 (if last-colon (delphi-line-indent-of last-colon)
1131 (delphi-line-indent-of token delphi-case-label-indent))))
1138 (if last-token
1140 (delphi-indent-of last-token)
1142 (delphi-line-indent-of token delphi-indent-level))
1144 (delphi-line-indent-of token))))
1148 (throw 'done (delphi-stmt-line-indent-of token delphi-indent-level)))
1154 (throw 'done (if last-token
1155 ;; Otherwise indent to the last token
1156 (delphi-line-indent-of last-token)
1158 (delphi-line-indent-of token delphi-indent-level))))
1161 ((delphi-composite-type-start token last-token)
1164 (if (delphi-is-simple-class-type last-token from-token)
1166 (delphi-line-indent-of token)
1169 (delphi-line-indent-of last-token delphi-indent-level))))
1173 (throw 'done (delphi-stmt-line-indent-of token 0)))
1176 (setq last-token token))
1186 (last-token nil)
1189 (last-terminator nil))
1196 (throw 'done (delphi-open-group-indent token last-token)))
1220 ((eq 'semicolon token-kind) (setq last-terminator token))
1228 ((and (not last-terminator)
1231 (delphi-stmt-line-indent-of token delphi-compound-block-indent)))
1237 (not last-terminator)
1239 (not (eq 'equals (delphi-token-kind last-token))))
1241 (delphi-stmt-line-indent-of token delphi-indent-level)))
1246 (delphi-stmt-line-indent-of token delphi-indent-level)))
1252 (throw 'done (delphi-line-indent-of token 0)))
1258 (setq last-token token))
1269 (last-token nil)
1281 token last-token
1296 ;; Also remember the last encountered token, since if it exists it
1299 (setq expr-delimited token stmt-start last-token))
1308 (delphi-stmt-line-indent-of token 0))
1310 ((and last-token (delphi-is from-kind delphi-binary-ops))
1312 (delphi-indent-of last-token))
1314 (last-token
1316 (delphi-indent-of last-token delphi-indent-level))
1328 (delphi-stmt-line-indent-of
1331 (delphi-stmt-line-indent-of
1339 (delphi-stmt-line-indent-of
1343 ;; Thus we take into account last-token instead of stmt-start.
1345 (throw 'done (delphi-stmt-line-indent-of
1346 (or last-token token) delphi-indent-level)))
1350 (throw 'done (delphi-indent-of (if last-token last-token token)
1359 (cond ((and last-token
1363 (delphi-indent-of last-token))
1365 (last-token
1367 (delphi-indent-of last-token delphi-indent-level))
1382 (cond (last-token (delphi-indent-of last-token delphi-indent-level))
1388 (throw 'done (delphi-stmt-line-indent-of token delphi-indent-level)))
1392 (throw 'done (delphi-stmt-line-indent-of
1393 (or last-token token) delphi-indent-level)))
1396 ((delphi-composite-type-start token last-token)
1398 (delphi-line-indent-of last-token delphi-indent-level)))
1400 ;; A ":" we indent relative to its line beginning. If we are in a
1408 (if last-token
1409 (delphi-indent-of last-token delphi-indent-level)
1410 (delphi-line-indent-of token delphi-indent-level 'semicolon))))
1429 ((eq (delphi-token-kind last-token) 'equals))
1438 before-equals last-token))
1441 (setq last-token token))
1447 ;; Returns the corrected indentation for the current line.
1450 ;; Move to the first token on the line.
1451 (beginning-of-line)
1481 ((delphi-stmt-line-indent-of block-start 0)))))
1485 (delphi-stmt-line-indent-of (delphi-else-start token) 0))
1493 (defun delphi-indent-line ()
1494 "Indent the current line according to the current language construct. If
1500 (line-start nil)
1503 (beginning-of-line)
1504 (setq line-start (point))
1514 (delete-region line-start (point))
1636 "Terminate the current line with a newline and indent the next, unless
1643 ;; Indent both the (now) previous and current line first.
1645 (previous-line 1)
1646 (delphi-indent-line))
1647 (delphi-indent-line)))
1651 "Indent the current line or insert a TAB, depending on the value of
1652 `delphi-tab-always-indents' and the current line position."
1655 ;; Or we are before the first non-space character on the line.
1657 (delphi-indent-line)
1785 (when (eq 'comment-single-line comment-kind)
1818 ;; add an extra line to prevent the fill from doing it for us.
1831 (end-of-line) ; Don't reset the first line.
1851 (defun delphi-new-comment-line ()
1856 (if (not (eq 'comment-single-line (delphi-token-kind comment)))
1921 '("\M-j" delphi-new-comment-line)
1934 \\[delphi-tab]\t- Indents the current line for Delphi code.
1937 \\[delphi-new-comment-line]\t- If in a // comment, do a new comment line.
1950 Non-nil means TAB in Delphi mode should always reindent the current line,
1951 regardless of where in the line point is when the TAB command is used.
1954 line, insert a blank line and move to the default indent column of the
1955 blank line.
1989 (list '(indent-line-function delphi-indent-line)
1990 '(comment-indent-function delphi-indent-line)
1992 '(delphi-progress-last-reported-point nil)