Tags: patch Before d50c82f3e98e ("Simplify 'help-enable-variable-value-editing' using 'string-edit'"), help-fns-edit-variable would open a buffer in emacs-lisp-mode and would not allow exiting that buffer with an invalid Lisp expression. Restore that functionality by enhancing string-edit to allow choosing a major mode and allow passing a function to validate the buffer contents before returning. In GNU Emacs 30.1.50 (build 8, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2025-04-10 built on igm-qws-u22796a Repository revision: 128bc06bfcc56a35d6b5555cc546faaf0d964df0 Repository branch: emacs-30 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.10 (Green Obsidian) Configured using: 'configure --config-cache --with-x-toolkit=lucid --without-gpm --without-gconf --without-selinux --without-imagemagick --with-modules --with-gif=no --with-cairo --with-rsvg --without-compress-install --with-tree-sitter --with-native-compilation=aot'