[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: x_autoselect_window_p
From: |
Pavel Janík |
Subject: |
Re: x_autoselect_window_p |
Date: |
Mon, 01 Apr 2002 12:47:29 +0200 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2.50 (i386-suse-linux-gnu) |
From: address@hidden (Gerd Moellmann)
Date: 01 Apr 2002 11:25:16 +0200
> I'll add some notes below. The principle seems correct to me.
Thank you.
> People might be more happy with a more telling name
> (SELECT_WINDOW_EVENT, SWITCH_WINDOW_EVENT, ...?)
Yes, I have chosen SELECT_WINDOW_EVENT for now because it matches the real
functionality.
> > - if (f)
> > + if (f) {
>
> (signal 'coding-convention-error "{") :-)
;-) Fixed.
> On some systems, `static' gets defined away, so if you need such a
> variable in Emacs, you must move it to global scope.
I moved it up.
> > + /* Window will be selected only when it is not
selected now and
> > + last mouse movement event was not in it.
Minibuffer window
> > + will be selected iff it is active. */
> > + if (!EQ (window, last_window)
> > + && !EQ (window, selected_window)
> > + && (!MINI_WINDOW_P (XWINDOW (window))
> > + || (EQ (window, minibuf_window) &&
minibuf_level > 0)))
>
> Maybe it's better to leave this condition testing to the Lisp function
> that is called at the end for handling the event? It would have the
> advantage of being more flexible.
Well, we can split this. I do not want to generate an event for every
mouse move, so I think it is OK to have
+ if (!EQ (window, last_window)
+ && !EQ (window, selected_window)
here, but the rest can in fact be moved to Elisp.
>
> > + {
> > + fprintf(stderr, "WINDOW_IN_EVENT
generated!\n");
> > +
> > + bufp->kind = WINDOW_IN_EVENT;
> > + XSETFRAME (bufp->frame_or_window, window);
> > + bufp->arg = Qnil;
>
> Strictly speaking, it might be a good idea to check for numchars > 0
> before filling in the event.
Like this?
+ /* Window will be selected only when it is not selected
now and
+ last mouse movement event was not in it. Minibuffer
window
+ will be selected iff it is active. */
+ if (!EQ (window, last_window)
+ && !EQ (window, selected_window)
+ && numchars > 0)
+ {
+ bufp->kind = SELECT_WINDOW_EVENT;
+ bufp->frame_or_window = window;
+ bufp->arg = Qnil;
+ ++bufp, ++count, --numchars;
+ }
> If this isn't an X-only feature, the `x_' prefix might be a bit
> confusing.
Yes, this was already proposed by both Eli and Richard. I will change that
before really committing to autoselect-window (autoselect_window_p).
--
Pavel Janík
kwintv is always crashing. Please fix it fast.. I want to watch Star Trek.
-- Thomas Biege <address@hidden>