unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 30309@debbugs.gnu.org, Noam Postavsky <npostavs@users.sourceforge.net>
Subject: bug#30309: Surprising behaviour of insert-kbd-macro
Date: Tue, 16 Apr 2019 09:47:34 +0200	[thread overview]
Message-ID: <m2o9564cix.fsf@gmail.com> (raw)
In-Reply-To: <87pnpmztl4.fsf@gmail.com> (Noam Postavsky's message of "Mon, 15 Apr 2019 20:23:19 -0400")

>>>>> On Mon, 15 Apr 2019 20:23:19 -0400, Noam Postavsky <npostavs@gmail.com> said:

    Noam> Robert Pluim <rpluim@gmail.com> writes:
    >> That would work as well. Something like this (utterly untested
    >> beyond 'insert-kbd-macro'):

    >> DEFUN ("where-is-internal", Fwhere_is_internal,
    >> Swhere_is_internal, 1, 5, 0, doc: /* Return list of keys that
    >> invoke DEFINITION.  +If DEFINITION is nil, return nil.

    >> + if (NILP (definition)) + return Qnil; +

    Noam> Hmm, on the one hand no keys invoke 'nil', so returning nil
    Noam> in that situation is already covered by the current
    Noam> docstring (and doing something else could be considered a
    Noam> plain bug).  On the other hand, I see it returns keys for
    Noam> which (define-key global-map KEY nil) was called, which is
    Noam> potentially useful.  I don't know if anything uses that, but
    Noam> I hesitate to remove the capability.

I donʼt know either, so best leave it alone.

    Noam> By the way, I noticed the diff below also fixes this bug,
    Noam> although I don't quite understand why.

That results in

    (setq last-kbd-macro
       nil)
    (global-set-key [S-down-mouse-1] 'last-kbd-macro)
    (global-set-key [horizontal-scroll-bar drag-mouse-1] 'last-kbd-macro)
    (global-set-key [horizontal-scroll-bar mouse-1] 'last-kbd-macro)
    (global-set-key [vertical-scroll-bar drag-mouse-1] 'last-kbd-macro)
    (global-set-key [vertical-scroll-bar mouse-1] 'last-kbd-macro)

which I guess is better, but not perfect.

Robert





  reply	other threads:[~2019-04-16  7:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 16:26 bug#30309: Surprising behaviour of insert-kbd-macro Robert Pluim
2018-02-06  1:02 ` Noam Postavsky
2018-11-30  8:36   ` Robert Pluim
2019-03-29 14:16     ` Noam Postavsky
2019-03-29 15:06       ` Robert Pluim
2019-04-16  0:23         ` Noam Postavsky
2019-04-16  7:47           ` Robert Pluim [this message]
2022-01-23 15:48 ` bug#30309: C-u M-x insert-kbd-macro RET RET inserts many unrelated "bindings" (menu separators?) Lars Ingebrigtsen

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=m2o9564cix.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=30309@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    --cc=npostavs@users.sourceforge.net \
    /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).