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

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

Re: Inner workings of `pcomplete'


From: Oleksandr Manzyuk
Subject: Re: Inner workings of `pcomplete'
Date: Thu, 9 Feb 2012 01:02:51 +0000

On Wed, Feb 8, 2012 at 3:33 AM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> 1. emacs -Q
>> 2. M-: (boundp 'pcomplete-stub) RET ==> nil
>> 3. M-x shell
>> 4. M-: (boundp 'pcomplete-stub) RET ==> t
>> 5. M-: (special-variable-p 'pcomplete-stub) RET ==> nil
>> 6. Open the file `pcomplete.el' (for example, by looking up the variable
>> `pcomplete-stub') and M-x eval-buffer.  Now (special-variable-p
>> 'pcomplete-stub) evaluates to t.
>
>> What is going on here?
>
> Duh!  Thanks for catching this.  Please M-x report-emacs-bug!

Done.

>> prompt and M-: (pcomplete-completions)).  However, it is also passed as
>> a table argument to the function `complete-with-action', whose
>> documentation says that this argument should not be a function.
>
> The docstring is wrong, as the first line of the code indicates ;-)

Huh, indeed.  Then I rephrase my question:
`pcomplete-completions-at-point' can return non-nil even when there
are no completions, which is easy to test: in a shell buffer, I type,
say, 5, and hit TAB.  Assuming that there are no files in the current
directory starting with 5, there will be no matches.  However, if I
evaluate (pcomplete-completions-at-point), I get some hairy data
structure.  This means, in particular, that the functions in
`comint-dynamic-complete-functions' that appear after the function
`pcomplete-completions-at-point' are not tried.  Is there a way around
this?  The identifier completion that I'm experimenting with logically
happens after completions for arguments of the interpreter commands
have been tried (if I put the function responsible for the identifier
completion, I get the identifier completion, but lose completion for
arguments of commands, and I'd love to have both).

Best,
Sasha
-- 
Oleksandr Manzyuk
http://oleksandrmanzyuk.wordpress.com



reply via email to

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