]> git.eshelyaron.com Git - emacs.git/commitdiff
pcomplete-parse-arguments: Fix last change
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 7 Jun 2022 22:08:22 +0000 (01:08 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 7 Jun 2022 22:08:22 +0000 (01:08 +0300)
* lisp/pcomplete.el (pcomplete-parse-arguments):
Throw the previous value of 'pcomplete-stub' (a list) rather than
the newly constructed one (bug#50470).

lisp/pcomplete.el

index 3393c322e305373d4cf149d017b93f1eab2fd996..15b9880df853d656e790c40b38b570de7618e3c4 100644 (file)
@@ -806,7 +806,7 @@ this is `comint-dynamic-complete-functions'."
             ;; completions computed during parsing, e.g. Eshell uses
             ;; that to turn globs into lists of completions.
            (if (not pcomplete-allow-modifications)
-               (progn
+               (let ((completions pcomplete-stub))
                  ;; FIXME: The mapping from what's in the buffer to the list
                   ;; of completions can be arbitrary and will often fail to be
                   ;; understood by the completion style.  See bug#50470.
@@ -816,7 +816,7 @@ this is `comint-dynamic-complete-functions'."
                   ;; "~/Down*" completion pattern since the completion
                   ;; is neither told that it's a file nor a global pattern.
                  (setq pcomplete-stub (buffer-substring begin (point)))
-                  (throw 'pcomplete-completions pcomplete-stub))
+                  (throw 'pcomplete-completions completions))
              (let* ((completions pcomplete-stub)
                     (common-prefix (try-completion "" completions))
                     (len (length common-prefix)))