From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#11715: 24.1; Error in post-command-hook: wrong-number-of-arguments -read-file-internal Date: Sat, 23 Jun 2012 20:54:55 -0700 Message-ID: <56246C760EDB41158EB315D9A23C05B5@us.oracle.com> References: <0E81BDF53A444380B270F0D1522840B8@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1340510182 807 80.91.229.3 (24 Jun 2012 03:56:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2012 03:56:22 +0000 (UTC) Cc: 11715@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 24 05:56:22 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sidvx-0002Jl-3L for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 05:56:21 +0200 Original-Received: from localhost ([::1]:56641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sidvw-00045F-Vq for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jun 2012 23:56:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sidvu-000458-4F for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2012 23:56:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sidvs-0003M9-4O for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2012 23:56:17 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sidvs-0003M4-19 for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2012 23:56:16 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SidzW-0007Oj-HP for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 00:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jun 2012 04:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11715 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11715-submit@debbugs.gnu.org id=B11715.134051036228366 (code B ref 11715); Sun, 24 Jun 2012 04:00:02 +0000 Original-Received: (at 11715) by debbugs.gnu.org; 24 Jun 2012 03:59:22 +0000 Original-Received: from localhost ([127.0.0.1]:54569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sidyr-0007NT-M3 for submit@debbugs.gnu.org; Sat, 23 Jun 2012 23:59:21 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:18929) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sidyq-0007NM-0E for 11715@debbugs.gnu.org; Sat, 23 Jun 2012 23:59:20 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q5O3tUkx026135 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 24 Jun 2012 03:55:31 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q5O3tTTp005323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Jun 2012 03:55:30 GMT Original-Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q5O3tTQe014928; Sat, 23 Jun 2012 22:55:29 -0500 Original-Received: from dradamslap1 (/10.159.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 23 Jun 2012 20:55:29 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac1RSSBNUApvljMyQXqRmj6t2WvTlwAAhsVgABsaD5A= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61235 Archived-At: I found the problem - in my version of `icomplete-completions' (in `icomplete+.el'). Thanks for your help. FYI - I make these changes to the vanilla version of `icomplete-completions': 1. Prepend the total number of candidates. 2. Sort candidates alphabetically, put them in a different face, and separate them more (2 spaces instead of ","). 3. Highlight the key-binding text. Truncate it if too long. 4. Append the number of remaining cycle candidates (for Icicles). The problem was that when I updated the Emacs 23 code to fit the vanilla Emacs 24 changes I understood things only partially. In particular: I do not use `completion-all-sorted-completions', since I need the number of COMPS and I do not need the sort order that `c-a-s-c' provides. So I do not use LAST or BASE-SIZE. Where I went wrong was replacing this code: (if (and base-size (> base-size 0)) (completion-try-completion name candidates predicate (length name) md) ;; If the COMPS are 0-based, the result should be the same with COMPS. (completion-try-completion name comps nil (length name) md))) Since I do not use BASE-SIZE I tried using just the second `if' clause, without really understanding things. That was the mistake, as I'm sure you can tell. It worked OK when the arg CANDIDATES was an alist, but not when it was a function. I changed the code to just (try-completion name candidates predicate), and it seems to work well now. There is unfortunately no description of any of the arguments in the doc string. Apparently CANDIDATES corresponds to the COLLECTION arg of `completing-read' (is that correct in all respects?). If so, you might consider renaming it COLLECTION. And you might consider documenting the args. Perhaps something like this: NAME is the name to complete. COLLECTION is the collection of candidates to match. See `completing-read' for its possible values. PREDICATE filters matches: they succeed only if it returns non-nil. REQUIRE-MATCH non-nil means the input must match a candidate. (Maybe REQUIRE-MATCH corresponds to REQUIRE-MATCH in `completing-read', but that's not clear to me.) The possibility of arg CANDIDATES being a function is not new in Emacs 24, but in Emacs 23 the Icomplete code was different and I did not run into such an error. (BTW, AFAICT there is nothing in the Emacs 23 NEWS about Icomplete supporting file-name completion.) Anyway, thanks for your help. I will close this bug.