From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Manzyuk Newsgroups: gmane.emacs.help Subject: Re: Inner workings of `pcomplete' Date: Thu, 9 Feb 2012 01:02:51 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1328749385 14040 80.91.229.3 (9 Feb 2012 01:03:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2012 01:03:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 09 02:03:04 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RvIPd-0004VF-Py for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Feb 2012 02:03:02 +0100 Original-Received: from localhost ([::1]:55913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvIPb-00058N-RW for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Feb 2012 20:02:59 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvIPW-00058F-V4 for help-gnu-emacs@gnu.org; Wed, 08 Feb 2012 20:02:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvIPV-0001kC-FV for help-gnu-emacs@gnu.org; Wed, 08 Feb 2012 20:02:54 -0500 Original-Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:37665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvIPV-0001k2-5A for help-gnu-emacs@gnu.org; Wed, 08 Feb 2012 20:02:53 -0500 Original-Received: by lamf4 with SMTP id f4so1265970lam.0 for ; Wed, 08 Feb 2012 17:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=AVV4SLBk/8VRXsqW2lZorRAQ2jFKWfBAPDStj5e0+Uk=; b=DX4RnGTsHc8unGkhtvjfwWASryVkjfi1HnVW/ZlwKrFC9OLtRz22ewKM0akcl8n5fa +V0FDf8PGL81Kmlx5npox7uOvIMyw9I/3gYj4DcJCi96W4vRXxt9DOh1fqRue8enc9nv 8hLnPnu6g18TJ0LSSbLCg0O7tmSJnphrETF94= Original-Received: by 10.112.87.234 with SMTP id bb10mr7918676lbb.33.1328749371537; Wed, 08 Feb 2012 17:02:51 -0800 (PST) Original-Received: by 10.152.21.97 with HTTP; Wed, 8 Feb 2012 17:02:51 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83679 Archived-At: On Wed, Feb 8, 2012 at 3:33 AM, Stefan Monnier w= rote: >> 1. emacs -Q >> 2. M-: (boundp 'pcomplete-stub) RET =3D=3D> nil >> 3. M-x shell >> 4. M-: (boundp 'pcomplete-stub) RET =3D=3D> t >> 5. M-: (special-variable-p 'pcomplete-stub) RET =3D=3D> nil >> 6. Open the file `pcomplete.el' (for example, by looking up the variable >> `pcomplete-stub') and M-x eval-buffer. =C2=A0Now (special-variable-p >> 'pcomplete-stub) evaluates to t. > >> What is going on here? > > Duh! =C2=A0Thanks for catching this. =C2=A0Please M-x report-emacs-bug! Done. >> prompt and M-: (pcomplete-completions)). =C2=A0However, it is also passe= d 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 --=20 Oleksandr Manzyuk http://oleksandrmanzyuk.wordpress.com