diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
commit | 07fcbb558d797272b9f43547da60beda485873a3 (patch) | |
tree | 77d5da14e9f9d9d8b1d877c70c01296fd3893796 /lisp/cus-edit.el | |
parent | c9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff) | |
parent | fb81c8c3adf8633f2f617c82f6019aef630860c7 (diff) | |
download | emacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz |
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r-- | lisp/cus-edit.el | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index cd1ae964eb9..7eae2e416bb 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1206,7 +1206,7 @@ Show the buffer in another window, but don't select it." (message "`%s' is an alias for `%s'" symbol basevar)))) (defvar customize-changed-options-previous-release "26.3" - "Version for `customize-changed-options' to refer back to by default.") + "Version for `customize-changed' to refer back to by default.") ;; Packages will update this variable, so make it available. ;;;###autoload @@ -1665,8 +1665,11 @@ Otherwise use brackets." 'custom-button-pressed 'custom-button-pressed-unraised)))) +(defvar custom--invocation-options nil) + (defun custom-buffer-create-internal (options &optional _description) (Custom-mode) + (setq custom--invocation-options options) (let ((init-file (or custom-file user-init-file))) ;; Insert verbose help at the top of the custom buffer. (when custom-buffer-verbose-help @@ -1907,7 +1910,7 @@ item in another window.\n\n")) (widget-put (get 'editable-field 'widget-type) :custom-show (lambda (_widget value) (let ((pp (pp-to-string value))) - (cond ((string-match-p "\n" pp) + (cond ((string-search "\n" pp) nil) ((> (length pp) 40) nil) @@ -2821,7 +2824,7 @@ the present value is saved to its :shown-value property instead." (list (widget-value (car-safe (widget-get widget :children))))) - (error "There are unsaved changes"))) + (message "Note: There are unsaved changes"))) (widget-put widget :documentation-shown nil) (widget-put widget :custom-state 'hidden)) (custom-redraw widget) @@ -5148,14 +5151,20 @@ if that value is non-nil." :label (nth 5 arg))) custom-commands) (setq custom-tool-bar-map map)))) + (setq-local custom--invocation-options nil) + (setq-local revert-buffer-function #'custom--revert-buffer) (make-local-variable 'custom-options) (make-local-variable 'custom-local-buffer) (custom--initialize-widget-variables) (add-hook 'widget-edit-functions 'custom-state-buffer-message nil t)) -(put 'Custom-mode 'mode-class 'special) +(defun custom--revert-buffer (_ignore-auto _noconfirm) + (unless custom--invocation-options + (error "Insufficient data to revert")) + (custom-buffer-create custom--invocation-options + (buffer-name))) -;;; The End. +(put 'Custom-mode 'mode-class 'special) (provide 'cus-edit) |