unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Johannes Maier <johannes.maier@mailbox.org>
Cc: 50228@debbugs.gnu.org
Subject: bug#50228: [PATCH] 'command-completion-using-modes-p' doesn't work with multiple modes
Date: Fri, 27 Aug 2021 17:31:41 +0200	[thread overview]
Message-ID: <877dg6oqea.fsf@gnus.org> (raw)
In-Reply-To: <87pmtzmatt.fsf@mailbox.org> (Johannes Maier's message of "Fri, 27 Aug 2021 12:38:38 +0200")

Johannes Maier <johannes.maier@mailbox.org> writes:

> I've attached a patch that removes the duplicated checks in these two
> functions and simply calls 'command-completion-with-modes-p' from
> 'command-completion-using-modes-p'.  Now it works for me with one or
> more (major or minor) modes in 'interactive'.

Thanks, that does fix the problem.

However, the reason `command-completion-using-modes-p' is coded that way
is that `command-completion-with-modes-p' is slower in the common case,
and completion has to be fast.  But in the multiple-mode case, we can
indeed just call `command-completion-with-modes-p', so I've kept the
common case, but punted to `command-completion-with-modes-p' in the
multiple-mode case, and that seems to fix the issue.

> (I didn't see any tests for those functions, but I'm not sure how to go
> about those yet.  Could probably have look into those, too.)

Yes, there really should be tests in this area...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      reply	other threads:[~2021-08-27 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 10:38 bug#50228: [PATCH] 'command-completion-using-modes-p' doesn't work with multiple modes Johannes Maier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-27 15:31 ` Lars Ingebrigtsen [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=877dg6oqea.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=50228@debbugs.gnu.org \
    --cc=johannes.maier@mailbox.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).