From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#16274: 24.3.50; Error in post-command-hook (icomplete-post-command-hook): (invalid-function ("..." ...)) Date: Wed, 01 Nov 2017 21:02:00 +0100 Message-ID: References: <0d02f1f6-f984-4da4-b077-43408a24c046@default> <26aaf609-dcdc-4585-ae7e-55e7f7025947@default> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1509566490 12780 195.159.176.226 (1 Nov 2017 20:01:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Nov 2017 20:01:30 +0000 (UTC) Cc: 16274@debbugs.gnu.org, monnier@iro.umontreal.ca To: charles@aurox.ch (Charles A. Roelli) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 01 21:01:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9zCJ-0001Kp-4J for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Nov 2017 21:01:11 +0100 Original-Received: from localhost ([::1]:57521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9zCN-0005I0-54 for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Nov 2017 16:01:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9zCF-0005Ga-B1 for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 16:01:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9zCC-0008Av-6A for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 16:01:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37771) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e9zCB-0008Ah-TO for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 16:01:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e9zCB-0008Vw-Io for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 16:01:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Nov 2017 20:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 16274-submit@debbugs.gnu.org id=B16274.150956644532694 (code B ref 16274); Wed, 01 Nov 2017 20:01:02 +0000 Original-Received: (at 16274) by debbugs.gnu.org; 1 Nov 2017 20:00:45 +0000 Original-Received: from localhost ([127.0.0.1]:46452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9zBs-0008VG-U0 for submit@debbugs.gnu.org; Wed, 01 Nov 2017 16:00:45 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:36670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9zBq-0008V0-U3 for 16274@debbugs.gnu.org; Wed, 01 Nov 2017 16:00:43 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 9F6402259D for <16274@debbugs.gnu.org>; Wed, 1 Nov 2017 19:53:39 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1509566016; x=1510430017; bh=bdNHKR4/iOIrn wBQBHGHpdwHXi0xM8V09nqgmIvyUwc=; b=KBUkpp0EG/XIZh2fgfiJoEo5v5fB+ tlAEZMPCmsO6vUxRG1YBxbKTpQni/4L4QoTBjm5zkR1ewVK1xF2m/vcTW25+76EW XBBmfYuzpv1aQzWhvrGSvPf2vrPOOSRpwum3JQSStPg7M1QOttsxoyjulhWy+kMB 9KPYdmtQPDrdhs= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id xRtu62UbLwkh for <16274@debbugs.gnu.org>; Wed, 1 Nov 2017 19:53:36 +0000 (UTC) Original-Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 345252259C; Wed, 1 Nov 2017 19:53:36 +0000 (UTC) In-reply-to: (charles@aurox.ch) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:139332 Archived-At: Ping! I hope to fix this for emacs-26 if it's possible. It also solves Bug#28898. > Date: Sun, 22 Oct 2017 17:06:35 +0200 > From: charles@aurox.ch (Charles A. Roelli) > > > From: Stefan Monnier > > Date: Fri, 03 Jan 2014 23:51:48 -0500 > > > > > So far, my best guess is still that in > > > (completion-try-completion name comps nil (length name) md) > > > the list COMPS is for some reason being treated as a function (the > > > second argument can of course be either). > > > > Oh, you mean that the error could come from the fact that `md' goes with > > `candidates', so some code might assume that the completion table is > > a function based on the `md' data, whereas we passed `comps' which is > > a list of strings? > > > > Hmm... that sounds plausible. > > This seems to be the mistake. If you pass nil instead of `md' (as in > the patch below), then there's no more problem. > > diff --git a/lisp/icomplete.el b/lisp/icomplete.el > index 038f58f..38be657 100644 > --- a/lisp/icomplete.el > +++ b/lisp/icomplete.el > @@ -395,7 +395,7 @@ icomplete-completions > ;; If the `comps' are 0-based, the result should be > ;; the same with `comps'. > (completion-try-completion > - name comps nil (length name) md))) > + name comps nil (length name) nil))) > (most (if (consp most-try) (car most-try) > (if most-try (car comps) ""))) > ;; Compare name and most, so we can determine if name is > > Alternatively, this part of `completion--nth-completion' could be > updated to respond to `completio--unquote-requote' in the completion > metadata when `table' is not a function: > > (when (completion-metadata-get metadata 'completion--unquote-requote) > (cl-assert (functionp table)) > (let ((new (funcall table string point 'completion--unquote))) > > (No idea if that would make sense.) > > I was using this recipe for testing: > > > Date: Fri, 30 Jan 2015 14:25:04 +0000 > > From: Jeremy Moore > > > > Hi folks, > > > > I get a similar error by following this sequence in 24.4.1: > > 1. emacs -Q > > 2. M-x icomplete-mode > > 3. M-x set-variable icomplete-show-matches-on-no-input t > > 4. C-x C-f C-a C-k > > > > Version and settings are below. > > > > Regards, > > Jeremy > > > > In GNU Emacs 24.4.1 (i686-pc-mingw32) > > of 2014-10-24 on LEG570 > > Windowing system distributor `Microsoft Corp.', version 6.1.7601 > > Configured using: > > `configure --prefix=/c/usr'