X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/85ca47671ccbffe87d6ccad17039b49d6b676d61..eb0f65b4fbbea60100b53cb40a1d7138d47ad0d2:/lisp/cus-edit.el diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index f56fb6a649..a8d1c97e37 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1709,7 +1709,7 @@ Operate on all settings in this buffer:\n")) (mapcar (lambda (entry) (prog2 (message "Creating customization items ...%2d%%" - (/ (* 100.0 count) length)) + (floor (* 100.0 count) length)) (widget-create (nth 1 entry) :tag (custom-unlispify-tag-name (nth 0 entry)) @@ -1965,7 +1965,7 @@ Each entry is of the form (STATE MAGIC FACE ITEM-DESC [ GROUP-DESC ]), where STATE is one of the following symbols: -`nil' +nil For internal use, should never occur. `unknown' For internal use, should never occur. @@ -3115,7 +3115,7 @@ face attributes (as specified by a `default' defface entry)." widget (widget-get widget :default-face-attributes))) entry) - (unless (looking-back "^ *") + (unless (looking-back "^ *" (line-beginning-position)) (insert ?\n)) (insert-char ?\s (widget-get widget :extra-offset)) (if (or alist defaults show-all) @@ -4377,7 +4377,8 @@ if only the first line of the docstring is shown.")) (defun custom-file (&optional no-error) "Return the file name for saving customizations." - (if (null user-init-file) + (if (or (null user-init-file) + (and (null custom-file) init-file-had-error)) ;; Started with -q, i.e. the file containing Custom settings ;; hasn't been read. Saving settings there won't make much ;; sense. @@ -4406,7 +4407,9 @@ if only the first line of the docstring is shown.")) old-buffer-name) (with-current-buffer (let ((find-file-visit-truename t)) - (or old-buffer (find-file-noselect filename))) + (or old-buffer + (let ((delay-mode-hooks t)) + (find-file-noselect filename)))) ;; We'll save using file-precious-flag, so avoid destroying ;; symlinks. (If we're not already visiting the buffer, this is ;; handled by find-file-visit-truename, above.) @@ -4415,7 +4418,7 @@ if only the first line of the docstring is shown.")) (set-visited-file-name (file-chase-links filename))) (unless (eq major-mode 'emacs-lisp-mode) - (emacs-lisp-mode)) + (delay-mode-hooks (emacs-lisp-mode))) (let ((inhibit-read-only t) (print-length nil) (print-level nil))