From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: How to get DISPLAY of emacsclient? Date: Sun, 27 Nov 2022 12:36:34 -0800 Message-ID: <973588ef-d931-47a0-66d3-f8d70d92bd57@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4265"; mail-complaints-to="usenet@ciao.gmane.io" To: Max Nikulin , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 27 21:36:51 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozOOQ-0000xw-NW for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Nov 2022 21:36:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozOOJ-0001Uj-CL; Sun, 27 Nov 2022 15:36:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozOOG-0001Rx-3x for emacs-devel@gnu.org; Sun, 27 Nov 2022 15:36:40 -0500 Original-Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozOOE-0003eA-Au for emacs-devel@gnu.org; Sun, 27 Nov 2022 15:36:39 -0500 Original-Received: by mail-pj1-x1030.google.com with SMTP id o5-20020a17090a678500b00218cd5a21c9so8449584pjj.4 for ; Sun, 27 Nov 2022 12:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=f1bY0fGwVtVShMbnschEfbZ/eJyWO1UAIbx96kAdUPs=; b=MgA2FHIHDTjIRVMOZECoHlM/Zhx6w+0zL+Qw/1sqQG1IL3Ki+oGMWrYGO6TgRiPyEa 2UrfRXhqxCzW4KA68OYpwc3Pzri8R1HPkYAlQxJASdWPsg/FmGFtX4cZuSLJV6LyWQNr xRHIZAae5KTl00tVzGNiBkj4vxfHsFjs00tNUAj1YFNYKdDMKRwDIbQBhk5XEl9iqcMW L3TflNjdXgrZ5XGLNsX/3xBnRdOObC06WmXkaCyMVGgC/0pMII7r29i5OoJcI5mM7F78 2z4prI7A9xRl/MAbRlzD0Lw3m4J/Xb/Qrq1rXE308tSbxKZaDp1/t1vw4eZFCS0UM4vs aRxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f1bY0fGwVtVShMbnschEfbZ/eJyWO1UAIbx96kAdUPs=; b=dchHXRMiAJeuOVtlZYDheSh5cWSD6w66bOTrNJxnGOJ0he467LPqBodaw5X+SC2GGW riCL1xyqlTMiQzd0UM5QrSptR3y9AtylAoWkHCjvrEsEiIw1iLRtrmAMS969o8QUCVFy 88g8VEvMYC3ZnGrXZ7vnHx+Z9kWaGrsGhtNbb4jy7fveN7tCi9cFV4v8firsryBlW4Jz DuMj34IAIDPby0Q4tyOK/tTmAvypw2OGbNqzrES2lS7h9eS+ovodqVF4k0v2J2o2MEaX lsNvBTnIZzkTOlcNG3seSB1BwsLvNlNgxvyBWAvnvmA0WzfZqyqdFmBcY/Km1TOAbPG/ 86PQ== X-Gm-Message-State: ANoB5plbPq2TT4y4MClRJr52xpFQ3L5ATokfmw3qB/9EQ0CHBERtT1J/ a/4kXeLByywCd32fLvsPjBqo7rtZtpQ= X-Google-Smtp-Source: AA0mqf7LtCmyRaKdDUqQnaw7sOblm6JNDOKJevw6gsZOJVkQo9aBRH6fUGotRFt0EfEhQhiulh81DQ== X-Received: by 2002:a17:903:2112:b0:188:7dca:6f41 with SMTP id o18-20020a170903211200b001887dca6f41mr28552286ple.72.1669581396665; Sun, 27 Nov 2022 12:36:36 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id e16-20020a17090ac21000b00218f9bd50c7sm6244417pjt.50.2022.11.27.12.36.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Nov 2022 12:36:36 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300649 Archived-At: On 11/25/2022 7:36 PM, Max Nikulin wrote: > On 25/11/2022 23:57, Stefan Monnier wrote: >> - you can check the `display` parameter of the selected frame (should >>    handle the `emacsclient --display` case). > >     emacsclient --display "$DISPLAY" \ >         --eval "(frame-parameter (selected-frame) 'display)" > > may be a workaround, thank you for the idea. A caveat is that --display > parameter becomes mandatory, DISPLAY environment is not enough... Looking through the emacsclient.c code, I think this is intentional, and if you want to do something like this, the above workaround is exactly what you're supposed to do: If the -c option is used (without -t) and no --display argument is provided, try $DISPLAY. Without the -c option, we used to set 'display' to $DISPLAY by default, but this changed the default behavior and is sometimes inconvenient. So we force users to use "--display $DISPLAY" if they want Emacs to connect to their current display.