unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Campbell Barton <ideasman42@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [nongnu] elpa/meow 9860a7a218: Correct unused lexical variable (#411)
Date: Fri, 10 Mar 2023 14:43:06 -0500	[thread overview]
Message-ID: <jwv1qlwe6mz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <jwv7cvoe6t9.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 10 Mar 2023 14:40:37 -0500")

> Hmm... that doesn't look right: `format-kbd-macro` is like
> `key-description`, i.e. it returns a human-readable version of a key
> sequence.  That is (more or less) the format understood by `kbd` (and
> `key-parse`) but is not the format accepted by `key-binding`, which
> expects an actual vector of events (which can degenerate to a string if
> the events are simple enough).

BTW, here's a related patch I've had pending for a while.


        Stefan


diff --git a/meow-command.el b/meow-command.el
index 13602c6ffd..d19cb39217 100644
--- a/meow-command.el
+++ b/meow-command.el
@@ -1178,7 +1178,8 @@ with UNIVERSAL ARGUMENT, search both side."
 (defun meow-search (arg)
   " Search and select with the car of current `regexp-search-ring'.
 
-If the contents of selection doesn't match the regexp, will push it to `regexp-search-ring' before searching.
+If the contents of selection doesn't match the regexp, will push it to
+`regexp-search-ring' before searching.
 
 To search backward, use \\[negative-argument]."
   (interactive "P")
@@ -1632,24 +1633,26 @@ This command is a replacement for built-in `kmacro-end-macro'."
      (setq mouse-secondary-start next-marker)
      (meow--cancel-selection))))
 
-(defun meow-describe-key (key-list &optional buffer up-event)
+(defun meow-describe-key (key-list &rest args)
   (interactive (list (help--read-key-sequence)))
-  (if (= 1 (length key-list))
-      (let* ((key (format-kbd-macro (cdar key-list)))
-             (cmd (key-binding key)))
-        (if-let ((dispatch (and (commandp cmd)
-                                (get cmd 'meow-dispatch))))
-            (describe-key (kbd dispatch) buffer up-event)
-          (describe-key key-list buffer up-event)))
-    ;; for mouse events
-    (describe-key key-list buffer up-event)))
+  (apply #'describe-key
+         (if (= 1 (length key-list))
+             (let* (;; (key (format-kbd-macro (cdar key-list)))
+                    (cmd (key-binding (cdar key-list))))
+               (if-let ((dispatch (and (commandp cmd)
+                                       (get cmd 'meow-dispatch))))
+                   (kbd dispatch)
+                 key-list))
+           ;; for mouse events
+           key-list)
+         args))
 
 ;; aliases
-(defalias 'meow-backward-delete 'meow-backspace)
-(defalias 'meow-c-d 'meow-C-d)
-(defalias 'meow-c-k 'meow-C-k)
-(defalias 'meow-delete 'meow-C-d)
-(defalias 'meow-cancel 'meow-cancel-selection)
+(defalias 'meow-backward-delete #'meow-backspace)
+(defalias 'meow-c-d #'meow-C-d)
+(defalias 'meow-c-k #'meow-C-k)
+(defalias 'meow-delete #'meow-C-d)
+(defalias 'meow-cancel #'meow-cancel-selection)
 
 ;; removed commands
 




      reply	other threads:[~2023-03-10 19:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <167841008488.32504.7948735471580268728@vcs2.savannah.gnu.org>
     [not found] ` <20230310010125.5A435C13A88@vcs2.savannah.gnu.org>
2023-03-10 19:40   ` [nongnu] elpa/meow 9860a7a218: Correct unused lexical variable (#411) Stefan Monnier
2023-03-10 19:43     ` Stefan Monnier [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=jwv1qlwe6mz.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=ideasman42@gmail.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 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).