From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#73880: Master: emacs-lisp-mode: Tab completion for a function position fails in a `let' form. Date: Mon, 28 Oct 2024 12:12:25 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28252"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 73880@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 28 13:13:51 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t5Od5-0007DU-8y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Oct 2024 13:13:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5Ocj-0000jH-P0; Mon, 28 Oct 2024 08:13:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t5Ocg-0000j7-Rl for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 08:13:27 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t5Ocg-0002Eq-Hf for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 08:13:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:In-Reply-To:MIME-Version:References:Date:To:Subject; bh=/ha/hzN0GGvgS962nykM4Tlp4AVnO0v0emY9YPOzqUU=; b=tv8dNevMgO4sEElIB037Merw9oEyC5M/fZXs2THzL/FjFJTKsbK1D1U/ZNKkHPuzDKnAH1pk2IfrAEFgpIZnej6xqTvAMwpP70TDRc7WnKoekP5SdY7Ezm2dH3pADAXL5Oy4+xGWQ5pyO+Edb8hsCCgtmzoQ4nAtP0HFr4CoQXgt9B+EqvpM7B41kejj9Zq19XlETffXCqSblUPvii73BXX5+UJ2TDpW3OTLnUfapiV6kfoU8lrNOC6fcc0EBOumqMkQANCq0lmEUNKXUUt2ttVBnVAI+qhacRqG4rqDFgr7WiFW1vAWOvOCLsQTGzrsquck7ij3Z2y98zM8KsJ5Zg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5OdG-00054X-IF for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Oct 2024 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73880 X-GNU-PR-Package: emacs Original-Received: via spool by 73880-submit@debbugs.gnu.org id=B73880.173011759219420 (code B ref 73880); Mon, 28 Oct 2024 12:14:02 +0000 Original-Received: (at 73880) by debbugs.gnu.org; 28 Oct 2024 12:13:12 +0000 Original-Received: from localhost ([127.0.0.1]:52818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5OcS-00053A-9V for submit@debbugs.gnu.org; Mon, 28 Oct 2024 08:13:12 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:15202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5OcP-00052t-Vd for 73880@debbugs.gnu.org; Mon, 28 Oct 2024 08:13:10 -0400 Original-Received: (qmail 28464 invoked by uid 3782); 28 Oct 2024 13:12:26 +0100 Original-Received: from muc.de (p4fe15284.dip0.t-ipconnect.de [79.225.82.132]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 28 Oct 2024 13:12:26 +0100 Original-Received: (qmail 17060 invoked by uid 1000); 28 Oct 2024 12:12:25 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294418 Archived-At: Hello, Dmitry. On Sun, Oct 27, 2024 at 03:44:46 +0200, Dmitry Gutov wrote: > Hi Alan, > On 26/10/2024 17:35, Alan Mackenzie wrote: > > I haven't tried it out your patch yet, but surely it will fail when there > > are comments in the `let' form. For that matter, forward-symbol doesn't > > handle comments, either. > I think it's only relevant if there's a comment between 'let' and the > var-bindings form ('()' in our example), which must happen very rarely, > if at all (since it requires moving the form to the next line). Any > comments inside the var-bindings form won't get in our way, and any > comment after it would just make the check fail, which seems good for > our scenario. Yes. I should have tried it out first before replying. As you say, comments inside the empty binding list or between binding list and first form don't prevent your patch from working. > If skipping over comments really was needed, we could try > (forward-comment -1) > (skip-syntax-backward " >w_") > But probably not. Indeed not! > >> This satisfies the test, at least. > > OK. > > I've just looked at another form which doesn't work optimally, namely: > > `(let (match-b > > .. Here a M-TAB ought to signal "No match", but instead offers the two > > functions. If the backquote is removed, it works as it should. > This seems to be as designed: since the form is quoted, we can't be > certain whether the symbol in function position is in fact a function, > or whether it will be processed some other way - not necessarily > evaluated. So we accept all kinds of known symbols. > Perhaps this could be improved, but at least that's the original intent. OK, I can understand that. For `(let and `(let*, it seems it's almost always going to be a form being generated in a macro. But if we were to special-case those, there are other symbols we could special-case too, and before long the function would be unmaintainably complicated, for relatively little gain. So I'll withdraw my complaint about `(let (match-b. I think your patch is better than my suggested fix, since it's much shorter and does the job. I would be happy if you committed it and closed the bug. Thanks! [ .... ] -- Alan Mackenzie (Nuremberg, Germany).