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

Lines Matching +defs:end +defs:of

9 ;; This file is part of GNU Emacs.
12 ;; it under the terms of the GNU General Public License as published by
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; You should have received a copy of the GNU General Public License
34 ;; C-h f <Name of function you want described>
37 ;; these lines (the values of the variables presented here are the defaults):
49 ;; pascal-start-keywords '("begin" "end" "function" "procedure"
56 ;; As far as I know, there are no bugs in the current version of this
91 (define-key map "\M-\C-a" 'pascal-beg-of-defun)
92 (define-key map "\M-\C-e" 'pascal-end-of-defun)
108 '("and" "array" "begin" "case" "const" "div" "do" "downto" "else" "end"
109 "file" "for" "function" "goto" "if" "in" "label" "mod" "nil" "not" "of"
121 (defconst pascal-end-block-re "\\<\\(end\\|until\\)\\>")
126 (defconst pascal-noindent-re "\\<\\(begin\\|end\\|until\\|else\\)\\>")
129 "\\<\\(label\\|var\\|type\\|const\\|until\\|end\\|begin\\|repeat\\|else\\)\\>")
131 ;;; Strings used to mark beginning and end of excluded text
133 (defconst pascal-exclude-str-end " -----/\\----- EXCLUDED -----/\\-----}")
141 ;; find about the syntax of Pascal's comments said that (* ... } is
174 ; ("of" "to" "for" "if" "then" "else" "case" "while"
175 ; "do" "until" "and" "or" "not" "in" "with" "repeat" "begin" "end")
188 "*Indentation of Pascal statements with respect to containing block."
199 These include after semicolons and after the punctuation mark after an `end'."
210 If this is nil, TAB inserts a tab if it is at the end of the line
216 "*Non-nil means automatically insert comments after certain `end's.
217 Specifically, this is done after the ends of cases statements and functions.
218 The name of the function or case is included between the braces."
223 "*List of contexts where auto lineup of :'s or ='s should be done.
224 Elements can be of type: 'paramlist', 'declaration' or 'case', which will
238 Repeated use of \\[pascal-complete-word] will show you all of them.
240 it displays a list of all possible completions."
254 '("begin" "end" "function" "procedure" "repeat" "until" "while"
256 "*Keywords to complete when standing at the first word of a statement.
265 "*Keywords to complete when NOT standing at the first word of a statement.
277 (defsubst pascal-get-beg-of-line (&optional arg)
279 (beginning-of-line arg)
282 (defsubst pascal-get-end-of-line (&optional arg)
284 (end-of-line arg)
287 (defun pascal-declaration-end ()
291 "[:=]\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)"
292 (save-excursion (end-of-line 2) (point)) t))
301 (re-search-backward "[:=]\\|\\<\\(type\\|var\\|label\\|const\\)\\>\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)" (pascal-get-beg-of-line 0) t))
310 (nth 3 (parse-partial-sexp (pascal-get-beg-of-line) (point)))))
325 \\[pascal-insert-block]\t- insert begin ... end;
330 \\[pascal-beg-of-defun]\t- Move to beginning of current function.
331 \\[pascal-end-of-defun]\t- Move to end of current function.
338 Indentation of Pascal statements with respect to containing block.
343 mark after an end.
348 regardless of where in the line point is when the TAB command is used.
351 functions. The name of the function or case will be set between the braces.
353 List of contexts where auto lineup of :'s or ='s should be done.
358 Turning on Pascal mode calls the value of the variable pascal-mode-hook with
381 (make-local-variable 'comment-end)
382 (setq comment-end "}")
403 (beginning-of-line)
425 (search-forward "*)" (pascal-get-end-of-line) t))))
438 (beginning-of-line)
451 (beginning-of-line)
468 (if (save-excursion (beginning-of-line) (looking-at "^[ \t]*#"))
469 (save-excursion (beginning-of-line)
478 (save-excursion (beginning-of-line) (eq (following-char) ?#))))
480 ;; If pascal-tab-always-indent, indent the beginning of the line.
483 (beginning-of-line)
499 "Insert Pascal begin ... end; block in the code with right indentation."
505 (insert "end;")
506 (beginning-of-line)
523 This puts the mark at the end, and point at the beginning."
526 (pascal-end-of-defun)
528 (pascal-beg-of-defun)
532 (defun pascal-comment-area (start end)
540 `pascal-include-str-end'. But if you change these variables,
545 (goto-char end)
549 (beginning-of-line))
550 (insert pascal-exclude-str-end)
551 (setq end (point))
554 (beginning-of-line)
557 ;; Replace end-comments within commented area
558 (goto-char end)
573 (end (point)))
574 ;; Find the boundaries of the comment
578 (setq end (progn (search-forward pascal-exclude-str-end nil t)
581 (if (or (equal start (point)) (<= end (point)))
585 (goto-char end)
586 (beginning-of-line)
588 (end-of-line)
599 (beginning-of-line)
601 (end-of-line)
604 (defun pascal-beg-of-defun ()
605 "Move backward to the beginning of the current function or procedure."
612 pascal-end-block-re "\\|"
619 ((match-end 1) ; begin|case|record|repeat
624 ((match-end 2) ; end|until
628 ((match-end 3) ; function|procedure
634 (defun pascal-end-of-defun ()
635 "Move forward to the end of the current function or procedure."
640 (pascal-beg-of-defun))
644 pascal-end-block-re "\\|"
652 ((match-end 1)
658 ((match-end 2)
662 ((match-end 3)
666 (defun pascal-end-of-statement ()
667 "Move forward to end of current statement."
672 pascal-end-block-re "\\)")))
675 ;; Skip to end of statement
695 (setq nest (if (match-end 1)
701 (throw 'found (pascal-end-of-statement))))))
737 Insert `{ case }' if there is an `end' on the line which
738 ends a case block. Insert `{ NAME }' if there is an `end'
743 (if (and (looking-at "\\<end;")
745 (end-of-line)
746 (search-backward "{" (pascal-get-beg-of-line) t))))
753 (end-of-line)
757 ;; Check if this is the end of a function
763 ((looking-at pascal-end-block-re)
769 (end-of-line)
774 (setq b (progn (pascal-beg-of-defun)
800 "Indent for special part of code."
847 "Calculate the indent of the current Pascal line.
848 Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)."
853 (nest 0) (par 0) (complete (looking-at "[ \t]*end\\>"))
863 ((save-excursion (beginning-of-line)
875 (end-of-line) (backward-sexp) (point))
878 (beginning-of-line)
882 (;--Beginning of program
900 (looking-at pascal-end-block-re)
901 (if (and (looking-at "end\\s ")
921 "\\(\\<record\\>\\)\\|\\<end\\>"
923 (if (match-end 1)
948 ;; Return type of block and indent level.
957 (beginning-of-line)
976 (end (prog2
977 (end-of-line)
983 (while (< (point) end)
986 (marker-position end) 'move)
988 (if (< (point) end)
993 (pascal-end-of-statement))))
996 (while (< (point) end)
999 (marker-position end) 'move)
1007 (pascal-end-of-statement))
1013 indent of the current line in parameterlist."
1018 (edpos (progn (pascal-declaration-end)
1019 (search-backward ")" (pascal-get-beg-of-line) t)
1025 (beginning-of-line)
1035 (defun pascal-indent-declaration (&optional arg start end)
1045 (if end end
1046 (max (progn (pascal-declaration-end)
1055 (beginning-of-line)
1057 (if (looking-at "end\\>")
1066 (if (search-forward lineup (pascal-get-end-of-line) 'move)
1093 (and (re-search-forward reg (min e (pascal-get-end-of-line 2)) 'move)
1096 (pascal-declaration-end))
1105 (goto-char (match-end 0))
1106 (end-of-line)
1113 (end-of-line)
1130 "Return index of first letter where STR1 and STR2 differs."
1161 (while (pascal-beg-of-defun)
1162 (if (re-search-forward pascal-str (pascal-get-end-of-line) t)
1164 (match-end 2)))
1172 ;; for matches of `str' and adding the occurrence to `all'
1173 (let ((end (save-excursion (pascal-declaration-end)
1177 (while (< (point) end)
1178 (if (re-search-forward "[:=]" (pascal-get-end-of-line) t)
1183 (pascal-get-beg-of-line) t)
1184 (not (match-end 1)))
1185 (setq match (buffer-substring (match-beginning 0) (match-end 0)))
1190 (if (re-search-forward "\\<record\\>" (pascal-get-end-of-line) t)
1191 (pascal-declaration-end)
1199 (while (or (pascal-beg-of-defun)
1202 (if (and (< start (prog1 (save-excursion (pascal-end-of-defun)
1208 (not (match-end 1)))
1217 (while (or (pascal-beg-of-defun)
1220 (if (> start (prog1 (save-excursion (pascal-end-of-defun)
1223 (if (search-forward "(" (pascal-get-end-of-line) t)
1232 (not (match-end 2)))
1235 ((match-end 2)
1240 "Give list of all possible completions of keywords in KEYWORD-LIST."
1252 ;; of all possible completions. If it is nil it returns a string, the
1271 (pascal-get-beg-of-line) t))))
1273 (pascal-beg-of-defun))
1293 ;; Now we have built a list of all matches. Give response to caller
1327 ;; list of all possible completions
1371 ;; The other form of completion does not necessarily do that.
1378 ;; Give message about current status of completion
1427 With optional second arg non-nil, STR is the complete name of the instruction."
1436 ;; function returns a list of all possible completions. If it is nil
1457 ;; Build a list of all possible completions
1459 (setq match (buffer-substring (match-beginning 2) (match-end 2)))
1464 ;; Now we have built a list of all matches. Give response to caller
1491 (beginning-of-line)))))
1515 of the text being edited may be made invisible. \\<pascal-outline-map>
1540 (goto-char b) (setq b (line-end-position))
1541 (goto-char e) (setq e (line-end-position)))
1552 "Show all of the text in the buffer."
1561 (pascal-beg-of-defun))
1563 (end (progn (pascal-end-of-defun)
1575 (if (> (progn (pascal-end-of-defun) (point)) beg)
1581 (pascal-outline-change beg end ?\n)
1584 (while (re-search-forward "^\\(function\\|procedure\\)\\>" end 'move)
1586 (pascal-end-of-defun)
1589 (goto-char end)
1590 (setq opoint end)
1596 (pascal-end-of-defun))
1600 (if (< (progn (forward-line -1) (point)) end)
1603 (pascal-end-of-defun)
1610 (pascal-end-of-defun)
1616 (pascal-beg-of-defun)