unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Shiyao Ma <i@introo.me>
Cc: tab@lysator.liu.se, 27819@debbugs.gnu.org
Subject: bug#27819: invoking `artist-mouse-choose-operation' gives "if: Wrong type argument: listp, 110"
Date: Fri, 28 Jul 2017 14:27:16 +0200	[thread overview]
Message-ID: <87tw1whhln.fsf@rosalinde> (raw)
In-Reply-To: <A502AC45-DAB9-4EF2-A002-44558B377183@introo.me>

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





  reply	other threads:[~2017-07-28 12:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=87tw1whhln.fsf@rosalinde \
    --to=stephen.berman@gmx.net \
    --cc=27819@debbugs.gnu.org \
    --cc=i@introo.me \
    --cc=tab@lysator.liu.se \
    /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).