summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2020-05-01 12:23:15 +0000
committerAlan Mackenzie <acm@muc.de>2020-05-01 12:23:15 +0000
commita4c07bc8c8201a620c4365c1d0d2cb814cc677a9 (patch)
treeb6cb5a9fcce5c3b56c4431d7ec826ab8aaf6d744 /lisp/cus-edit.el
parent43fded12d544ab68f493142debc5b3e437317f35 (diff)
downloademacs-a4c07bc8c8201a620c4365c1d0d2cb814cc677a9.tar.gz
emacs-a4c07bc8c8201a620c4365c1d0d2cb814cc677a9.tar.bz2
emacs-a4c07bc8c8201a620c4365c1d0d2cb814cc677a9.zip
Protect non-selected face spec components in custimize-face. Fixes bug #40866
* lisp/cus-edit.el (custom-face-save): If the current face widget is only displaying part of the face spec, temporarily set it to "display" the whole spec around the call to custom-face-mark-to-save.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d3d17fda7ad..1ec27085506 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3824,7 +3824,17 @@ Optional EVENT is the location for the menu."
(defun custom-face-save (widget)
"Save the face edited by WIDGET."
- (custom-face-mark-to-save widget)
+ (let ((form (widget-get widget :custom-form)))
+ (if (memq form '(all lisp))
+ (custom-face-mark-to-save widget)
+ ;; The user is working on only a selected terminal type;
+ ;; make sure we save the entire spec to `custom-file'. (Bug #40866)
+ (custom-face-edit-all widget)
+ (custom-face-mark-to-save widget)
+ (if (eq form 'selected)
+ (custom-face-edit-selected widget)
+ ;; `form' is edit or mismatch; can't happen.
+ (widget-put widget :custom-form form))))
(custom-save-all)
(custom-face-state-set-and-redraw widget))