From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Rodrigo Coacci Newsgroups: gmane.emacs.bugs Subject: bug#31435: 25.2; Add option to emacsclient so emacs server prefer creating GUI frames when needed Date: Sat, 12 May 2018 13:15:58 -0300 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000176f2c056c049284" X-Trace: blaine.gmane.org 1526141766 23825 195.159.176.226 (12 May 2018 16:16:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 May 2018 16:16:06 +0000 (UTC) To: 31435@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 12 18:16:02 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fHXBh-00065b-QN for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 May 2018 18:16:02 +0200 Original-Received: from localhost ([::1]:55009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHXDo-00078K-UE for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 May 2018 12:18:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHXDh-000781-5H for bug-gnu-emacs@gnu.org; Sat, 12 May 2018 12:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHXDe-0006sY-Bj for bug-gnu-emacs@gnu.org; Sat, 12 May 2018 12:18:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51889) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHXDe-0006sU-85 for bug-gnu-emacs@gnu.org; Sat, 12 May 2018 12:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fHXDe-0001pT-2V for bug-gnu-emacs@gnu.org; Sat, 12 May 2018 12:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rodrigo Coacci Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 May 2018 16:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31435 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15261418486986 (code B ref -1); Sat, 12 May 2018 16:18:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 May 2018 16:17:28 +0000 Original-Received: from localhost ([127.0.0.1]:59786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fHXD6-0001ob-9m for submit@debbugs.gnu.org; Sat, 12 May 2018 12:17:28 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fHXC3-0001mc-Qf for submit@debbugs.gnu.org; Sat, 12 May 2018 12:16:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHXBw-0006GD-CY for submit@debbugs.gnu.org; Sat, 12 May 2018 12:16:18 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:55315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fHXBw-0006G2-9U for submit@debbugs.gnu.org; Sat, 12 May 2018 12:16:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHXBu-0002Ai-73 for bug-gnu-emacs@gnu.org; Sat, 12 May 2018 12:16:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHXBs-0006EP-4B for bug-gnu-emacs@gnu.org; Sat, 12 May 2018 12:16:14 -0400 Original-Received: from mail-ot0-x233.google.com ([2607:f8b0:4003:c0f::233]:45559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHXBr-0006Dx-Sk for bug-gnu-emacs@gnu.org; Sat, 12 May 2018 12:16:12 -0400 Original-Received: by mail-ot0-x233.google.com with SMTP id 15-v6so9694225otn.12 for ; Sat, 12 May 2018 09:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=02YKPMuyQFGXBlUZZMOMHXjOLCyb9D0frIFntopE3tw=; b=M1syDid9uBXaiy3Tv7Azn9QuwGF1abh6wIAMs4hGXV5XypFsjm831PnT7VH/5HkioB QuQpd5qmLelX/2TuSQrNWgMj+rJ1VqSbXRWxZQwtNAuQQftJCWVnQo6DfO+n5z6FLFpv hAqrVjJWT0TyGVjfMmb75ns07IIDQ1rHgRMzIYGrB3zZWJnrYzfsT/lvuy9iXNB1XRdB EZjUaZGc5XfBwwapYr9J3VWPJTILv/451MC4g6nTldX+TxWGkpBZVYGQJESctCKuB+oA H9NDy5fpLBrzs34jIYrlpECM0ADCxmUt9AMwkcQ1lm7RFQnHbIYuV5V/3SKgwWYnYoGr hJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=02YKPMuyQFGXBlUZZMOMHXjOLCyb9D0frIFntopE3tw=; b=YE7/eCiHfrwLXO3RXbpgHrJZvnXL5Ej34KEDrV2Pz1rodP8Ae6mMLNPZpTbuBhGpTf xzt00tQz98Dpx3H9jKRIWmFAai9byx7kadQItFjQiAFdgD403KFXkQpaXwlmly0jTGPZ i0AaGbboyA2Y2EuKoXWpCw1rWY+f1+J84PwG24MzUknlaY41c9lcuVVqcbpwIi+nZZtk FektjekhlgbY6f8TGgOHP5E4gpZktrhavmargxnhYIXyA3RA1QlXuxQJN/0v0NPOmzXA cq2qI4Pka5Z4AnZ6Ru2l1+WIcwwIT1sJY95Xj3vk2A9r0kVhlxNlOeDcJiqHFkDp8k0a trfg== X-Gm-Message-State: ALKqPwdbDm/IeyTOsq6ogisg5u6WXSlXYTvk4LLQmEus4/yDiXDmDwfu zt6MuGEDT6j1FYnN9e/BD3r3tvBGcXZN1EDq7Aiiqw== X-Google-Smtp-Source: AB8JxZqwT/zWbsH7beJ2ELNwj0iy8ss/7tCgGPiNXM2XmV4Ue/Hse6gt0I7yqXXtZlHkEzXB0PbO5UVtnjdELta6VKk= X-Received: by 2002:a9d:34f1:: with SMTP id t46-v6mr1965519otd.396.1526141770230; Sat, 12 May 2018 09:16:10 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sat, 12 May 2018 12:17:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146138 Archived-At: --000000000000176f2c056c049284 Content-Type: text/plain; charset="UTF-8" This is a feature request. Today, when running emacs server and no frames already exists, emacsclient creates a terminal frame even when a window system is available. The only way to make emacsclient create GUI frames is by using the "-c" option which *always* creates a new frame, but negates the desirable behavior of reusing existing frames. I'd like to propose a new emacsclient option or an emacs customizable variable so that the following pseudo-code happens when invoking "emacsclient foo.txt" (or "emacsclient --new-option foo.txt"): if (exist-frame) open-buffer-in-existing-frame else if (window-system-available) open-buffer-in-new-GUI-frame else open-buffer-in-new-terminal-frame There was also some discussion about this on r/emacs ( https://www.reddit.com/r/emacs/comments/8iq4ho/how_make_emacsclient_create_gui_frame_by_default/ ) and I was directed at making this feature request. In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2017-09-22, modified by Debian built on lgw01-amd64-050 Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 18.04 LTS Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs25-jYekUr/emacs25-25.2+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LC_CTYPE: pt_BR.UTF-8 value of $LC_MONETARY: pt_BR.UTF-8 value of $LC_NUMERIC: pt_BR.UTF-8 value of $LC_TIME: pt_BR.UTF-8 value of $LANG: pt_BR.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent messages: Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)... Loading debian-ispell... Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done Loading debian-ispell...done Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... user-error: End of history; no default available [2 times] Load-path shadows: /usr/share/emacs/25.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /usr/share/emacs/site-lisp/rst hides /usr/share/emacs/25.2/lisp/textmodes/rst Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils thingatpt time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 89661 10198) (symbols 48 19887 0) (miscs 40 94 196) (strings 32 14841 5123) (string-bytes 1 422977) (vectors 16 11895) (vector-slots 8 431894 5412) (floats 8 165 56) (intervals 56 300 0) (buffers 976 20)) --000000000000176f2c056c049284 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This is a feature request.
Today, when running emacs se= rver and no frames already exists,
emacsclient creates a terminal frame = even when a window system is
available. The only way to make emacsclient= create GUI frames is by
using the "-c" option which *always* = creates a new frame, but negates
the desirable behavior of reusing exist= ing frames.

