aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2020-05-01 12:23:15 +0000
committerAlan Mackenzie2020-05-01 12:23:15 +0000
commita4c07bc8c8201a620c4365c1d0d2cb814cc677a9 (patch)
treeb6cb5a9fcce5c3b56c4431d7ec826ab8aaf6d744
parent43fded12d544ab68f493142debc5b3e437317f35 (diff)
downloademacs-a4c07bc8c8201a620c4365c1d0d2cb814cc677a9.tar.gz
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.
-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."
3824 3824
3825(defun custom-face-save (widget) 3825(defun custom-face-save (widget)
3826 "Save the face edited by WIDGET." 3826 "Save the face edited by WIDGET."
3827 (custom-face-mark-to-save widget) 3827 (let ((form (widget-get widget :custom-form)))
3828 (if (memq form '(all lisp))
3829 (custom-face-mark-to-save widget)
3830 ;; The user is working on only a selected terminal type;
3831 ;; make sure we save the entire spec to `custom-file'. (Bug #40866)
3832 (custom-face-edit-all widget)
3833 (custom-face-mark-to-save widget)
3834 (if (eq form 'selected)
3835 (custom-face-edit-selected widget)
3836 ;; `form' is edit or mismatch; can't happen.
3837 (widget-put widget :custom-form form))))
3828 (custom-save-all) 3838 (custom-save-all)
3829 (custom-face-state-set-and-redraw widget)) 3839 (custom-face-state-set-and-redraw widget))
3830 3840