From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Re: select-frame-set-input-focus fails to raise the frame Date: Sat, 16 Dec 2017 15:07:27 -0500 Message-ID: References: <20171213204737.GA1621@breton.holly.idiocy.org> <20171213222634.GA2144@breton.holly.idiocy.org> <831sjwt1jf.fsf@gnu.org> <83tvwrsouc.fsf@gnu.org> <83d13espny.fsf@gnu.org> <83a7yisl6t.fsf@gnu.org> <83r2ruqwww.fsf@gnu.org> Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113fdc8a68926a05607aac33" X-Trace: blaine.gmane.org 1513455072 7681 195.159.176.226 (16 Dec 2017 20:11:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 16 Dec 2017 20:11:12 +0000 (UTC) Cc: Alan Third , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 16 21:11:07 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQIn9-0000e4-L4 for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2017 21:10:39 +0100 Original-Received: from localhost ([::1]:51884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQIlR-0003jJ-9C for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2017 15:08:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQIkc-0003j1-Oo for emacs-devel@gnu.org; Sat, 16 Dec 2017 15:08:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQIkZ-0004LU-ID for emacs-devel@gnu.org; Sat, 16 Dec 2017 15:08:02 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQIkZ-0004LJ-ED for emacs-devel@gnu.org; Sat, 16 Dec 2017 15:07:59 -0500 Original-Received: from mail-qt0-f171.google.com ([209.85.216.171]:44034) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1eQIkY-0001il-Rr; Sat, 16 Dec 2017 15:07:59 -0500 Original-Received: by mail-qt0-f171.google.com with SMTP id m59so15888974qte.11; Sat, 16 Dec 2017 12:07:58 -0800 (PST) X-Gm-Message-State: AKGB3mIFBjFApoQzOYV1En4CdrYpWUAWvBiiK4Jv/yriR42QAzJqm7Ew IZxHOlN+3pFfR/LrkIhOH0e7uIXbr6L6U5tvLhQ= X-Google-Smtp-Source: ACJfBosdVAAvxYpaOLBVgLBgH13Arnr6sDOrP6YB3no3HXSDuLICO6ry1OjVrXITi0UAh/JUBSd2GvIJgQpIvevIP0U= X-Received: by 10.200.45.93 with SMTP id o29mr30307709qta.22.1513454878362; Sat, 16 Dec 2017 12:07:58 -0800 (PST) Original-Received: by 10.200.55.124 with HTTP; Sat, 16 Dec 2017 12:07:27 -0800 (PST) In-Reply-To: <83r2ruqwww.fsf@gnu.org> X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221148 Archived-At: --001a113fdc8a68926a05607aac33 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Dec 16, 2017 at 2:45 PM, Eli Zaretskii wrote: > > From: Robert Weiner > > Date: Sat, 16 Dec 2017 13:57:34 -0500 > > Cc: Alan Third , emacs-devel > > > > > =E2=80=8BOk, that is an example of why I am advocating for a potenti= ally > > > new function that let's a programmer say "display the latest > > > contents of this window with no other Emacs window or frame > > > obscuring it". > > > > That cannot be done in general, because redisplaying a window could > > very well affect other windows. One example of that is TTY frame > > display; > > > > =E2=80=8BOnly one frame is visible on a tty at a time, so in > > my use case, this would have to be the frame that > > displays the window. Why is this a problem? > > TTY redisplay deals with the entire frame, so it cannot redraw a > single window. > =E2=80=8BAgain, I think you are missing my main points because you are drawn to the implementation level. =E2=80=8BI never said redisplay had to only draw one window. I said that I needed the latest contents of a particular window displayed. I don't care what redisplay feels it needs to redraw as long as it shows the latest contents of that window, it does it at a particular point in the function and Emacs tells the window manager to make its frame the uppermost in the stack or Z-frame group as Martin described). =E2=80=8B=E2=80=8B > > =E2=80=8B=E2=80=8B > > =E2=80=8B=E2=80=8Banother is a case where the window was shrunk. > =E2=80=8B=E2=80=8B > > > =E2=80=8B=E2=80=8B > > =E2=80=8BWhy can a shrunk window not be displayed within the > =E2=80=8B=E2=80=8B > > topmost frame? You are giving examples without explaining > =E2=80=8B=E2=80=8B > > why they conflict with the desired goal? > =E2=80=8B=E2=80=8B > > =E2=80=8B=E2=80=8B > I gave examples that explain why Emacs cannot be in general told to > redraw a single window. Maybe I misunderstood, but I thought this is > what you were trying to accomplish ("display the latest contents of > this window"). > =E2=80=8BNo. I mentioned the latest contents of the window because when I used sit-for to trigger redisplay, I would see the new frame displayed with the buffer it was created with even though a set-window-buffer change had been called prior to the invocation of the sit-for. So just displaying the window was insufficient since it had the wrong contents. Calling (redisplay t) directly fixed this. =E2=80=8B=E2=80=8B > > =E2=80=8BSo you are saying Emacs provides no way for the programmer > =E2=80=8B=E2=80=8B > > to ensure that a window is wholly displayed on screen and > =E2=80=8B=E2=80=8B > > fully updated even when Emacs is the only application in use? > =E2=80=8B=E2=80=8B > > =E2=80=8B=E2=80=8B > Not if you want to tell Emacs to display _only_ one window. =E2=80=8BOkay, this was just you misreading my intent. > > I had just dealt with many multi-frame scenarios > > before and never had to call redisplay directly so it seemed > > odd that I had to now. > > That's because normally, you don't need to. Having to display changes > during the command's execution is a rare use case. > =E2=80=8BBut it will come up any time a temporary display of an overlapping frame is necessary where the function must end with another frame atop the stack. Thus, it sounds like a case for a with-temp-frame macro that would call select-frame-set-input-focus on the temp frame for a variable specified amount of time. It would then reset the selected frame and input focus to the way they were prior to the macro invocation (as best it could given system limitations). Bob --001a113fdc8a68926a05607aac33 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Dec 16, 2= 017 at 2:45 PM, Eli Zaretskii <el= iz@gnu.org> wrot= e:
> From: Robert Weiner <rsw@gnu.org>
> Date: Sat, 16 Dec 2017 13:57:34 -0500
> Cc: Alan Third <alan@idiocy.org>, emacs-devel <emacs-devel@gnu.org>
>
>=C2=A0 > =E2=80=8BOk, that is an example of = why I am advocating for a potentially
>=C2=A0 > new function that let's a programmer say "display = the latest
>=C2=A0 > contents of this window with no other Emacs window or frame=
>=C2=A0 > obscuring it".
>
>=C2=A0 That cannot be done in general, because redisplaying a window co= uld
>=C2=A0 very well affect other windows.=C2=A0 One example of that is TTY= frame
>=C2=A0 display;
>
> =E2=80=8BOnly one frame is visible on a tty at a time, so in
> my use case, this would have to be the frame that
> displays the window.=C2=A0 Why is this a problem?

