From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Inner workings of `pcomplete' Date: Thu, 09 Feb 2012 16:44:47 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1328823905 26746 80.91.229.3 (9 Feb 2012 21:45:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2012 21:45:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Oleksandr Manzyuk Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 09 22:45: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 1RvbnY-00081e-O0 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Feb 2012 22:45:00 +0100 Original-Received: from localhost ([::1]:52233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvbnV-0007py-84 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Feb 2012 16:44:57 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:58654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvbnQ-0007pm-GY for help-gnu-emacs@gnu.org; Thu, 09 Feb 2012 16:44:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvbnO-00057Q-D6 for help-gnu-emacs@gnu.org; Thu, 09 Feb 2012 16:44:52 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:45390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvbnO-00057D-4W for help-gnu-emacs@gnu.org; Thu, 09 Feb 2012 16:44:50 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q19LimJV007687; Thu, 9 Feb 2012 16:44:48 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id EDA6C130009; Thu, 9 Feb 2012 16:44:47 -0500 (EST) In-Reply-To: (Oleksandr Manzyuk's message of "Thu, 9 Feb 2012 01:02:51 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4127=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4127> : streams <727185> : uri <1062787> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:83680 Archived-At: > Huh, indeed. Then I rephrase my question: > `pcomplete-completions-at-point' can return non-nil even when there > are no completions, Indeed. What it means is that pcomplete takes responsibility for the completion at point, including saying "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. The completion code performs completion in several steps. The first is "what field am I on", where the answer is "a field from BEG..END that contains elements of type FOO". If you want to say "I'm not sure which type it is, could be FOO or BAR", you'll have to do that explicitly: there's no automatic fallback along the lines of "he said it's a field of FOOs, but there's no matching FOO so we'll see if someone else has another opinion". Maybe your problem is pcomplete-default-completion-function, which by default always assumes responsibility for completion. E.g. in shell.el we set it via (set (make-local-variable 'pcomplete-default-completion-function) #'ignore) -- Stefan