aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/pascal.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 7c1163c2057..6a3c62a22e6 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -244,7 +244,8 @@ Pascal program are completed runtime and should not be added to this list.")
244 "[:=]\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)" 244 "[:=]\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)"
245 (save-excursion (end-of-line 2) (point)) t)) 245 (save-excursion (end-of-line 2) (point)) t))
246 (cond ((match-beginning 1) (setq nest (1+ nest))) 246 (cond ((match-beginning 1) (setq nest (1+ nest)))
247 ((match-beginning 2) (setq nest (1- nest))))))) 247 ((match-beginning 2) (setq nest (1- nest)))
248 ((looking-at "[^(\n]+)") (setq nest 0))))))
248 249
249 250
250(defun pascal-declaration-beg () 251(defun pascal-declaration-beg ()
@@ -427,7 +428,11 @@ no args, if that value is non-nil."
427 (save-excursion 428 (save-excursion
428 (beginning-of-line) 429 (beginning-of-line)
429 (pascal-indent-line)) 430 (pascal-indent-line))
430 (insert "\t")) 431 (if (save-excursion
432 (skip-chars-backward " \t")
433 (bolp))
434 (pascal-indent-line)
435 (insert "\t")))
431 (pascal-indent-command))) 436 (pascal-indent-command)))
432 437
433 438
@@ -903,10 +908,12 @@ column number the line should be indented to."
903 "^[ \t]*[^ \t,:]+[ \t]*\\(,[ \t]*[^ \t,:]+[ \t]*\\)*:" 908 "^[ \t]*[^ \t,:]+[ \t]*\\(,[ \t]*[^ \t,:]+[ \t]*\\)*:"
904 (marker-position end) 'move) 909 (marker-position end) 'move)
905 (forward-char -1)) 910 (forward-char -1))
906 (delete-horizontal-space) 911 (if (< (point) (marker-position end))
907 (if (> (current-column) ind) 912 (progn
908 (setq ind (current-column))) 913 (delete-horizontal-space)
909 (pascal-end-of-statement)) 914 (if (> (current-column) ind)
915 (setq ind (current-column)))
916 (pascal-end-of-statement))))
910 (goto-char beg) 917 (goto-char beg)
911 (setq oldpos (marker-position end)) 918 (setq oldpos (marker-position end))
912 ;; Indent all case statements 919 ;; Indent all case statements