From: Karl Heuer Date: Sun, 25 Jul 1999 05:50:42 +0000 (+0000) Subject: (custom-save-delete): Avoid error for empty .emacs. X-Git-Tag: emacs-pretest-21.0.90~7383 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cbe8bb8e182a58114e78bbd3826f7c0c9708a79c;p=emacs.git (custom-save-delete): Avoid error for empty .emacs. --- 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.