all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
@ 2017-07-25 10:49 Shiyao Ma
  2017-07-25 12:25 ` Stephen Berman
  0 siblings, 1 reply; 8+ messages in thread
From: Shiyao Ma @ 2017-07-25 10:49 UTC (permalink / raw)
  To: tab, 27819


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.


How to solve this?


Best,

Shiyao




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

* bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
  2017-07-25 10:49 bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110" Shiyao Ma
@ 2017-07-25 12:25 ` Stephen Berman
  2017-07-28 12:27   ` Stephen Berman
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Berman @ 2017-07-25 12:25 UTC (permalink / raw)
  To: Shiyao Ma; +Cc: tab, 27819

On Tue, 25 Jul 2017 18:49:08 +0800 Shiyao Ma <i@introo.me> 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'.

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.

Steve Berman





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

* bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
  2017-07-25 12:25 ` Stephen Berman
@ 2017-07-28 12:27   ` Stephen Berman
  2017-07-28 13:10     ` Eli Zaretskii
  2017-07-29  3:38     ` Shiyao MA
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen Berman @ 2017-07-28 12:27 UTC (permalink / raw)
  To: Shiyao Ma; +Cc: tab, 27819

On Tue, 25 Jul 2017 14:25:19 +0200 Stephen Berman <stephen.berman@gmx.net> wrote:

> On Tue, 25 Jul 2017 18:49:08 +0800 Shiyao Ma <i@introo.me> 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
master.

Steve Berman





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

* bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
  2017-07-28 12:27   ` Stephen Berman
@ 2017-07-28 13:10     ` Eli Zaretskii
  2017-07-29 12:02       ` Stephen Berman
  2017-07-29  3:38     ` Shiyao MA
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2017-07-28 13:10 UTC (permalink / raw)
  To: Stephen Berman; +Cc: i, tab, 27819

> From: Stephen Berman <stephen.berman@gmx.net>
> Date: Fri, 28 Jul 2017 14:27:16 +0200
> Cc: tab@lysator.liu.se, 27819@debbugs.gnu.org
> 
> > 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
> master.

Please do, and thanks.





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

* bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
  2017-07-28 12:27   ` Stephen Berman
  2017-07-28 13:10     ` Eli Zaretskii
@ 2017-07-29  3:38     ` Shiyao MA
  2017-07-29 12:18       ` Stephen Berman
  1 sibling, 1 reply; 8+ messages in thread
From: Shiyao MA @ 2017-07-29  3:38 UTC (permalink / raw)
  To: Stephen Berman; +Cc: tab, 27819


Hi Stephen,

I bind C-c n to the artist-mouse-choose-operation, so yes, there comes the 'n'.

Before that, I also bind <s-mouse-2> to artist-mouse-choose-operation, but facing the same error.

The reason I define a custom binding is I want to simulate the middle-button clicking on my macbook pro which only has a trackpad with no mouse.


Best,

> On 28 Jul 2017, at 20:27, Stephen Berman <stephen.berman@gmx.net> wrote:
> 
> 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?






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

* bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
  2017-07-28 13:10     ` Eli Zaretskii
@ 2017-07-29 12:02       ` Stephen Berman
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Berman @ 2017-07-29 12:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: i, tab, 27819

On Fri, 28 Jul 2017 16:10:15 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Date: Fri, 28 Jul 2017 14:27:16 +0200
>> Cc: tab@lysator.liu.se, 27819@debbugs.gnu.org
>> 
>> > 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
>> master.
>
> Please do, and thanks.

Done as commit 7017528273.

Steve Berman





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

* bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
  2017-07-29  3:38     ` Shiyao MA
@ 2017-07-29 12:18       ` Stephen Berman
  2017-08-15 23:28         ` npostavs
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Berman @ 2017-07-29 12:18 UTC (permalink / raw)
  To: Shiyao MA; +Cc: tab, 27819

On Sat, 29 Jul 2017 11:38:25 +0800 Shiyao MA <i@introo.me> wrote:

> Hi Stephen,
>
> I bind C-c n to the artist-mouse-choose-operation, so yes, there comes the 'n'.

Thanks for confirming my suspicion.

> Before that, I also bind <s-mouse-2> to artist-mouse-choose-operation, but
> facing the same error.

Do you mean the "super" modifier here, not the "shift" modifier?
artist-mode already binds S-down-mouse-2 (shift modifier) to
artist-mouse-choose-operation.  I don't think I can test the super
modifier without changes my keyboard setup in X, so I can't readily
investigate this further.

> The reason I define a custom binding is I want to simulate the middle-button
> clicking on my macbook pro which only has a trackpad with no mouse.

Since I've pushed the fix now, if you update from master you should not
get the error anymore.

Steve Berman





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

* bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
  2017-07-29 12:18       ` Stephen Berman
@ 2017-08-15 23:28         ` npostavs
  0 siblings, 0 replies; 8+ messages in thread
From: npostavs @ 2017-08-15 23:28 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Shiyao MA, tab, 27819

tags 27819 fixed
close 27819 26.1
quit

Stephen Berman <stephen.berman@gmx.net> writes:

> Since I've pushed the fix now, if you update from master you should not
> get the error anymore.

I'm therefore closing this as fixed.





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

end of thread, other threads:[~2017-08-15 23:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25 10:49 bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110" Shiyao Ma
2017-07-25 12:25 ` Stephen Berman
2017-07-28 12:27   ` Stephen Berman
2017-07-28 13:10     ` Eli Zaretskii
2017-07-29 12:02       ` Stephen Berman
2017-07-29  3:38     ` Shiyao MA
2017-07-29 12:18       ` Stephen Berman
2017-08-15 23:28         ` npostavs

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.