]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid error with empty search string in Customize
authorMauro Aranda <maurooaranda@gmail.com>
Tue, 21 Jan 2025 00:16:48 +0000 (21:16 -0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 25 Jan 2025 17:48:47 +0000 (18:48 +0100)
* lisp/cus-edit.el (custom-buffer-create-internal): Only call
customize-apropos if the string is not empty.  (Bug#75714)

(cherry picked from commit d4ca688abefa90cf3e54add036b32c06b7da6363)

lisp/cus-edit.el

index 8b9a101cecd3bdb9d1312ff8b9cb21fde9e7bcfe..ee0e9a53f1b82a39dc4d59251c5278cb0dceefe9 100644 (file)
@@ -1830,14 +1830,17 @@ or a regular expression.")
               'editable-field
               :size 40 :help-echo echo
               :action (lambda (widget &optional _event)
-                         (customize-apropos (split-string (widget-value widget)))))))
+                         (let ((value (widget-value widget)))
+                           (if (string= value "")
+                               (message "Empty search field")
+                             (customize-apropos (split-string value))))))))
        (widget-insert " ")
        (widget-create-child-and-convert
         search-widget 'push-button
         :tag " Search "
         :help-echo echo :action
         (lambda (widget &optional _event)
-          (customize-apropos (split-string (widget-value (widget-get widget :parent))))))
+           (widget-apply (widget-get widget :parent) :action)))
        (widget-insert "\n")))
 
     ;; The custom command buttons are also in the toolbar, so for a