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: Suggestion: Add discussion of input focus handling to select-window; add select-frame-window Date: Wed, 13 Dec 2017 09:51:07 -0500 Message-ID: References: <5A30E9AF.2060105@gmx.at> Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="089e0822a4bc920ecf056039e74c" X-Trace: blaine.gmane.org 1513176709 31177 195.159.176.226 (13 Dec 2017 14:51:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Dec 2017 14:51:49 +0000 (UTC) Cc: emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 13 15:51:45 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 1eP8Ns-0007rD-BM for ged-emacs-devel@m.gmane.org; Wed, 13 Dec 2017 15:51:44 +0100 Original-Received: from localhost ([::1]:35837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eP8Nz-0000WQ-8z for ged-emacs-devel@m.gmane.org; Wed, 13 Dec 2017 09:51:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eP8Nr-0000WI-2X for emacs-devel@gnu.org; Wed, 13 Dec 2017 09:51:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eP8Nn-0007Cv-42 for emacs-devel@gnu.org; Wed, 13 Dec 2017 09:51:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eP8Nn-0007Cg-05 for emacs-devel@gnu.org; Wed, 13 Dec 2017 09:51:39 -0500 Original-Received: from mail-qt0-f169.google.com ([209.85.216.169]:33491) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1eP8Nm-0004lS-FX for emacs-devel@gnu.org; Wed, 13 Dec 2017 09:51:38 -0500 Original-Received: by mail-qt0-f169.google.com with SMTP id e2so3998208qti.0 for ; Wed, 13 Dec 2017 06:51:38 -0800 (PST) X-Gm-Message-State: AKGB3mIsCl4ZDRAnY+CmGuUjGafpyI6mITKJHydM17Y6w5/xn3UlcT3A CJmVGOTxMkIEVibzuJMOiKVm9XCRg4pVUche77I= X-Google-Smtp-Source: ACJfBovma8lh/vr2n0UkhKXIE9p+Z4Yd+5kVokZjNASfifvUr1za/Hv+8gM/tb7+NW4reFynpu5gVVe91n1fzsUQQZE= X-Received: by 10.200.10.75 with SMTP id f11mr10527914qti.272.1513176698062; Wed, 13 Dec 2017 06:51:38 -0800 (PST) Original-Received: by 10.200.55.124 with HTTP; Wed, 13 Dec 2017 06:51:07 -0800 (PST) In-Reply-To: <5A30E9AF.2060105@gmx.at> 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:220997 Archived-At: --089e0822a4bc920ecf056039e74c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Dec 13, 2017 at 3:49 AM, martin rudalics wrote: > > The doc string for select-window does not discuss the sometime need to > also > > set input focus to the selected window's frame when one wants future > input > > events to go there. I would suggest adding this along with a reference > to > > select-frame-set-input-focus. > > `select-window' is a function with immediate effect so we can give it a > self-contained doc-string and description. > > `select-frame-set-input-focus' OTOH lumps together three things: It > selects a frame and thus implicitly its selected window and tells the > window manager to raise that frame and to give it input focus. The > latter two do not have immediate effect, they induce a delay and require > a cooperating window manager. (Raising the frame is a bad idea IMHO but > admittedly a compromise to accommodate the standard behavior of most > existing window managers.) > > So the reference you suggest would have to be accompanied by an > explanation of delays and a reference to the window manager. > Delays and interaction with the window manager are lower-level implementation details that could be covered in the Elisp manual as you say, rather than the doc string. The overriding issue is that the general concept of selecting an editable window in most systems would include input focus going to that window. In Emacs, this is true in a single frame session where selecting a window makes any following input characters go to the window's buffer. So new and even experienced Elisp programmers could easily assume that selecting a window in another frame would behave similarly. It does not because as you note, the situation is more complex. So this needs to be pointed out to people when they first look at the doc string for select-window. Yet there is no need in the doc string to talk about delays (any modern system will respond pretty responsively to such requests) nor to get into window system details other than to mention raising windows and directing input focus along with the associated functions, as I noted in my prior message. Bob =E2=80=8B --089e0822a4bc920ecf056039e74c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Dec 13, 2= 017 at 3:49 AM, martin rudalics <rudalics@gmx.at> wrote:
> The doc string f= or select-window does not discuss the sometime need to also
> set input focus to the selected window's frame when one wants futu= re input
> events to go there.=C2=A0 I would suggest adding this along with a ref= erence to
> select-frame-set-input-focus.

`select-window' is a function with immediate effect so we can give it a=
self-contained doc-string and description.

`select-frame-set-input-focus' OTOH lumps together three things: It
selects a frame and thus implicitly its selected window and tells the
window manager to raise that frame and to give it input focus.=C2=A0 The latter two do not have immediate effect, they induce a delay and require a cooperating window manager.=C2=A0 (Raising the frame is a bad idea IMHO b= ut
admittedly a compromise to accommodate the standard behavior of most
existing window managers.)

So the reference you suggest would have to be accompanied by an
explanation of delays and a reference to the window manager.=C2=A0

Delays and interaction with the window manager are lower= -level
implementation details that could be covered in the Elisp manual
a= s you say, rather than the doc string.

The overriding issue is that = the general concept of selecting an
editable window in most systems would = include input focus going
to that window.=C2=A0 In Emacs, this is true in = a single frame session
where selecting a window makes any following input = characters go
to the window's buffer.=C2=A0 So new and even experience= d Elisp
programmers could easily assume that selecting a window in another=
frame would behave similarly.=C2=A0 It does not because as you note,
the= situation is more complex.

So this needs to be pointed out to peo= ple when they first look at
the doc string for select-window.=C2=A0 Yet th= ere is no need in the doc
string to talk about delays (any modern system w= ill respond pretty
responsively to such requests) nor to get into window s= ystem details
other than to mention raising windows and directing input fo= cus along
with the associated functions, as I noted in my prior message.
=
Bob
=E2=80=8B
--089e0822a4bc920ecf056039e74c--