]> git.eshelyaron.com Git - emacs.git/commit
Make State button interaction less confusing
authorMauro Aranda <maurooaranda@gmail.com>
Thu, 22 Oct 2020 14:55:03 +0000 (16:55 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 22 Oct 2020 14:55:19 +0000 (16:55 +0200)
commit8dffe61a9c461506311027c99374246440bd97fe
treec579809b7a1c8dbf8887e5cb01133e53b01e2dec
parentd5fdb1b1f6335da2a1dd60430b7521910dacab68
Make State button interaction less confusing

* lisp/cus-edit.el (custom-variable-current-value): New function.
(custom-variable-backup-value): Use it.
(custom-variable-set, custom-variable-mark-to-reset-standard): Check
that old value is different than the new one.  If it is, make a
backup.  This way, we avoid offering the Set to Backup Value
unnecesarily.
(custom-variable-reset-saved): Reset the variable-comment property for
the variable, to help custom-variable-state be more correct.  Also
check if we should backup old value.
(custom-variable-state): If a variable was set to the standard value,
say its state is standard rather than set, which is more correct.
Getting the right variable state is important for menu options to be
enabled/disabled, and for displaying the right message to the user
(bug#12864).
lisp/cus-edit.el