all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: dalanicolai <dalanicolai@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: 43617@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>,
	Andreas Schwab <schwab@linux-m68k.org>
Subject: bug#43617: 27.1; Define-minor-mode keybindings not get precedence over global keymap
Date: Sun, 27 Sep 2020 13:00:51 +0200	[thread overview]
Message-ID: <CACJP=3mZDe-UCCDFSSNA2uOeNsYBVytwva3FrjTkDobym67b1w@mail.gmail.com> (raw)
In-Reply-To: <c1845fe9-d047-462e-9798-c19eb7dab585@default>

[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]

Well it seems quite obvious now that I simply overlooked the fact that
quoting a list results in its elements not getting evaluated. I would argue
that, although there might be no real bug in the doc, the doc still somehow
helped me to overlook this fact. I think backquoting is not very much a
hassle, but it would be nice to get reminded about it for when using the
(kbd ...) construct. Of course if the (kbd "j") would not have worked I
would have been less confused and maybe had found the mistake myself, but
because that one did work it appeared to me to be a bug. Anyway, I think a
simple change/addition in the docstring and/or the examples in section
23.3.3 of the elisp manual could help make things clearer.

On Sat, 26 Sep 2020 at 18:05, Drew Adams <drew.adams@oracle.com> wrote:

> > > The cons ((kbd "C-n") . 'foo) is exactly such a
> > > (KEY . BINDING) pair - both KEY and BINDING are
> > > suitable arguments for `define-key'.
> >
> > Is it?
> >
> > ELISP> (define-key global-map '(kbd "C-n") ''foo)
> > *** Eval error ***  Wrong type argument: arrayp, (kbd "C-n")
>
> I get your point.  I guess maybe there are two ways
> to read the doc string.
>
> The most _useful_ behavior for users, IMO, is for
> `define-minor-mode' to allow expressions in arg
> KEYMAP (when it's such a list) that correspond to
> what a user writes in `(define-key ...)'.
>
> Is that particular list form of KEYMAP intended
> mostly for programmatically supplying such a list,
> or for users to write such a list?
>
> If the former, why is it needed/helpful at all,
> since code can just as easily create a keymap arg.
> If the latter, it gives users an easy way to write
> key bindings directly for `define-minor-mode'.
>
> I hadn't even paid attention to the existence of
> such a form for the KEYMAP arg.  But it looks like
> it could be handy for users to write - IF the sexp
> to write is simple and straightforward.
>
> If users instead need to use backquote syntax or
> jump through other hoops to write such a KEYMAP
> sexp, then what's the point - what's the use case?
>
> Maybe there _is_ a programmatic use case.  If so,
> what is it?
>

[-- Attachment #2: Type: text/html, Size: 2671 bytes --]

      reply	other threads:[~2020-09-27 11:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 18:10 bug#43617: 27.1; Define-minor-mode keybindings not get precedence over global keymap dalanicolai
2020-09-26 14:04 ` Lars Ingebrigtsen
2020-09-26 14:09   ` Lars Ingebrigtsen
2020-09-26 15:25     ` Drew Adams
2020-09-26 15:32       ` Andreas Schwab
2020-09-26 16:04         ` Drew Adams
2020-09-27 11:00           ` dalanicolai [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

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

  git send-email \
    --in-reply-to='CACJP=3mZDe-UCCDFSSNA2uOeNsYBVytwva3FrjTkDobym67b1w@mail.gmail.com' \
    --to=dalanicolai@gmail.com \
    --cc=43617@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=larsi@gnus.org \
    --cc=schwab@linux-m68k.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 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.