summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-07-03 20:10:32 +0000
committerRichard M. Stallman <rms@gnu.org>1998-07-03 20:10:32 +0000
commit6acae80afeb561a9bd0be9e9f05c10e29f145f80 (patch)
tree32e34959a677b4ed92c21acce6eabadb1b5382bc
parentc1c4693e692e3f8cae3290e24c96d905085234fe (diff)
downloademacs-6acae80afeb561a9bd0be9e9f05c10e29f145f80.tar.gz
(pascal-insert-block): Fixed space-deletion bug in
front of the "begin" string. (pascal-beg-of-defun): Used to locate the beginning of a function incorrectly when a function contained several begin-end blocks. Fixed.
-rw-r--r--lisp/progmodes/pascal.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 11ebe75b66c..cfada7cecdd 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -1,6 +1,6 @@
;;; pascal.el --- major mode for editing pascal source in Emacs
-;; Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 95, 96, 97, 1998 Free Software Foundation, Inc.
;; Author: Espen Skoglund <espensk@stud.cs.uit.no>
;; Keywords: languages
@@ -481,11 +481,10 @@ no args, if that value is non-nil."
(defun pascal-insert-block ()
"Insert Pascal begin ... end; block in the code with right indentation."
(interactive)
- (pascal-indent-line)
(insert "begin")
(electric-pascal-terminate-line)
(save-excursion
- (electric-pascal-terminate-line)
+ (newline)
(insert "end;")
(beginning-of-line)
(pascal-indent-line)))
@@ -610,7 +609,7 @@ area. See also `pascal-comment-area'."
(setq func (1+ func)))
(setq nest (1- nest)))
((match-end 3) ; function|procedure
- (if (= 0 func)
+ (if (or (> nest 0) (= 0 func))
(throw 'found t)
(setq func (1- func)))))))
nil))