I'd like to propose a new emacsclient option or an e= macs
customizable variable so that the following pseudo-code happens whe= n
invoking "emacsclient foo.txt" (or "emacsclient --new-o= ption foo.txt"):

if (exist-frame)
=C2=A0=C2=A0=C2=A0=C2=A0 o= pen-buffer-in-existing-frame
else if (window-system-available)
=C2=A0= =C2=A0=C2=A0=C2=A0 open-buffer-in-new-GUI-frame
else
=C2=A0=C2=A0=C2= =A0=C2=A0 open-buffer-in-new-terminal-frame

There was also some disc= ussion about this on r/emacs
(https://= www.reddit.com/r/emacs/comments/8iq4ho/how_make_emacsclient_create_gui_fram= e_by_default/)
and I was directed at making this feature request.
In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
=C2= =A0of 2017-09-22, modified by Debian built on lgw01-amd64-050
Windowing = system distributor 'The X.Org Foundation', version 11.0.11906000System Description:=C2=A0=C2=A0=C2=A0 Ubuntu 18.04 LTS

Configured u= sing:
=C2=A0'configure --build x86_64-linux-gnu --prefix=3D/usr
= =C2=A0--sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib
=C2=A0--locals= tatedir=3D/var/lib --infodir=3D/usr/share/info
=C2=A0--mandir=3D/usr/sha= re/man --with-pop=3Dyes
=C2=A0--enable-locallisppath=3D/etc/emacs25:/etc= /emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-li= sp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
=C2=A0--wi= th-sound=3Dalsa --without-gconf --build x86_64-linux-gnu
=C2=A0--prefix= =3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib
=C2=A0--loca= lstatedir=3D/var/lib --infodir=3D/usr/share/info
=C2=A0--mandir=3D/usr/s= hare/man --with-pop=3Dyes
=C2=A0--enable-locallisppath=3D/etc/emacs25:/e= tc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-= lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
=C2=A0--= with-sound=3Dalsa --without-gconf --with-x=3Dyes --with-x-toolkit=3Dgtk3=C2=A0--with-toolkit-scroll-bars 'CFLAGS=3D-g -O2
=C2=A0-fdebug-pre= fix-map=3D/build/emacs25-jYekUr/emacs25-25.2+1=3D. -fstack-protector-strong=
=C2=A0-Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wd= ate-time
=C2=A0-D_FORTIFY_SOURCE=3D2' 'LDFLAGS=3D-Wl,-Bsymbolic-= functions -Wl,-z,relro''

Configured features:
XPM JPEG TI= FF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELIN= UX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS = GTK3 X11

Important settings:
=C2=A0 value of $LC_CTYPE: pt_BR.UTF= -8
=C2=A0 value of $LC_MONETARY: pt_BR.UTF-8
=C2=A0 value of $LC_NUME= RIC: pt_BR.UTF-8
=C2=A0 value of $LC_TIME: pt_BR.UTF-8
=C2=A0 value o= f $LANG: pt_BR.UTF-8
=C2=A0 locale-coding-system: utf-8-unix

Majo= r mode: Fundamental

Minor modes in effect:
=C2=A0 tooltip-mode: t=
=C2=A0 global-eldoc-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0= mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t<= br>=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
= =C2=A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 au= to-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 buffer-r= ead-only: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t<= br>
Recent messages:
Loading /etc/emacs/site-start.d/50dictionaries-c= ommon.el (source)...
Loading debian-ispell...
Loading /var/cache/dict= ionaries-common/emacsen-ispell-default.el (source)...done
Loading debian= -ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dic= ts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-com= mon.el (source)...done
Loading /etc/emacs/site-start.d/50python-docutils= .el (source)...done
For information about GNU Emacs and the GNU system, = type C-h C-a.
Making completion list...
user-error: End of history; n= o default available [2 times]

Load-path shadows:
/usr/share/emacs= /25.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-star= tup
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/25.2/lisp/text= modes/rst

Features:
(shadow sort mail-extr emacsbug message dired= format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util = mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils ma= ilheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode = easymenu
cl-loaddefs pcase cl-lib mail-prsvr mail-utils thingatpt time-d= ate
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lis= p-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
ima= ge regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog= -mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse j= it-lock font-lock syntax facemenu font-core frame cl-generic cham
georgi= an utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japa= nese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiop= ic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook = help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces= cus-face macroexp files text-properties overlay
sha1 md5 base64 format = env code-pages mule custom widget
hashtable-print-readable backquote dbu= sbind inotify dynamic-setting
system-font-setting font-render-setting mo= ve-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

= Memory information:
((conses 16 89661 10198)
=C2=A0(symbols 48 19887 = 0)
=C2=A0(miscs 40 94 196)
=C2=A0(strings 32 14841 5123)
=C2=A0(st= ring-bytes 1 422977)
=C2=A0(vectors 16 11895)
=C2=A0(vector-slots 8 4= 31894 5412)
=C2=A0(floats 8 165 56)
=C2=A0(intervals 56 300 0)
=C2= =A0(buffers 976 20))

--000000000000176f2c056c049284--