diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-05-13 16:25:13 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-05-13 16:25:13 +0000 |
commit | 0e9bcb01a07bbfa2bda56b1e695326b386fb4a50 (patch) | |
tree | 0cab1ea9d6cd2766933c69ec9609df5d6c3acae5 /lisp/progmodes | |
parent | 8f2791c0fe8fd79e657e2435ef551677232674cc (diff) | |
download | emacs-0e9bcb01a07bbfa2bda56b1e695326b386fb4a50.tar.gz |
(pascal-end-of-statement, pascal-calculate-indent):
Set parse-sexp-ignore-comments to t before parsing.
(pascal-indent-case): Save position of cursor, and restores it
after reindenting the code.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/pascal.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index 6a3c62a22e6..2cad0a01afd 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el @@ -612,7 +612,8 @@ area. See also `pascal-comment-area'." (defun pascal-end-of-statement () "Move forward to end of current statement." (interactive) - (let ((nest 0) pos + (let ((parse-sexp-ignore-comments t) + (nest 0) pos (regexp (concat "\\(" pascal-beg-block-re "\\)\\|\\(" pascal-end-block-re "\\)"))) (if (not (looking-at "[ \t\n]")) (forward-sexp -1)) @@ -784,7 +785,8 @@ on the line which ends a function or procedure named NAME." "Calculate the indent of the current Pascal line. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." (save-excursion - (let* ((oldpos (point)) + (let* ((parse-sexp-ignore-comments t) + (oldpos (point)) (state (save-excursion (parse-partial-sexp (point-min) (point)))) (nest 0) (par 0) (complete (looking-at "[ \t]*end\\>")) (elsed (looking-at "[ \t]*else\\>")) @@ -895,8 +897,8 @@ column number the line should be indented to." (defun pascal-indent-case () "Indent within case statements." - (skip-chars-forward ": \t") - (let ((end (prog2 + (let ((savepos (point-marker)) + (end (prog2 (end-of-line) (point-marker) (re-search-backward "\\<case\\>" nil t))) @@ -930,7 +932,7 @@ column number the line should be indented to." (insert " ")) (setq oldpos (point)) (pascal-end-of-statement)) - (goto-char oldpos))) + (goto-char savepos))) (defun pascal-indent-paramlist (&optional arg) "Indent current line in parameterlist. |