TTY redisplay deals with the entire frame, so it cannot redraw a
single window.

=E2=80=8BAgain, I think you = are missing my main points because you are
drawn to the implementati= on level.=C2=A0 =E2=80=8BI never said redisplay had
to only draw one windo= w.=C2=A0 I said that I needed the latest contents
of a particular window d= isplayed.=C2=A0 I don't care what redisplay feels
it needs to redraw a= s long as it shows the latest contents of that
window, it does it at a par= ticular point in the function and Emacs
tells the window manager to make i= ts frame the uppermost in the stack
or Z-frame group as Martin described).=

=E2=80=8B=E2=80=8B

=E2=80=8B=E2=80=8B
>=C2=A0 =E2=80=8B=E2=80=8Banother is = a case where the window was shrunk.
=E2=80=8B=E2=80=8B
>
=E2=80=8B=E2=80=8B
> =E2=80=8BWhy can a shrunk window no= t be displayed within the
=E2=80=8B=E2=80=8B
> topmost frame?=C2=A0 You are giving= examples without explaining
=E2=80=8B=E2=80=8B
> why they conflict with the desired = goal?
=E2=80=8B=E2=80=8B

=E2=80=8B=E2=80=8B
I gave examples that explain why = Emacs cannot be in general told to
redraw a single window.=C2=A0 Maybe I misunderstood, but I thought this is<= br> what you were trying to accomplish ("display the latest contents of this window").

=E2=80=8BNo.=C2=A0 I mention= ed the latest contents of the window because
when I used sit-for to trigge= r redisplay, I would see the
new frame displayed with the buffer it was cr= eated with even
though a set-window-buffer change had been called prior to=
the invocation of the sit-for.=C2=A0 So just displaying the window
<= div class=3D"gmail_default" style=3D"font-family:monospace,monospace">was i= nsufficient since it had the wrong contents.=C2=A0 Calling
(redisplay t) = directly fixed this.

=E2=80=8B=E2=80=8B
> =E2=80=8BSo you are saying Em= acs provides no way for the programmer
=E2=80=8B=E2=80=8B
> to ensure that a window is wholly d= isplayed on screen and
=E2=80=8B=E2=80=8B
> fully updated even when Emacs is th= e only application in use?
=E2=80=8B=E2=80=8B

=E2=80=8B=E2=80=8B
Not if you want to tell Emacs to = display _only_ one window.

=E2=80=8BOkay, this was j= ust you misreading my intent.


> I had just dealt with many multi-frame scenarios
> before and never had to call redisplay directly so it seemed
> odd that I had to now.

That's because normally, you don't need to.=C2=A0 Having to = display changes
during the command's execution is a rare use case.

=E2=80=8BBut it will come up any time a temporary display of an
ove= rlapping frame is necessary where the function must
end with another frame= atop the stack.=C2=A0 Thus, it sounds like
a case for a with-temp-frame m= acro that would call
select-frame-set-input-focus on the temp frame for a = variable
specified amount of time.=C2=A0 It would then reset the selected = frame
and input focus to the way they were prior to the macro invocation
= (as best it could given system limitations).

Bob

--001a113fdc8a68926a05607aac33--