* eshell/em-glob.el (ange-cache):
[bpt/emacs.git] / lisp / wid-edit.el
index fb62b03..b351d89 100644 (file)
@@ -55,6 +55,7 @@
 ;; See `widget.el'.
 
 ;;; Code:
+(require 'cl-lib)
 
 ;;; Compatibility.
 
@@ -221,7 +222,7 @@ minibuffer."
        ((or widget-menu-minibuffer-flag
             (> (length items) widget-menu-max-shortcuts))
         ;; Read the choice of name from the minibuffer.
-        (setq items (widget-remove-if 'stringp items))
+        (setq items (cl-remove-if 'stringp items))
         (let ((val (completing-read (concat title ": ") items nil t)))
           (if (stringp val)
               (let ((try (try-completion val items)))
@@ -295,14 +296,6 @@ minibuffer."
             (error "Canceled"))
           value))))
 
-(defun widget-remove-if (predicate list)
-  (let (result (tail list))
-    (while tail
-      (or (funcall predicate (car tail))
-         (setq result (cons (car tail) result)))
-      (setq tail (cdr tail)))
-    (nreverse result)))
-
 ;;; Widget text specifications.
 ;;
 ;; These functions are for specifying text properties.
@@ -528,6 +521,7 @@ Otherwise, just return the value."
                (or (widget-get widget :value)
                    (progn
                      (when (widget-get widget :args)
+                       (setq widget (widget-copy widget))
                        (let (args)
                          (dolist (arg (widget-get widget :args))
                            (setq args (append args