bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#6130: 23.1; artist-mode spray-can malfunction


From: martin rudalics
Subject: bug#6130: 23.1; artist-mode spray-can malfunction
Date: Fri, 23 Jan 2015 09:26:56 +0100

> It's wrong for posn-window to return a frame.

Is it right for it to return nil?  There seems to be no particular
restriction on what a "mouse position list" as returned by `event-start'
and `event-end' has to contain.  Many callers simply use the selected
window or the window buffer of the selected window when the return value
of `posn-window' is nil.

> So are there callers that
> actually rely on this wrong behavior?  Are there callers where returning
> nil instead of a frame would be a problem?  Are there callers where
> signaling an error instead of returning a frame would be a problem?

`handle-delete-frame' seems to be the only function that expects
`posn-window' to return a frame (unconditionally, BTW).  I don't
understand `handle-delete-frame' but it hardly will cause problems when
it gets nil or an error.

I didn't check for occurrences of things like "(nth 0 position".

>> This would backfire for people who would like `posn-window' to always
>> return the first element of a position.
>
> That's OK, in the sense that we don't care if people's feelings
> are hurt.  But if it breaks existing packages it's more problematic.

If we really cared, we'd probably have to write something like

(defsubst posn-window (position)
  "Return the window in POSITION.
POSITION should be a list of the form returned by the `event-start'
and `event-end' functions."
  (if (window-live-p (nth 0 position))
      (nth 0 position)
    'none))

martin





reply via email to

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