[Top][All Lists]

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

bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong typ

From: Stephen Berman
Subject: bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
Date: Fri, 28 Jul 2017 14:27:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

On Tue, 25 Jul 2017 14:25:19 +0200 Stephen Berman <address@hidden> wrote:

> On Tue, 25 Jul 2017 18:49:08 +0800 Shiyao Ma <address@hidden> wrote:
>> Hi,
>> I am on macOS emacs25, and using artist-mode.
>> when invoking `artist-mouse-choose-operation', I got this error message: if:
>> Wrong type argument: listp.
> I can reproduce the error by invoking the command like this:
> `M-x artist-mouse-choose-operation'.

Actually, I overlooked the last piece of the error message in the
Subject line "if: Wrong type argument: listp, 110".  What I see with
`M-x artist-mouse-choose-operation RET' is "if: Wrong type argument:
listp, 13", where 13 is the character code for RET.  110 is the
character code of the `n' key; the only way I can see that this
specific error occurred is if `artist-mouse-choose-operation' was bound
to `n'.  So to Shiyao Ma: Did you making such a binding?  If not, what
exactly did you do to get the error in the Subject line?

> The command is intended to be invoked with down-mouse-2 (that's what
> it's bound to in artist-mode-map).  
>> How to solve this?
> This is one way:
> diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
> index 596570ca4e..cdc2af4a7a 100644
> --- a/lisp/textmodes/artist.el
> +++ b/lisp/textmodes/artist.el
> @@ -4889,7 +4889,7 @@ artist-mouse-choose-operation
>       (select-window (posn-window (event-start last-input-event)))
>       (list last-input-event
>          (if (display-popup-menus-p)
> -            (x-popup-menu last-nonmenu-event artist-popup-menu-table)
> +            (x-popup-menu t artist-popup-menu-table)
>            'no-popup-menus))))
>    (if (eq op 'no-popup-menus)
> A possible disadvantage of this fix is that typing `M-x
> artist-mouse-choose-operation' will pop up the menu wherever the mouse
> pointer is, which on a graphical display could be anywhere on the
> screen, not necessarily within the Emacs window or even frame displaying
> the artist-mode buffer.

I think this is less disturbing that getting the error, and since, when
invoking the command with down-mouse-2 as intended, passing
last-nonmenu-event has the same effect as passing t (i.e., popping up
the menu where the mouse pointer is), I see no problem with making this
change.  (It also DTRT if `artist-mouse-choose-operation' is rebound,
though if that isn't how the error message showed 110, then something
else must be going on.)  So if there are no objections, I'll push it to

Steve Berman

reply via email to

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