aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1993-11-23 08:35:46 +0000
committerRichard M. Stallman <[email protected]>1993-11-23 08:35:46 +0000
commit0b1716286b7065b3529c8ba60fca0ddb544c3655 (patch)
tree96d62117bb28788e8fe17baa5d8a1ef5f3d08439
parent6ebbf1dcaf628240d30337cca99e0541006f0767 (diff)
(c-indent-region): Don't goto-char sexpend if it's nil.
-rw-r--r--lisp/progmodes/c-mode.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el
index bbb195a2b9..ddda62454f 100644
--- a/lisp/progmodes/c-mode.el
+++ b/lisp/progmodes/c-mode.el
@@ -1211,11 +1211,13 @@ If within a string or comment, move by sentences instead of statements."
(error (setq sexpend nil)
(goto-char nextline)))
(skip-chars-forward " \t\n"))
- ;; Make sure the sexp we found really starts on the
- ;; current line and extends past it.
- (goto-char sexpend)
- (backward-sexp 1)
- (setq sexpbeg (point)))
+ (if sexpend
+ (progn
+ ;; Make sure the sexp we found really starts on the
+ ;; current line and extends past it.
+ (goto-char sexpend)
+ (backward-sexp 1)
+ (setq sexpbeg (point)))))
;; If that sexp ends within the region,
;; indent it all at once, fast.
(if (and sexpend (> sexpend nextline) (<= sexpend endmark)