From cbe8bb8e182a58114e78bbd3826f7c0c9708a79c Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sun, 25 Jul 1999 05:50:42 +0000 Subject: [PATCH] (custom-save-delete): Avoid error for empty .emacs. --- lisp/cus-edit.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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. -- 2.39.5