summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-03-07 05:53:10 +0000
committerRichard M. Stallman <rms@gnu.org>1996-03-07 05:53:10 +0000
commit11c5a7ff193791d4e3f3c051ba6c2e7e0e38a813 (patch)
treef1a57cf26ef1c360d5e612cbe31cabdc20cf0ad6
parent8c22ebbfc6022f343048d6614551dbfc9ec9356a (diff)
downloademacs-11c5a7ff193791d4e3f3c051ba6c2e7e0e38a813.tar.gz
(pascal-declaration-end): Now locates the end of a parameterlist correctly.
(electric-pascal-tab): Never indented a line when pascal-tab-always-indent was set to nil. (pascal-indent-case): Now locates the end of a case-statement correctly.
-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.")
"[:=]\\|\\(\\<record\\>\\)\\|\\(\\<end\\>\\)"
(save-excursion (end-of-line 2) (point)) t))
(cond ((match-beginning 1) (setq nest (1+ nest)))
- ((match-beginning 2) (setq nest (1- nest)))))))
+ ((match-beginning 2) (setq nest (1- nest)))
+ ((looking-at "[^(\n]+)") (setq nest 0))))))
(defun pascal-declaration-beg ()
@@ -427,7 +428,11 @@ no args, if that value is non-nil."
(save-excursion
(beginning-of-line)
(pascal-indent-line))
- (insert "\t"))
+ (if (save-excursion
+ (skip-chars-backward " \t")
+ (bolp))
+ (pascal-indent-line)
+ (insert "\t")))
(pascal-indent-command)))
@@ -903,10 +908,12 @@ column number the line should be indented to."
"^[ \t]*[^ \t,:]+[ \t]*\\(,[ \t]*[^ \t,:]+[ \t]*\\)*:"
(marker-position end) 'move)
(forward-char -1))
- (delete-horizontal-space)
- (if (> (current-column) ind)
- (setq ind (current-column)))
- (pascal-end-of-statement))
+ (if (< (point) (marker-position end))
+ (progn
+ (delete-horizontal-space)
+ (if (> (current-column) ind)
+ (setq ind (current-column)))
+ (pascal-end-of-statement))))
(goto-char beg)
(setq oldpos (marker-position end))
;; Indent all case statements