diff options
-rw-r--r-- | etc/NEWS | 3 | ||||
-rw-r--r-- | lisp/cus-edit.el | 11 |
2 files changed, 14 insertions, 0 deletions
@@ -1266,6 +1266,9 @@ To revert to the previous behavior, ** Customize +--- +*** Customize buffers can now be reverted with 'C-x x g'. + *** Most customize commands now hide obsolete user options. Obsolete user options are no longer shown in the listings produced by the commands 'customize', 'customize-group', 'customize-apropos' and diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 7627930c4c8..a8b2640b7d3 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -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 @@ -5148,11 +5151,19 @@ 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)) +(defun custom--revert-buffer (_ignore-auto _noconfirm) + (unless custom--invocation-options + (error "Insufficient data to revert")) + (custom-buffer-create custom--invocation-options + (buffer-name))) + (put 'Custom-mode 'mode-class 'special) (provide 'cus-edit) |