summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1999-07-25 05:50:42 +0000
committerKarl Heuer <kwzh@gnu.org>1999-07-25 05:50:42 +0000
commitcbe8bb8e182a58114e78bbd3826f7c0c9708a79c (patch)
tree819865d5697365d06e6a4204bf84ca3d4ca088b3 /lisp/cus-edit.el
parentb108eac242e94b396179bc0e58de3952d0abf64f (diff)
downloademacs-cbe8bb8e182a58114e78bbd3826f7c0c9708a79c.tar.gz
(custom-save-delete): Avoid error for empty .emacs.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 98c0aa6a4d7..ef0e0dc5552 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3101,7 +3101,10 @@ Leave point at the location of the call, or after the last expression."
(let ((default-major-mode))
(set-buffer (find-file-noselect (custom-file))))
(goto-char (point-min))
- (save-excursion (forward-sexp (buffer-size))) ; Test for scan errors.
+ ;; Skip all whitespace and comments.
+ (while (forward-comment 1))
+ (or (eobp)
+ (save-excursion (forward-sexp (buffer-size)))) ; Test for scan errors.
(catch 'found
(while t
;; Skip all whitespace and comments.