Subject: bug#10457: (Broken?) programmable completion in shell buffers

From: Oleksandr Manzyuk <[email-masked]>
Date: Mon, 9 Jan 2012 17:41:38 +0000

In `pcomplete/tar', the call to `pcomplete-opt' happens inside a
(while (pcomplete-match "^-" 0) ...) loop.  Here is a minimal example
that has the same problem as `pcomplete/tar':

(defun pcomplete/shell-mode/foo ()
  (while (pcomplete-match "^-" 0)
    (pcomplete-opt "hv")))

Start emacs with -Q flag, evaluate the above code in the *scratch*
buffer, start a shell, type "foo -", hit TAB.  A completions buffer
showing two completions "-h" and "-v" should pop up.  Press SPC --
voila, Emacs is locked.

Sasha

-- 
Oleksandr Manzyuk
http://oleksandrmanzyuk.wordpress.com