unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* repeat-mode: Setting `repeat-map' property to a keymap object fails
@ 2021-11-24 20:39 Narendra Joshi
  2021-11-25  7:59 ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Narendra Joshi @ 2021-11-24 20:39 UTC (permalink / raw)
  To: emacs-devel


Hi,

I tried to use a `keymap' object as the value of the `repeat-map'
property of a symbol/command and it failed. I think the change below
would avoid the problem. The problem is that `boundp` throws an error
for anything other than a symbol value.

--8<---------------cut here---------------start------------->8---
---
 lisp/repeat.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/repeat.el b/lisp/repeat.el
index 4dcd353e34..32ffb1884f 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -416,7 +416,7 @@ repeat-post-hook
                          (and (symbolp real-this-command)
                               (get real-this-command 'repeat-map)))))
         (when rep-map
-          (when (boundp rep-map)
+          (when (and (symbolp rep-map) (boundp rep-map))
             (setq rep-map (symbol-value rep-map)))
           (let ((map (copy-keymap rep-map)))
 
-- 
2.33.1
--8<---------------cut here---------------end--------------->8---


Best,
-- 
Narendra Joshi




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: repeat-mode: Setting `repeat-map' property to a keymap object fails
  2021-11-24 20:39 repeat-mode: Setting `repeat-map' property to a keymap object fails Narendra Joshi
@ 2021-11-25  7:59 ` Juri Linkov
  2021-11-25 18:09   ` Narendra Joshi
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2021-11-25  7:59 UTC (permalink / raw)
  To: Narendra Joshi; +Cc: emacs-devel

> I tried to use a `keymap' object as the value of the `repeat-map'
> property of a symbol/command and it failed. I think the change below
> would avoid the problem. The problem is that `boundp` throws an error
> for anything other than a symbol value.
>
> diff --git a/lisp/repeat.el b/lisp/repeat.el
> index 4dcd353e34..32ffb1884f 100644
> --- a/lisp/repeat.el
> +++ b/lisp/repeat.el
> @@ -416,7 +416,7 @@ repeat-post-hook
>                           (and (symbolp real-this-command)
>                                (get real-this-command 'repeat-map)))))
>          (when rep-map
> -          (when (boundp rep-map)
> +          (when (and (symbolp rep-map) (boundp rep-map))
>              (setq rep-map (symbol-value rep-map)))
>            (let ((map (copy-keymap rep-map)))

Thanks, fixed now.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: repeat-mode: Setting `repeat-map' property to a keymap object fails
  2021-11-25  7:59 ` Juri Linkov
@ 2021-11-25 18:09   ` Narendra Joshi
  2021-11-25 18:34     ` Robert Pluim
  0 siblings, 1 reply; 4+ messages in thread
From: Narendra Joshi @ 2021-11-25 18:09 UTC (permalink / raw)
  To: emacs-devel

Juri Linkov <juri@linkov.net> writes:

>> I tried to use a `keymap' object as the value of the `repeat-map'
>> property of a symbol/command and it failed. I think the change below
>> would avoid the problem. The problem is that `boundp` throws an error
>> for anything other than a symbol value.
>>
>> diff --git a/lisp/repeat.el b/lisp/repeat.el
>> index 4dcd353e34..32ffb1884f 100644
>> --- a/lisp/repeat.el
>> +++ b/lisp/repeat.el
>> @@ -416,7 +416,7 @@ repeat-post-hook
>>                           (and (symbolp real-this-command)
>>                                (get real-this-command 'repeat-map)))))
>>          (when rep-map
>> -          (when (boundp rep-map)
>> +          (when (and (symbolp rep-map) (boundp rep-map))
>>              (setq rep-map (symbol-value rep-map)))
>>            (let ((map (copy-keymap rep-map)))
>
> Thanks, fixed now.
>
Thanks. I see that it's merged to `emacs-28`. How/when would it end up
on the master branch? I am just curious about the overall process. 

Best,
-- 
Narendra Joshi




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: repeat-mode: Setting `repeat-map' property to a keymap object fails
  2021-11-25 18:09   ` Narendra Joshi
@ 2021-11-25 18:34     ` Robert Pluim
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Pluim @ 2021-11-25 18:34 UTC (permalink / raw)
  To: Narendra Joshi; +Cc: emacs-devel

>>>>> On Thu, 25 Nov 2021 19:09:42 +0100, Narendra Joshi <narendraj9@gmail.com> said:

    Narendra> Juri Linkov <juri@linkov.net> writes:
    >>> I tried to use a `keymap' object as the value of the `repeat-map'
    >>> property of a symbol/command and it failed. I think the change below
    >>> would avoid the problem. The problem is that `boundp` throws an error
    >>> for anything other than a symbol value.
    >>> 
    >>> diff --git a/lisp/repeat.el b/lisp/repeat.el
    >>> index 4dcd353e34..32ffb1884f 100644
    >>> --- a/lisp/repeat.el
    >>> +++ b/lisp/repeat.el
    >>> @@ -416,7 +416,7 @@ repeat-post-hook
    >>> (and (symbolp real-this-command)
    >>> (get real-this-command 'repeat-map)))))
    >>> (when rep-map
    >>> -          (when (boundp rep-map)
    >>> +          (when (and (symbolp rep-map) (boundp rep-map))
    >>> (setq rep-map (symbol-value rep-map)))
    >>> (let ((map (copy-keymap rep-map)))
    >> 
    >> Thanks, fixed now.
    >> 
    Narendra> Thanks. I see that it's merged to `emacs-28`. How/when would it end up
    Narendra> on the master branch? I am just curious about the overall process. 

emacs-28 is merged to master regularly by intrepid volunteers.
Sometimes daily, sometimes weekly.

Robert
-- 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-25 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 20:39 repeat-mode: Setting `repeat-map' property to a keymap object fails Narendra Joshi
2021-11-25  7:59 ` Juri Linkov
2021-11-25 18:09   ` Narendra Joshi
2021-11-25 18:34     ` Robert Pluim

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).