all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Eshel Yaron <me@eshelyaron.com>
Cc: 73330@debbugs.gnu.org
Subject: bug#73330: 31.0.50; Incorrect completions for 'cond' clauses
Date: Thu, 19 Sep 2024 13:07:13 +0300	[thread overview]
Message-ID: <86wmj87y9a.fsf@gnu.org> (raw)
In-Reply-To: <m1ikut87gd.fsf@dazzs-mbp.home> (bug-gnu-emacs@gnu.org)

> 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" <bug-gnu-emacs@gnu.org>
> 
> 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 "\\_<let\\*?\\_>"))))
+                                      (looking-at
+                                       "\\_<\\(let\\|cond\\|bind\\*\\)\\*?\\_>"))))
                         (list t (elisp--completion-local-symbols)
                               :predicate #'elisp--shorthand-aware-boundp
                               :company-kind (lambda (_) 'variable)





  reply	other threads:[~2024-09-19 10:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 12:36 bug#73330: 31.0.50; Incorrect completions for 'cond' clauses Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-19 10:07 ` Eli Zaretskii [this message]
2024-09-19 12:25   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-19 13:15     ` Eli Zaretskii
2024-09-19 14:33       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-19 14:33       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-19 16:38         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86wmj87y9a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=73330@debbugs.gnu.org \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.