From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73330: 31.0.50; Incorrect completions for 'cond' clauses Date: Thu, 19 Sep 2024 13:07:13 +0300 Message-ID: <86wmj87y9a.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="879"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73330@debbugs.gnu.org To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 19 12:08:03 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 1srE4w-000AZb-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Sep 2024 12:08:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srE4g-00085j-Nf; Thu, 19 Sep 2024 06:07:46 -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 1srE4f-0007zP-1u for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 06:07:45 -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 1srE4e-0002pa-OM for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 06:07:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=8+RygcT3GXjxfUXdaUlOCfsXRKhbMB5cF9Ph4pEL0DQ=; b=gJZVZBIrUYdZISqrGPbwuNsm3h161b7zT4gpe0tOFUfJlsqJRF6n8GqFjTcAF0vNoyH57pDsOlmWCSQ12DQyxEIRg1VmKN1HGMJvPtLWI2Olkvv0DGeaEcwPI3q9cPHMUi2zf38+3nTJ/bjGTOYOiipchWn11wF8Loj1p+ufpJsnPkxjLeXD8m4hs1EhgJDZUG4mzugzs/C+UW1qgOtIVGHs5+0OHV1BF5W43KFyERm8jMP4DXZuM7IVP8AiZxpztqUEIyVDaGW95LQfA14QqpxmUgybvQF4G7NLUDR17pIMS/eJEyE+Cwran5IeBe1kj9hoHmDJS2wLv9LsbhNZxw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srE4v-0004jb-Uw for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 06:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Sep 2024 10:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73330 X-GNU-PR-Package: emacs Original-Received: via spool by 73330-submit@debbugs.gnu.org id=B73330.172674046218165 (code B ref 73330); Thu, 19 Sep 2024 10:08:01 +0000 Original-Received: (at 73330) by debbugs.gnu.org; 19 Sep 2024 10:07:42 +0000 Original-Received: from localhost ([127.0.0.1]:59866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srE4b-0004iv-Qj for submit@debbugs.gnu.org; Thu, 19 Sep 2024 06:07:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srE4a-0004ig-82 for 73330@debbugs.gnu.org; Thu, 19 Sep 2024 06:07:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srE4D-0002fb-Dz; Thu, 19 Sep 2024 06:07:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=8+RygcT3GXjxfUXdaUlOCfsXRKhbMB5cF9Ph4pEL0DQ=; b=GlEjBBy/vJRM qreRX0lOyhAN9aPjcyOVxp/BY/EBr+uwXeY1bey7CuyFTetVyfWaWhWZKFsZ4VVnpn184EIdO64/B dMlWjR7lMS7VxA/bPIImbRlDWxXxeDUb3LAxhIrURsDAauebrTZiWaugjrHhBzfvoP0/j7zIIVWlQ fPM7pUlULsrrixaRnlUo7UaPvnspyLoR5ZfvV67jzgcFDhwTqwcxy8G/HI0EC+vUDmhWkU/shB1WE c+yI5q5CUXwBQVPcPn0V7xJLwo27MBebpCaXgnr9tON1vlIc+pt3Qb1ursefiTZsh2ZvDph/m2YwL TmvfucntDdNGJEMdDi1G6A==; In-Reply-To: (bug-gnu-emacs@gnu.org) 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:292041 Archived-At: > Date: Wed, 18 Sep 2024 14:36:18 +0200 > From: Eshel Yaron via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > 1. emacs -Q > 2. Insert "(cond (current-p > 3. Hit M-TAB to complete > > We're completing a symbol in the condition of a cond clause, so it is > expected to be completed as a variable, to current-prefix-argument. > However, Emacs mistakenly thinks that we're completing a function name, > and completes to current-bidi-paragraph-direction. Thanks. Does the patch below give good results? diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 9bf6f92..2471296 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -784,13 +784,14 @@ elisp-completion-at-point (list t (elisp--completion-local-symbols) :predicate (lambda (sym) (get sym 'error-conditions)))) - ((and (or ?\( 'let 'let*) + ((and (or ?\( 'let 'let* 'cond 'cond* 'bind*) (guard (save-excursion (goto-char (1- beg)) (when (eq parent ?\() (up-list -1)) (forward-symbol -1) - (looking-at "\\_")))) + (looking-at + "\\_<\\(let\\|cond\\|bind\\*\\)\\*?\\_>")))) (list t (elisp--completion-local-symbols) :predicate #'elisp--shorthand-aware-boundp :company-kind (lambda (_) 'variable)