bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60464: 29.0.60; Regression - pcomplete-arg fails with argument 'last


From: Gregory Heytings
Subject: bug#60464: 29.0.60; Regression - pcomplete-arg fails with argument 'last
Date: Wed, 04 Jan 2023 13:48:25 +0000


Jim, can you also try the patch and report if you see regressions?

Thanks. I tried this out for a bit, and I haven't been able to break it yet (although I didn't notice the issue that spawned this bug# the last time either, so it's possible I'm missing some problem this time around, too).


Thanks for your confirmation.

Stefan, do you agree with the attached patch? Or would you like something else?

Eli, are you okay with that patch?

The difference between the code before dafa6d6bad and the code with this patch applied can be summarized as follows:

 (defun pcomplete-arg (&optional index offset)
   (let ((arg
          (nth (+ (pcase index
                   ('first 0)
                   ('last  pcomplete-last)
                   (_      (- pcomplete-index (or index 0))))
                 (or offset 0))
               pcomplete-args)))
-    arg
+    (if (or (stringp arg)
+            (eq index 'last))
+        arg
+      (propertize
+       (car (split-string (pcomplete-actual-arg index offset)))
+       'pcomplete-arg-value arg))))

IOW, instead of unconditionally returning arg, we now sometimes (when arg is not already a string and when index is not last) return the textual representation of that argument (what the user typed in) with the value of arg attached to it.

Attachment: Further-improvement-for-non-string-values-in-pcomple.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]