]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow `M-u' to work when editing fields in Customize
authorMichał Kondraciuk <k.michal@zoho.com>
Mon, 16 Sep 2019 23:13:08 +0000 (01:13 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 16 Sep 2019 23:13:08 +0000 (01:13 +0200)
* lisp/cus-edit.el (custom-notify): Allow more editing commands to
work in the Customize buffers (bug#31205).

Copyright-paperwork-exempt: yes

lisp/cus-edit.el

index 8a8bad91137104f338b90cf0ffa13d3509962095..2496963337312770443c92d84fe2f910258cd9e6 100644 (file)
@@ -2212,7 +2212,12 @@ and `face'."
     (unless (eq state 'modified)
       (unless (memq state '(nil unknown hidden))
        (widget-put widget :custom-state 'modified))
-      (custom-magic-reset widget)
+      ;; Update the status text (usually from "STANDARD" to "EDITED
+      ;; bla bla" in the buffer after the command has run.  Otherwise
+      ;; commands like `M-u' (that work on a region in the buffer)
+      ;; will upcase the wrong part of the buffer, since more text has
+      ;; been inserted before point.
+      (run-with-idle-timer 0.0 nil #'custom-magic-reset widget)
       (apply 'widget-default-notify widget args))))
 
 (defun custom-redraw (widget)