[Top][All Lists]

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

Re: New Context Menu

From: Juri Linkov
Subject: Re: New Context Menu
Date: Mon, 23 Aug 2021 10:33:32 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> >> What would be the best strategy for fixing these commands?  This error
>> >> is signaled for all commands that have (interactive "e").  Then such
>> >> interactive spec should be removed from all commands used in the menu?
>> >
>> > I guess so.  Why does it make sense for commands invoked from the
>> > menus to have the "e" interactive spec?
>> There are too many commands that have the "e" interactive spec.
>> It would be much simpler not to signal an error for them, but produce
>> a fake event where the clicked position is set to the position of point.
> Feel free to work on that (I guess that needs changes on the C
> level?).

Actually, I found out that no work is needed.  When this restriction
is removed from `call-interactively':

          if (next_event >= key_count)
            error ("%s must be bound to an event with parameters",
                   (SYMBOLP (function)
                    ? SSDATA (SYMBOL_NAME (function))
                    : "command"));

then everything works fine thanks to the old decision to accept
non-mouse events in event-start, event-end, event-click-count:

  (defun event-start (event)
    (if (consp event) (nth 1 event)
      (or (posn-at-point)
          (list (selected-window) (point) '(0 . 0) 0)))

reply via email to

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