bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54161: [External] : bug#54161: 27.2; `define-minor-mode' with alist


From: Drew Adams
Subject: bug#54161: [External] : bug#54161: 27.2; `define-minor-mode' with alist of key bindings
Date: Tue, 1 Mar 2022 18:11:52 +0000

> I think the small source of confusion is whether these arguments are
> evaluated.  

Yes, exactly.

> How about making that clearer, e.g.

That helps quite a bit, yes.

It kind of relies on a careful reading - the only
difference is that you've added "values" in "where
KEY and BINDING are suitable values for `define-key'."
                             ^^^^^^
But that's probably enough.  I had suggested this:

 > An example in the doc would help, along with
 > speaking of something "acceptable to `define-key'
 > as an arg - something such as what `kbd returns."  
___

The other problem reported in this bug is that an
(unquoted) `(kbd ">")' does NOT raise an error
(unlike, say, `(kbd "C->")').

Neither I nor Gilles understands why no error is
raised in the case of unquoted `(kbd ">")'.  And it
was that that introduced confusion in the case at
hand.  The user had written this:

(define-minor-mode narrative-mode
  "..."
  :lighter " narr"
  :keymap
  '(((kbd "<") . electric-left-angle)  ; <== No error
    ((kbd ">") . electric-right-angle) ; <== No error
    ((kbd "C-<") . quoted-insert-left-angle-bracket)
    ((kbd "C->") . quoted-insert-right-angle-bracket)))

https://emacs.stackexchange.com/q/70714/105

The fact that no error is raised for the first
two of those bindings led to mistakenly thinking
that there was something wrong with the latter
two `kbd' sexps, rather than seeing that the
problem was not evaluating any of the `kbd' sexps.

I would have liked to get some explanation of
this in this bug thread.  Plus a fix for the
behavior in the case of the first two bindings,
if that behavior is in fact bugged.

Alas, no consideration of this problem at all
(whether it represents an Emacs behavior bug or
just our lack of understanding).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]