From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Alex Hutcheson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jan 2017 22:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 25496@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148495157929344 (code B ref -1); Fri, 20 Jan 2017 22:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jan 2017 22:32:59 +0000 Received: from localhost ([127.0.0.1]:36722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUhju-0007dE-VH for submit@debbugs.gnu.org; Fri, 20 Jan 2017 17:32:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <3DJCCWA0KDQEbmfyivudiftpohpphmf.dpncvh-hov-fnbdthov.psh@flex--alexhutcheson.bounces.google.com>) id 1cUhjt-0007d2-TA for submit@debbugs.gnu.org; Fri, 20 Jan 2017 17:32:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <3DJCCWA0KDQEbmfyivudiftpohpphmf.dpncvh-hov-fnbdthov.psh@flex--alexhutcheson.bounces.google.com>) id 1cUhjn-00082r-DB for submit@debbugs.gnu.org; Fri, 20 Jan 2017 17:32:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35107) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <3DJCCWA0KDQEbmfyivudiftpohpphmf.dpncvh-hov-fnbdthov.psh@flex--alexhutcheson.bounces.google.com>) id 1cUhjn-00082c-9i for submit@debbugs.gnu.org; Fri, 20 Jan 2017 17:32:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <3DJCCWA0KDQEbmfyivudiftpohpphmf.dpncvh-hov-fnbdthov.psh@flex--alexhutcheson.bounces.google.com>) id 1cUhjl-0006Lt-OJ for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2017 17:32:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <3DJCCWA0KDQEbmfyivudiftpohpphmf.dpncvh-hov-fnbdthov.psh@flex--alexhutcheson.bounces.google.com>) id 1cUhjk-00080m-4q for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2017 17:32:49 -0500 Received: from mail-yb0-x24a.google.com ([2607:f8b0:4002:c09::24a]:35711) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <3DJCCWA0KDQEbmfyivudiftpohpphmf.dpncvh-hov-fnbdthov.psh@flex--alexhutcheson.bounces.google.com>) id 1cUhjj-0007zT-Vi for bug-gnu-emacs@gnu.org; Fri, 20 Jan 2017 17:32:48 -0500 Received: by mail-yb0-x24a.google.com with SMTP id 188so733079ybe.2 for ; Fri, 20 Jan 2017 14:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to; bh=hvgifvo57gjE7ScKXEUuuEArysBjrMPcBn+NBlG1vhw=; b=pmKEBuIrecbL9ZclsDWONDzk3FgewZFi2ZRSMiMhTph4bBJr9sEdxsqp3CZPYhqLHU VoK545L/49qvnqgf9eZaDQgS1va3rbEfXLN04SNwSnM7J9sVJ15QwI2Y5V3WkcHbhLk9 snWbE6CdvxIJjSzhAWGAm09jrhDOhcGGQq2G+xIcLHAdAN+21ZMLc1WQewT6sXZyMLTQ v04uaRvVzKzmM2K8QsqrBI1m7IZV482oq81iUrfcpnjOzImcZh2yqAlGFGhbiy0M0ztk gUsYbtKswAl/2Nf36eqM1dWFZuVCG28aUxnupYmVOTWmKFngYXma53l/Ly6epvny15Gr iZRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to; bh=hvgifvo57gjE7ScKXEUuuEArysBjrMPcBn+NBlG1vhw=; b=jOUqFHmJC95sAlBkzqQod6lPbCAEq5SubkImIfiME3vupqlvfwguCYmdJffj1m8nq+ zwK8useWuvSKY5bpw7mTcS0jbYBTCPN+WsnI/mKBxYDF65a2LNvBqKI5dtf9Mf1hl5x7 2pWE/Nq7RX0ZyICL0oQ3bxB5T6bsxB502JYy3mNZf+JQqR6iJBqrIjZctsSVn9H5ONtd DmBNPWAQ+cOjH60Da/FbO8WdxJs4PhL0FvAZIoDNmQUMkHovPvcQiVs1eGdFLPHOEc1P wiSut78rottGjDA80br3FIhF6iN55Gl+rN9T0CFOvxehq4pUSA33RfqR7tzQ9ynlu5V8 b8Iw== X-Gm-Message-State: AIkVDXIRk3DUKY5ewY9k77t9HKEUNxVPII2lsjyasyXS83ebZ/8d3pPtDVoIvoiR0V3OUDXGbFjmWE1DmATTYVCkaQ9960uFIsZUDvedTvU9MvjaOfryCZKQFfRv+sBiTjIp1nBq1cwjXx1hFYp8Lt64nNXMvL4YR9TaOojU45XYvFWbXUOJuochh51dComgHsW7ZwY8aA== X-Received: by 10.129.124.196 with SMTP id x187mr5375506ywc.139.1484951564933; Fri, 20 Jan 2017 14:32:44 -0800 (PST) Date: Fri, 20 Jan 2017 17:32:44 -0500 Message-Id: Mime-Version: 1.0 From: Alex Hutcheson Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) The INSIDE_EMACS environmental variable is set for comint processes, including M-x shell and ansi-term. However, it's not set for eshell or for processes launched by eshell. This makes it difficult for scripts to detect whether or not they are being run inside eshell. The INSIDE_EMACS env variable should be set within eshell, or should at least be set for processes launched by eshell. In GNU Emacs 25.1.91.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars), modified by Debian Windowing system distributor 'The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04 LTS Configured using: 'configure --build x86_64-linux-gnu --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/google-emacs:/etc/emacs:/usr/local/share/emacs/25.1.91+gg1+1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1.91+gg1+1/site-lisp:/usr/share/emacs/site-lisp --with-crt-dir=/usr/lib/x86_64-linux-gnu --disable-build-details --disable-silent-rules --with-modules GOOGLE_VERSION=25.1.91+gg1+1 --with-x=yes --with-x-toolkit=lucid --with-toolkit-scroll-bars --without-gconf --without-gsettings build_alias=x86_64-linux-gnu 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-fuse-ld=gold,--export-dynamic-symbol=__google_auxv' 'CPPFLAGS=-D_FORTIFY_SOURCE=2 -DGOOGLE_EMACS_DEFINE_AUXV'' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 MODULES Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction 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 font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. 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 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 font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 87104 6318) (symbols 48 19929 0) (miscs 40 51 110) (strings 32 15098 4711) (string-bytes 1 425436) (vectors 16 11832) (vector-slots 8 435700 4672) (floats 8 168 31) (intervals 56 262 0) (buffers 976 19) (heap 1024 12629 768)) From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Jan 2017 20:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alex Hutcheson Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.148520284530998 (code B ref 25496); Mon, 23 Jan 2017 20:21:02 +0000 Received: (at 25496) by debbugs.gnu.org; 23 Jan 2017 20:20:45 +0000 Received: from localhost ([127.0.0.1]:39439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVl6b-00083t-Gi for submit@debbugs.gnu.org; Mon, 23 Jan 2017 15:20:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVl6a-00083c-PT for 25496@debbugs.gnu.org; Mon, 23 Jan 2017 15:20:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVl6U-0006aR-RA for 25496@debbugs.gnu.org; Mon, 23 Jan 2017 15:20:39 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVl6Q-0006Z5-O3; Mon, 23 Jan 2017 15:20:34 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cVl6P-0000BR-5b; Mon, 23 Jan 2017 15:20:33 -0500 From: Glenn Morris References: X-Spook: Lon Horiuchi Forest fire IED AUTODIN Mena Recall X-Ran: J8-zj^c:d{I1jO_"e81U2f(o#jJTkT`THZUc,fGB4L2j*83h' X-Hue: red X-Attribution: GM Date: Mon, 23 Jan 2017 15:20:33 -0500 In-Reply-To: (Alex Hutcheson's message of "Fri, 20 Jan 2017 17:32:44 -0500") Message-ID: <9937g934vi.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain 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-Spam-Score: -8.2 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) Alex Hutcheson wrote: > The INSIDE_EMACS environmental variable is set for comint processes, > including M-x shell and ansi-term. However, it's not set for eshell or > for processes launched by eshell. This makes it difficult for scripts to > detect whether or not they are being run inside eshell. Could you give some examples of where this matters? It never has been set for eshell, AFAIK. When I think of INSIDE_EMACS usage, the only thing that comes to mind is interactive bash, which obviously isn't relevant for eshell (as a bash replacement). > The INSIDE_EMACS env variable should be set within eshell, or should at > least be set for processes launched by eshell. From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Alex Hutcheson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Jan 2017 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.148520380532454 (code B ref 25496); Mon, 23 Jan 2017 20:37:02 +0000 Received: (at 25496) by debbugs.gnu.org; 23 Jan 2017 20:36:45 +0000 Received: from localhost ([127.0.0.1]:39445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVlM4-0008RO-VY for submit@debbugs.gnu.org; Mon, 23 Jan 2017 15:36:45 -0500 Received: from mail-qt0-f170.google.com ([209.85.216.170]:35842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVlM3-0008RB-CJ for 25496@debbugs.gnu.org; Mon, 23 Jan 2017 15:36:43 -0500 Received: by mail-qt0-f170.google.com with SMTP id k15so145361295qtg.3 for <25496@debbugs.gnu.org>; Mon, 23 Jan 2017 12:36:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0nSaXrDSFaptGJhWtJPsyYw4G6kAhKEgh0mYpeoSatE=; b=l3TukoYRMJthHtVuP+0Se4doS/0nsDjZWkHLpmv8os0LwE8ooOBBMyd1OLP9n/axgV 0wtNrgW4zXcjC24xiBdso0ath+IebFfJiAC6TH4hqoO3YlI0drI16S35npAG9ckI+CSG XTzhdc/Tb3DnxRbsdGZW0/WbfpPhncuDh8lBtf0lKGVuCunJhCWnhQOIC3bBdoNYV5M4 7P1pmPjjWmV1cEhlitlSHw08r77JfNV60ZUkrb6bJonotlI7hqeL/EzeQzCmTervzjQx O3txPpFcr7R4puPjxipCgmYm1pRfRZ/KU7wDgWn5xZc6yOou2ybU8ZhjFicm15UsIsCt jYTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0nSaXrDSFaptGJhWtJPsyYw4G6kAhKEgh0mYpeoSatE=; b=kKGPNT+1TsSJr1RVKCj0nmKxP95FC8px3gGH0UmEgABxBoGZ3zHDEdNyWibNKyFUg+ mxBzrtZPj1hmVA9AGL85u7PVpWRnbmgeN/X2zYpZhX0+0qxNxkkcy+KPhn4EGAPta3hc qU+g4vd01KQhZd9myAyNx7ToxAJAL4dCOs/UFKTcplYSS5MZXdmq3RsEdkfGO2gNVM3F 0qryNMDwVzFYpOt2EQgJeGHSgCImLJ1jtP0bnI1HRwZO00yPAL1sJ3hvNKZHJJyiOryC lv5bKX/OFlgQdxuS9teJCcx9NiT2FQVq+sPOlRrg+HkLhfklK1VaF8F3fu9IAGv7fQ2+ iThg== X-Gm-Message-State: AIkVDXKBPNW2pJE/3yGYo8GlejtCSCWlOrw6ARgRZlzjt0X9A+Idg+SZIeJuDETIslF0hXHETTkIT44ie5SbuUHL X-Received: by 10.55.164.85 with SMTP id n82mr27261645qke.316.1485203797482; Mon, 23 Jan 2017 12:36:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.38.101 with HTTP; Mon, 23 Jan 2017 12:36:17 -0800 (PST) In-Reply-To: <9937g934vi.fsf@fencepost.gnu.org> References: <9937g934vi.fsf@fencepost.gnu.org> From: Alex Hutcheson Date: Mon, 23 Jan 2017 15:36:17 -0500 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.4 (---) > Could you give some examples of where this matters? > It never has been set for eshell, AFAIK. Here's the case I'm running into: Some command line programs that I work with (version control systems, as well as other scripts) allow the user to specify a merge tool that gets called for merge conflicts. I prefer to use ediff as my merge tool, so I have a simple bash script that launches emacsclient and calls ediff with the appropriate arguments. My desired behavior is this: if INSIDE_EMACS: Run an ediff session within the existing Emacs instance else: Create a new frame and launch the ediff session in that I frequently work by SSHing into my workstation and using emacsclient to connect to the Emacs instance running on the workstation. I run all my shell commands in M-x shell or eshell. If I run `emacsclient -c' in one of these shells, it creates a graphical frame on my workstation's desktop, which I can't see over SSH. Instead, I check for INSIDE_EMACS, and if I detect that my shell is running within Emacs I call emacsclient without -c. On Mon, Jan 23, 2017 at 3:20 PM, Glenn Morris wrote: > Alex Hutcheson wrote: > >> The INSIDE_EMACS environmental variable is set for comint processes, >> including M-x shell and ansi-term. However, it's not set for eshell or >> for processes launched by eshell. This makes it difficult for scripts to >> detect whether or not they are being run inside eshell. > > Could you give some examples of where this matters? > It never has been set for eshell, AFAIK. > > When I think of INSIDE_EMACS usage, the only thing that comes to mind is > interactive bash, which obviously isn't relevant for eshell (as a bash > replacement). > >> The INSIDE_EMACS env variable should be set within eshell, or should at >> least be set for processes launched by eshell. -- Alex Hutcheson alexhutcheson@google.com From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 24 13:21:05 2020 Received: (at control) by debbugs.gnu.org; 24 Feb 2020 18:21:06 +0000 Received: from localhost ([127.0.0.1]:54054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j6ILp-0003if-Mu for submit@debbugs.gnu.org; Mon, 24 Feb 2020 13:21:05 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:37711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j6ILo-0003ho-Ia for control@debbugs.gnu.org; Mon, 24 Feb 2020 13:21:05 -0500 Received: by mail-qt1-f180.google.com with SMTP id w47so7216913qtk.4 for ; Mon, 24 Feb 2020 10:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=43V7Thk5BWWC98Bmjah0+C2WF/vBlOpaMTcG4/Bf7Zo=; b=P9P3rB7MY0yGsYYFWOpmu7Dvj52QpVCSDAVOTRZNl8O+MJY1vDrpr3iS6/P1c3ysnh +yAI/4pZNZFKVxmv9HjAzq36nTe81ahNOih0pS3yRCMfq0iC9kgMh9aTfnAJxP2UtRhu E6zYImj/ZM7H6z6yFDeHAui00AT4QL0W3hB9UuxcECywVZrcEaf3/Sih6OC1H7WeWa8r y6XnuUlFzDT5OMfZGW8+PLjXkBVw13D5dcvjRb9NP6Ve0s38Du712tfkACneinGIRaIN 9a7ytDFVVJ5t56vmuscTQqCXbbBHIYKtl0hTKlV/akmmpS8I9XLaGeQvdoca1RGYiehS tQQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=43V7Thk5BWWC98Bmjah0+C2WF/vBlOpaMTcG4/Bf7Zo=; b=o4WwuJ28yWKADJveIodQHl+AkSnAEiD9+V+9DXSB3yRM6Cr3UZAOj8HbAB/X3RBvk/ w7CRi9HkvRO42lp6ZzTUecMVoobL6GiVTRZtafJHU56F4AZkeK4RP+zYUdjGr9A/8uB6 OvNkCHGTyXgw1ZMWJdhec9nqDG2TE6d0snlTcAYrCrYYaIVM7dHCEmOR4ONTl5i4Gg5a trmTayacR/dDIKDXHA50s9nFkYdz6mHigF3fcvx1s6t+ifH7RSV6HkYLvLvE7+nHXJDI qXcNPO4MCD9O40oGKaz/Lq98D40yI7nQdFX/G3l2duojeWsiF5THlxsZ05tg3QL+arap Kkqw== X-Gm-Message-State: APjAAAVLTlV169tXjzd+qgsXqhJkMTeZhdxPrDL9o6GkoASLcGfJs8ca Zf0vEByEnK8faPuVs7+yjBRfsu81seQ= X-Google-Smtp-Source: APXvYqy3AVtR3qwe163xMeGisMnMMj0lcOWW6hL62aZQOj5hPxmkR/TbuLcBC+SJ8FNMxuUmibHa4w== X-Received: by 2002:ac8:108:: with SMTP id e8mr49600637qtg.101.1582568459001; Mon, 24 Feb 2020 10:20:59 -0800 (PST) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42]) by smtp.gmail.com with ESMTPSA id e64sm6275117qtd.45.2020.02.24.10.20.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 10:20:58 -0800 (PST) From: Noam Postavsky To: control@debbugs.gnu.org Subject: control message for bug #25496 Date: Mon, 24 Feb 2020 13:20:59 -0500 Message-ID: <85o8tnaltg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 39596 + patch forcemerge 25496 39596 quit From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell References: In-Reply-To: Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Mar 2020 16:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.158368626129977 (code B ref 25496); Sun, 08 Mar 2020 16:52:01 +0000 Received: (at 25496) by debbugs.gnu.org; 8 Mar 2020 16:51:01 +0000 Received: from localhost ([127.0.0.1]:49220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAz8n-0007nN-7V for submit@debbugs.gnu.org; Sun, 08 Mar 2020 12:51:01 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:36644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAz8l-0007nA-FW for 25496@debbugs.gnu.org; Sun, 08 Mar 2020 12:50:59 -0400 Received: by mail-wm1-f48.google.com with SMTP id g62so2796828wme.1 for <25496@debbugs.gnu.org>; Sun, 08 Mar 2020 09:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=QwZEE6z/53nx+zUrgUfuD+yILEuDNQP3Aavrfq1xzHY=; b=Yx7uV5cJyQi8oh5dvMxUAKjiJV/grWXaNRcZZnBZTC5iNLIsWq2CqWhJaDMzPQYP7c 98EmvDREs1KHvuL2LyxOuxTjjaRvJ9cQeVQ1fypy6vgWI/6uNC3r8wden3eL8vzYSrte j7ixIIpE1X28TO8I3Lwyz5eB0pDRyDyvTK6gUmnGcvCa39J8+C8650Sp+EfRNjEkihlY SoD1bFPNz7Wrnm5RRQuU2lUbtJLqP9xIQALk9/uDpTcFVAvPt0n2XUa6hb74ni0gqtK3 Ija1BkCnu7sdxDTna2JFuN+f+a9G673kBkIZQgafhpSGO5PEHMJaKA53RAwthHInJD+A gtaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=QwZEE6z/53nx+zUrgUfuD+yILEuDNQP3Aavrfq1xzHY=; b=PG98x5jvDv2ONSKGIpVbWz+x2MOcuW/n/i7KX1OjOgCaiVwn5F45SvSOs04H5tX+JI anblFSEHvLiZ+T4VhA+uBI+3i4e7C13uH0l/UVqWBP6UyAwSgH5HXCIEktSDXBRefNTL 1FE3+TaZaDbVnpXniiU4UbBEwlEGk37b2iI0e7eX0AmFXHE3tdHGKkBgMoxzSiAejnbj JcMBm4FzJob2ZZbvRn1W7jZKZU4dT6EIXhdW+zUKfLDIoSDvbK0OL4PjEoJkKDAj9MWu 7YyGBZkQvi5sk3igR5dpW71Wf9QyyRkNEd0KuPQPfa/2tqDeYC+4YBlMd9eXCxIlgOM4 GIYA== X-Gm-Message-State: ANhLgQ001kC0fWGDy5PmWP8E9F6ioofU6o2a17Kc/m8TLC6cpIP6DmGX kVVs5OmdeN0cSUmcmbV/hv7eLTNucss= X-Google-Smtp-Source: ADFU+vvLXyKzEJY0vnvKurEbTWsN7O2TpXsQjIn0nAb3CMECpnFUkbZvunL0k6KSIf0ZjVSb3j38yw== X-Received: by 2002:a7b:c1cf:: with SMTP id a15mr16643265wmj.152.1583686253172; Sun, 08 Mar 2020 09:50:53 -0700 (PDT) Received: from BERMB00016 ([2a02:8109:8ac0:2ff0:3993:e710:f57a:e4fb]) by smtp.gmail.com with ESMTPSA id u17sm34032615wrq.74.2020.03.08.09.50.52 for <25496@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Mar 2020 09:50:52 -0700 (PDT) From: Federico Tedin Date: Sun, 08 Mar 2020 17:50:51 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Didn't realize that Bug#39596 was merged with this one, I'll attach my patch here just in case. - Fede --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Copy-INSIDE_EMACS-env-variable-to-subprocesses-in-Es.patch >From cf93960de7d3d92ccb7a5465851bbcb55a0f20d9 Mon Sep 17 00:00:00 2001 From: Federico Tedin Date: Wed, 19 Feb 2020 00:11:35 +0100 Subject: [PATCH] Copy INSIDE_EMACS env variable to subprocesses in Eshell * lisp/eshell/em-dirs.el (eshell-dirs-initialize): Add INSIDE_EMACS variable to buffer-local value of eshell-variable-aliases-alist. * lisp/eshell/esh-var.el (eshell-variable-aliases-list): Update doc string; remove mention of eshell-user-aliases-list and explain that variables can optionally be copied to subprocesses' environments. * test/lisp/eshell/eshell-tests.el (eshell-test/inside-emacs-var): Add test for the INSIDE_EMACS variable. * etc/NEWS: Announce changes. --- etc/NEWS | 6 ++++++ lisp/eshell/em-dirs.el | 3 +++ lisp/eshell/esh-var.el | 11 ++++++----- test/lisp/eshell/eshell-tests.el | 9 ++++++++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1f8e6049a8..238184df24 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -120,6 +120,12 @@ To revert to the previous behaviour, unconditionally aborts the current edebug instrumentation with the supplied error message. +** Eshell + +--- +*** Environment variable INSIDE_EMACS is now copied to subprocesses. +Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'. + ** Tramp +++ diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 1949e5dc8f..b478ee028a 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -191,6 +191,9 @@ eshell-dirs-initialize (unless (ring-empty-p eshell-last-dir-ring) (expand-file-name (ring-ref eshell-last-dir-ring 0)))) + t) + ("INSIDE_EMACS" ,(lambda (_indices) + (format "%s,eshell" emacs-version)) t)))) (when eshell-cd-on-directory diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 327a1def46..4231be92fb 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -179,10 +179,8 @@ eshell-variable-aliases-list (eshell-apply-indices eshell-command-arguments indices))))) "This list provides aliasing for variable references. -It is very similar in concept to what `eshell-user-aliases-list' does -for commands. Each member of this defines the name of a command, -and the Lisp value to return for that variable if it is accessed -via the syntax `$NAME'. +Each member of this defines the name of a command, and the Lisp value +to return for that variable if it is accessed via the syntax `$NAME'. If the value is a function, that function will be called with two arguments: the list of the indices that was used in the reference, and @@ -190,7 +188,10 @@ eshell-variable-aliases-list For example, a reference of `$NAME[10][20]' would result in the function for alias `NAME' being called (assuming it were aliased to a function), and the arguments passed to this function would be the list -'(10 20)', and nil." +'(10 20)', and nil. + +Additionally, each member may specify if it should be copied to the +environment of created subprocesses." :type '(repeat (list string sexp (choice (const :tag "Copy to environment" t) (const :tag "Use only in Eshell" nil))))) diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 026818ab06..f98e4ce92b 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -167,7 +167,14 @@ eshell-test/last-arg-var "Test using the \"last arg\" ($_) variable" (with-temp-eshell (eshell-command-result-p "+ 1 2; + $_ 4" - "3\n6\n"))) + "3\n6\n"))) + +(ert-deftest eshell-test/inside-emacs-var () + "Test presence of \"INSIDE_EMACS\" in subprocesses" + (with-temp-eshell + (eshell-command-result-p "env" + (format "INSIDE_EMACS=%s,eshell" + emacs-version)))) (ert-deftest eshell-test/escape-nonspecial () "Test that \"\\c\" and \"c\" are equivalent when \"c\" is not a -- 2.21.1 (Apple Git-122.3) --=-=-=-- From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Mar 2020 15:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Federico Tedin Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.158540795630214 (code B ref 25496); Sat, 28 Mar 2020 15:06:02 +0000 Received: (at 25496) by debbugs.gnu.org; 28 Mar 2020 15:05:56 +0000 Received: from localhost ([127.0.0.1]:34923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jID24-0007rF-Dz for submit@debbugs.gnu.org; Sat, 28 Mar 2020 11:05:56 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:39095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jID22-0007r2-Re for 25496@debbugs.gnu.org; Sat, 28 Mar 2020 11:05:55 -0400 Received: by mail-wm1-f41.google.com with SMTP id e9so4008722wme.4 for <25496@debbugs.gnu.org>; Sat, 28 Mar 2020 08:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=fjk2MvlcKq3BAmqiMn5vhk1UU26hygDjAGD3uORCbrg=; b=hTIIZiajNnO/hzFlVDjNVPvEnnr7JinreND9Ee+gKvveV2AzwuZk8uj8zmEYT/G/Ob xg5aT2IBxsd+1DVVXP26Rm+THCCr/ywwWa8mp6/9+H4a/HoAFVedDX3gg071FqlIMeKE ReyiQr96P0hy01rdCJO0snhSc5XPw0f0rpokr2sXVslUx7lzqmlqKVRCw4ABQHUBc8NB D/TdiVi9l1viJzoiv4ifKbqyAGOt4CK1fyyfqHIkoQKZc5XOePZprnAQ/WPukroJ4yEp dqyPtjUzD++YTDXZRTiYFswzBuDN63GY1T5CtwYOSSdsT58PVCylfwGAtc/QmK6oAKY5 VwDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=fjk2MvlcKq3BAmqiMn5vhk1UU26hygDjAGD3uORCbrg=; b=p2FM5bjF8c4pdAkRIlMYzuJWttUBBmwo4bNrdHDdVT6VbRURoH2U7agYCJwMfKg9hu 6R/agrBiT2fR6NQuIXrvkE5vs698hXtFkoVMssXqDyRGMJ17Vs/ZobdlN6GMF0+VshKk c8gd/Vf3XnXpIBfTJCnsev76B242nn4Qw6A+jXFv3Wc3XN3KUDkQMm2FdLmppjT+X96T YXAOZ3KII/C5xd1qO1n/43/s6WRR77AFIzMiCWO2pSrmyf8vyEsiCSSIKHEsADQEcz2v iiy/Q3UAXvQQDZFvKbcacsQcIpO9mv5/JUCs9pD62basaejbaSR5PcS12K1ypcLK6dj6 Elqg== X-Gm-Message-State: ANhLgQ2IS83tORfcfH3vmUrHzADKfpepexiYLAyA+97TTltpexc1RAwO gu28MWSh4Tc1tEhkpv+B2xNMTX7uE5E= X-Google-Smtp-Source: ADFU+vud0+zGWHDzq+Oj69mTVnh1j1kLeJP25cGZEg2IJ4p0wWkKG8PwRBMnEahEPDb6VcGjegmlTQ== X-Received: by 2002:a05:600c:228f:: with SMTP id 15mr4392564wmf.140.1585407948658; Sat, 28 Mar 2020 08:05:48 -0700 (PDT) Received: from BERMB00016 ([2a02:8109:8ac0:2ff0:1555:88bb:9e6d:2ca5]) by smtp.gmail.com with ESMTPSA id l10sm12825126wrq.95.2020.03.28.08.05.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Mar 2020 08:05:48 -0700 (PDT) From: Federico Tedin References: Date: Sat, 28 Mar 2020 16:05:47 +0100 In-Reply-To: (Federico Tedin's message of "Sun, 08 Mar 2020 17:50:51 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Federico Tedin writes: > Didn't realize that Bug#39596 was merged with this one, I'll attach my > patch here just in case. > > - Fede Pinging this thread again in case a maintainer can take a look at the patch I submitted on my last message. Thanks! From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Mar 2020 22:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.158552100624550 (code B ref 25496); Sun, 29 Mar 2020 22:31:02 +0000 Received: (at 25496) by debbugs.gnu.org; 29 Mar 2020 22:30:06 +0000 Received: from localhost ([127.0.0.1]:60046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIgRS-0006Ng-2o for submit@debbugs.gnu.org; Sun, 29 Mar 2020 18:30:06 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:54111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIgRP-0006MX-OK for 25496@debbugs.gnu.org; Sun, 29 Mar 2020 18:30:04 -0400 Received: by mail-wm1-f47.google.com with SMTP id b12so17832315wmj.3 for <25496@debbugs.gnu.org>; Sun, 29 Mar 2020 15:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=gTr/yeELq4C0+FD/HxLsTQ8T7A4JFpSGIPQJawzBW24=; b=AA7BmPv8RIcCuC02Gf5yHgGWYLr5piM++mjY086lnx2aVBnABZ6OveZn9jI+Gc2KnZ R+kprFDzovYrRydWXbbtKtAwXLIR+bw1hilYmKlTcutXkfhvQZcFo0APtVHp078g/vg7 k2tJp1aCcu1AUUfmOdvkHj1QgQDrcOTlqty/nBmWG1CkYiTd67LwfdvReHGPGvpMsJ7m tDOHgmZr3MyJqDzx8Uo3szlNeI2qn011ck8OyyMOHF4ju5MMfLTKdehbVKVgHWdV00Ph Tgdvlk8QjiBIsdBkBnUJLEru8XVI33qh3HERVG65I7gDBREEA5D4tWW6lUKQqph8XlTL P+sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=gTr/yeELq4C0+FD/HxLsTQ8T7A4JFpSGIPQJawzBW24=; b=Fq2ImUPTMnlcgSyde1S00Bv3IrNeAtg7T5zsCl4ng9JrUYmgtoGJMc3tEz81Lu8r35 LOU41vtFwDn81ANxKA1qmQY29b3zFCs3TGo8WFmvK5NJ65bbkXu/PRNB6V5egi5n04Dk fm4WyYDuGuppaK8N99isd7hMb7jXOgip1Rh81CeuxANhGOBVI7KUTPnKBrlwOUDn7Xgb W2VSbF0MO3bVC8Ac/c69NO/xbzy3DNBvMbuLqikL2yLXzj5EP7S2hHzkD1EKgyRI31kh u7eBDn2O/LiBIBWFmRjbXHUe7/u1rrRH4A3EZEKYj7v9PTe6H4Db2lgINRfYSugv5zPs C3rg== X-Gm-Message-State: ANhLgQ3ZHERp5uGES3XytIFG9Lwyr8oPJChTo/OBHESEpVQtM610/m+W Nh6X3pxNWp3lDCj7Qoq+SseVFumsaZs= X-Google-Smtp-Source: ADFU+vsWg4zVp4pIGGV1LFl9etFyHmvUyyhmO6y1+oW4M26z0Hxd12a3ck3oCGKK1/l4M+E4rQ/yew== X-Received: by 2002:a05:600c:54d:: with SMTP id k13mr10010433wmc.81.1585520997601; Sun, 29 Mar 2020 15:29:57 -0700 (PDT) Received: from lead ([2a02:8109:8ac0:2ff0:a589:bad3:938d:7bac]) by smtp.gmail.com with ESMTPSA id v186sm12056699wme.24.2020.03.29.15.29.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Mar 2020 15:29:56 -0700 (PDT) From: Federico Tedin References: <87zhc0huyn.fsf@gmail.com> Date: Mon, 30 Mar 2020 00:29:55 +0200 In-Reply-To: <87zhc0huyn.fsf@gmail.com> (Noam Postavsky's message of "Sat, 28 Mar 2020 20:21:20 -0400") Message-ID: <874ku6yeu4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Thanks for the feedback! I've removed the lambda, but I wasn't able to use a string directly, I had to set the value elsewhere using a defconst. This is due to how `eshell-get-variable' interprets string values associated to variables. I'm attaching a new patch. Thanks --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Copy-INSIDE_EMACS-env-variable-to-subprocesses-in-Es.patch >From bc6319ca49241c9e270ba0b6f939766dcf078e25 Mon Sep 17 00:00:00 2001 From: Federico Tedin Date: Mon, 30 Mar 2020 00:22:27 +0200 Subject: [PATCH] Copy INSIDE_EMACS env variable to subprocesses in Eshell * lisp/eshell/em-dirs.el (eshell-dirs-initialize): Add INSIDE_EMACS variable to buffer-local value of eshell-variable-aliases-alist. (eshell-inside-emacs): Add new constant used for INSIDE_EMACS. * lisp/eshell/esh-var.el (eshell-variable-aliases-list): Update doc string; remove mention of eshell-user-aliases-list and explain that variables can optionally be copied to subprocesses' environments. * test/lisp/eshell/eshell-tests.el (eshell-test/inside-emacs-var): Add test for the INSIDE_EMACS variable. * etc/NEWS: Announce changes. --- etc/NEWS | 6 ++++++ lisp/eshell/em-dirs.el | 5 +++++ lisp/eshell/esh-var.el | 11 ++++++----- test/lisp/eshell/eshell-tests.el | 7 +++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 4b477e5def..9ac90ecabf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -161,6 +161,12 @@ functions accessible to the user through the existing single function hook Modes should use the new hook instead of this user option to register their backends. +** Eshell + +--- +*** Environment variable INSIDE_EMACS is now copied to subprocesses. +Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'. + ** Tramp +++ diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 1949e5dc8f..51df6fa1d5 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -168,6 +168,9 @@ eshell-dirstack (defvar eshell-last-dir-ring nil "The last directory that Eshell was in.") +(defconst eshell-inside-emacs (format "%s,eshell" emacs-version) + "Value for the `INSIDE_EMACS' environment variable.") + ;;; Functions: (defun eshell-dirs-initialize () ;Called from `eshell-mode' via intern-soft! @@ -191,6 +194,8 @@ eshell-dirs-initialize (unless (ring-empty-p eshell-last-dir-ring) (expand-file-name (ring-ref eshell-last-dir-ring 0)))) + t) + ("INSIDE_EMACS" eshell-inside-emacs t)))) (when eshell-cd-on-directory diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 327a1def46..0f23e61e33 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -179,10 +179,8 @@ eshell-variable-aliases-list (eshell-apply-indices eshell-command-arguments indices))))) "This list provides aliasing for variable references. -It is very similar in concept to what `eshell-user-aliases-list' does -for commands. Each member of this defines the name of a command, -and the Lisp value to return for that variable if it is accessed -via the syntax `$NAME'. +Each member defines the name of a variable, and the Lisp value to +return for that variable if it is accessed via the syntax `$NAME'. If the value is a function, that function will be called with two arguments: the list of the indices that was used in the reference, and @@ -190,7 +188,10 @@ eshell-variable-aliases-list For example, a reference of `$NAME[10][20]' would result in the function for alias `NAME' being called (assuming it were aliased to a function), and the arguments passed to this function would be the list -'(10 20)', and nil." +'(10 20)', and nil. + +Additionally, each member may specify if it should be copied to the +environment of created subprocesses." :type '(repeat (list string sexp (choice (const :tag "Copy to environment" t) (const :tag "Use only in Eshell" nil))))) diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 026818ab06..ce8d728833 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -169,6 +169,13 @@ eshell-test/last-arg-var (eshell-command-result-p "+ 1 2; + $_ 4" "3\n6\n"))) +(ert-deftest eshell-test/inside-emacs-var () + "Test presence of \"INSIDE_EMACS\" in subprocesses" + (with-temp-eshell + (eshell-command-result-p "env" + (format "INSIDE_EMACS=%s,eshell" + emacs-version)))) + (ert-deftest eshell-test/escape-nonspecial () "Test that \"\\c\" and \"c\" are equivalent when \"c\" is not a special character." -- 2.17.1 --=-=-=-- From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Mar 2020 01:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Federico Tedin Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.158553268011771 (code B ref 25496); Mon, 30 Mar 2020 01:45:01 +0000 Received: (at 25496) by debbugs.gnu.org; 30 Mar 2020 01:44:40 +0000 Received: from localhost ([127.0.0.1]:60103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIjTk-00033n-1D for submit@debbugs.gnu.org; Sun, 29 Mar 2020 21:44:40 -0400 Received: from mail-qk1-f171.google.com ([209.85.222.171]:40229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jIjTi-00033Z-5e for 25496@debbugs.gnu.org; Sun, 29 Mar 2020 21:44:38 -0400 Received: by mail-qk1-f171.google.com with SMTP id l25so17477754qki.7 for <25496@debbugs.gnu.org>; Sun, 29 Mar 2020 18:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=9Hjq4zcbLboDnm733QMzjhzAiMg1TOEHCHrszEeujCs=; b=a/Nl2OngzhIgu7jMH7nH+xzkZMTEypY1xea9KpLQDqWB6S5Dy3g8J+arZHY7emMmJf LcFYzrlYqej/BwfkHKewW55jdbsKmdEFShiQjQ1f9gi+U+H+6V37E6t5WLETnve/gKGy bswlfBA+xo+FRFZWmCI1lWUSaOKJVXY5UMz/VLQaknZ8phY8nJdcDfjNlh/7hMNw26h5 LevP3d8PUZH73Qe0mfkg9fwErSC3ADXaYONhvgCO5lgLtmf++egez8Fi+4rfBBmdUvDp egLs94tugsHOnpb/0cNXdYsUG7lVFZ7XH1Upt5lLlV1NLiAb1vDmXNv5MHi1LFVCF2PH vFdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=9Hjq4zcbLboDnm733QMzjhzAiMg1TOEHCHrszEeujCs=; b=ZTETojoPDrJR6cWcq+ZKpFdtm/Uz6hDFX+FlbU1VACo0mPCTH9mlUcz9s5+mt2XTMT mSdJxCMgyc1JOTqOitrmkcZ40A/n3ufHOfROeDMP5/dsbkEB4fhdvIxXHtMolOgPNNLe DL+O9XHGROjKM03ZPLWBeJ1s4PGEDJ1A9G/hfxgBUx8tm736+qJiRuz8aKigHK4T4GRw nj3iLkOrEpxy2bvFdlqpYzUoQiRqbLlWQTKqrPVMyPKhmQCYTFZf+EzMOiFlRLOv/ShE lTW7J14krDU6q5mvn2WfyYZTU2xQDT6bfdZbWYCfcgeNlK18MiB34cjF+55dTVgoEwjy nmyg== X-Gm-Message-State: ANhLgQ0U+JqKHliX3aOvhCBGAkS5aqZi/r6krw0OE2FHrEvOT/JnXLu0 zmtHT3mf1zEXuvtNDVMvknojWK1m X-Google-Smtp-Source: ADFU+vtPLnffbeUpp0+8YT7wyQQPqvdC9swpbdwCjJw2PoPNetqMewx6RWeY8sqMRqFU0xZqvecFCA== X-Received: by 2002:a37:6182:: with SMTP id v124mr9702052qkb.320.1585532672309; Sun, 29 Mar 2020 18:44:32 -0700 (PDT) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id x51sm10143379qtj.82.2020.03.29.18.44.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Mar 2020 18:44:31 -0700 (PDT) From: Noam Postavsky References: <87zhc0huyn.fsf@gmail.com> <874ku6yeu4.fsf@gmail.com> Date: Sun, 29 Mar 2020 21:44:30 -0400 In-Reply-To: <874ku6yeu4.fsf@gmail.com> (Federico Tedin's message of "Mon, 30 Mar 2020 00:29:55 +0200") Message-ID: <87sghqipkx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Federico Tedin writes: > I've removed the lambda, but I wasn't able to use a string directly, I > had to set the value elsewhere using a defconst. This is due to how > `eshell-get-variable' interprets string values associated to > variables. Oh, a string is actually taken as an environment variable to alias. I guess that does justify the name. I think we might actually be better off with the lambda, what do you think? > "This list provides aliasing for variable references. > -It is very similar in concept to what `eshell-user-aliases-list' does > -for commands. Each member of this defines the name of a command, > -and the Lisp value to return for that variable if it is accessed > -via the syntax `$NAME'. > +Each member defines the name of a variable, and the Lisp value to > +return for that variable if it is accessed via the syntax `$NAME'. Again, not a problem introduced by your patch, but "Lisp value to return" seem pretty inaccurate (if you don't feel like fixing this, it's okay, I think describing it correctly is somewhat non-trivial). From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Noam Postavsky Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Mar 2020 02:36:24 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Federico Tedin Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.158553573417392 (code B ref 25496); Mon, 30 Mar 2020 02:36:24 +0000 Received: (at 25496) by debbugs.gnu.org; 30 Mar 2020 02:35:34 +0000 Received: from mail-qt1-f179.google.com ([209.85.160.179]:41135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jILhg-0004SU-7F for 25496@debbugs.gnu.org; Sat, 28 Mar 2020 20:21:28 -0400 Received: by mail-qt1-f179.google.com with SMTP id i3so12057214qtv.8 for <25496@debbugs.gnu.org>; Sat, 28 Mar 2020 17:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=KimYZIDfF3Ij4BZvksRExEQT/d9F35aJ26qzz9otFHE=; b=gUfC1hRI74M+RQLRfp3Ui39pkxb9ZjGtlg00nmOC+haU9vRv2EeLaBTvCcVC6/5LCC vGE7Dk8NeSpf7Oqc6PjX32itiwYz2fLl/nUdA0DDvgM6AwjVNLOpTicMz7LbrJDpYuQG MIfyYt9k7dXYcLsdL2FRsxsA6S1ljjlXYW7gg1yobR/uyRbIK6S7u3f46LYGGH8GJzFo jbmC5b5qkXk8m5fp4vYJiMaXpKGsHptR7A/zNG20qEmzKlRhVttC5KcPPnA6y0mPQq5R oLSCdgBvU+1X+32j+yqneLuPp62NT01g8StEt1qTKWc4lHL3poiBYFTdj1xL10FyrO4T bacQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=KimYZIDfF3Ij4BZvksRExEQT/d9F35aJ26qzz9otFHE=; b=cboMxJBQ4Chx/sC9gQYwz4cgNMZbBEGGkhz9th2zMiCLaCtmbsVYI/znYWBigZLAmV r+dVgjwZPeujBwHn1TL2LpJX/KOf35V8j3cK85uPqMLO6AMLeQ/tOfDwVDf+nwNXC6n5 PNwei349oi8RNiP30O7qvBvqhG3ltq+YOBi8IVbxzfiNHcQ9EhbX3b2v0e18xlTEY+zC 5RPWRAYTqCUklWkKa+zkD0FpSw2fiMMF4j/kLz60bGFfxVpo7ztSy7q8hSt1FOE3s69o q60BlkO9OBinTo+nIxCrCvpSTkKg4HTyM19eBuVrJoFoxcPVpeJcCivjPwtov0+7nXq7 ZTgg== X-Gm-Message-State: ANhLgQ3z2OxV/lvR+50SmPyedoWKbO9EcrR8TSwfP+9JP3C4xFMXCPVj 3JOeSqIMLOd58oCasH+wE1G1c7fp X-Google-Smtp-Source: ADFU+vvS8fQVJFk9d1zK7GcVnJNqOzNvhNI0MZU/gV+Mmv5VlNRKSeWmWQjExu44IuAgrfKLkZ0sow== X-Received: by 2002:aed:3ed0:: with SMTP id o16mr5881041qtf.3.1585441281840; Sat, 28 Mar 2020 17:21:21 -0700 (PDT) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id m67sm6848470qke.101.2020.03.28.17.21.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Mar 2020 17:21:21 -0700 (PDT) From: Noam Postavsky References: Date: Sat, 28 Mar 2020 20:21:20 -0400 In-Reply-To: (Federico Tedin's message of "Sun, 08 Mar 2020 17:50:51 +0100") Message-ID: <87zhc0huyn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2020 00:21:28 -0000 Federico Tedin writes: > Pinging this thread again in case a maintainer can take a look at the > patch I submitted on my last message. Thanks for the ping, I had forgotten about this one. > * lisp/eshell/em-dirs.el (eshell-dirs-initialize): Add INSIDE_EMACS > variable to buffer-local value of eshell-variable-aliases-alist. > * lisp/eshell/esh-var.el (eshell-variable-aliases-list): Update doc > string; remove mention of eshell-user-aliases-list and explain that I think eshell-user-aliases-list was meant to refer to eshell-command-aliases-list (though maybe the reference isn't really needed anyway). > + ("INSIDE_EMACS" ,(lambda (_indices) > + (format "%s,eshell" emacs-version)) Since emacs-version generally doesn't change during an Emacs session, is there any need for a lambda at all here? > "This list provides aliasing for variable references. > -It is very similar in concept to what `eshell-user-aliases-list' does > -for commands. Each member of this defines the name of a command, > -and the Lisp value to return for that variable if it is accessed > -via the syntax `$NAME'. > +Each member of this defines the name of a command, and the Lisp value ^^^^^^^ ^^^^^^^ > +to return for that variable if it is accessed via the syntax `$NAME'. (These problems weren't introduced by your patch, but) I think the "of this" is redundant, and it should say "variable" instead of "command". From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Mar 2020 19:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.15855979807685 (code B ref 25496); Mon, 30 Mar 2020 19:53:01 +0000 Received: (at 25496) by debbugs.gnu.org; 30 Mar 2020 19:53:00 +0000 Received: from localhost ([127.0.0.1]:35111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJ0Sx-0001zt-QJ for submit@debbugs.gnu.org; Mon, 30 Mar 2020 15:53:00 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:35366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJ0Sw-0001zf-0i for 25496@debbugs.gnu.org; Mon, 30 Mar 2020 15:52:58 -0400 Received: by mail-wm1-f52.google.com with SMTP id i19so181392wmb.0 for <25496@debbugs.gnu.org>; Mon, 30 Mar 2020 12:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ZsQzrHNw4RV7c93a/X2R8HuWrNVhrznYoDKi/y2Bw60=; b=APtmdkwps6fEU5mxOo1q0WNzroHRMMbOiuxl0wlLgI+XOZMHnr9a9k0DeD5RJB8gjw XcRPcaaKgJL09VEfieSRyzR0Zy/JQvT5nkEyJusGzPnmSMC8xE07z2EnjGTV5bDUMbd4 qKRykPnVwV/cCE24IDCgTJfDZJXsFVA1Dg9H4xSWoxybTyW6i8sTxyMD9mkspstT+5i6 7aZmJ5xx3wY21I3ZVMziWWYJhGgP7UBxgQEwezYUlPzhLyENrmbCQCqeQR31SrkN2XJ1 +BNfafJyerZmMtV0GP0CPgV9YUaWtTYXwC4uUNbcjRdzGQaL4bggXN2WUYGQOFWTjgbl v3XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ZsQzrHNw4RV7c93a/X2R8HuWrNVhrznYoDKi/y2Bw60=; b=VCHYrmulqvc8uxXVukA8/w4GF5rT8bdQEGmeNCLmlbfLjTGZnvPJgCLbKSaFto/ClM lpgXM8S5Rz+aaG6CWJkh253b/K6IiwS50mLRU7j7Fe8NfHdGdy6B9F3LGArEVwwnfQdj okoO3ql9bMKsH5SCSjKo+4hRx/WyKAQNGczNhXY3cuaQvbYF0jGYKsw79rHS+OTXXJ37 BS27hNIHR6oTJqMI6A3hqi02TCze/or8jmLj66/vxvKbpTL3qiZkb3QOyckOdGytBeIX 66KfZfmczQSbWoRermniWdpWvyiPnKPBLx5fsxYxGjLFdY6Jd51HaPH8AWKAWKwMbD0e 3cGw== X-Gm-Message-State: ANhLgQ26t5GFgmdL9wna3Y0OyfuPZEk9utavxScYGHE9J5N2f+jdwbDf /UOL26TGbZV8wuTg9TnWIoHRC3fpXgE= X-Google-Smtp-Source: ADFU+vu9YK4xWKOb51GAk+XAgz29yQIeDTBhI3wu4LB5T858jgKYmwUMB90x6Sl8gYVq6KSBWaB0CQ== X-Received: by 2002:a7b:cf19:: with SMTP id l25mr856330wmg.131.1585597971616; Mon, 30 Mar 2020 12:52:51 -0700 (PDT) Received: from lead ([2a02:8109:8ac0:2ff0:7061:a1a:dea7:463d]) by smtp.gmail.com with ESMTPSA id p10sm24036745wrm.6.2020.03.30.12.52.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 12:52:50 -0700 (PDT) From: Federico Tedin References: <87zhc0huyn.fsf@gmail.com> <874ku6yeu4.fsf@gmail.com> <87sghqipkx.fsf@gmail.com> Date: Mon, 30 Mar 2020 21:52:49 +0200 In-Reply-To: <87sghqipkx.fsf@gmail.com> (Noam Postavsky's message of "Sun, 29 Mar 2020 21:44:30 -0400") Message-ID: <87wo71ipri.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >> I've removed the lambda, but I wasn't able to use a string directly, I >> had to set the value elsewhere using a defconst. This is due to how >> `eshell-get-variable' interprets string values associated to >> variables. > > Oh, a string is actually taken as an environment variable to alias. I > guess that does justify the name. I think we might actually be better > off with the lambda, what do you think? Hmm, actually now it's working fine - the value associated with INSIDE_EMACS is the symbol `eshell-inside-emacs'. Then `eshell-get-variable' is returning that symbol's value, which is what we want. The `$$', `$?' and `$0' variables are also set to symbols. (But the lambda would also work, of course. No preferences here.) >> "This list provides aliasing for variable references. >> -It is very similar in concept to what `eshell-user-aliases-list' does >> -for commands. Each member of this defines the name of a command, >> -and the Lisp value to return for that variable if it is accessed >> -via the syntax `$NAME'. >> +Each member defines the name of a variable, and the Lisp value to >> +return for that variable if it is accessed via the syntax `$NAME'. > > Again, not a problem introduced by your patch, but "Lisp value to > return" seem pretty inaccurate (if you don't feel like fixing this, it's > okay, I think describing it correctly is somewhat non-trivial). Aaah sorry, I hadn't read your comment correctly. I've rewritten that part and expanded a bit upon it. I think the most confusing part is that when a user does `$foobar', if "foobar" is not in eshell-variable-aliases-list, then "foobar" itself is used as a "value" (which may or may not end up pointing to an env var, or a Lisp var). But I don't think this is relevant when explaining what eshell-variable-aliases-list should contain. (I've attached a new patch!) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Copy-INSIDE_EMACS-env-variable-to-subprocesses-in-Es.patch >From 3f56b3641ba75430210325bcfd0c1bdff16f2a01 Mon Sep 17 00:00:00 2001 From: Federico Tedin Date: Mon, 30 Mar 2020 21:44:47 +0200 Subject: [PATCH] Copy INSIDE_EMACS env variable to subprocesses in Eshell * lisp/eshell/em-dirs.el (eshell-dirs-initialize): Add INSIDE_EMACS variable to buffer-local value of eshell-variable-aliases-alist. (eshell-inside-emacs): Add new constant used for INSIDE_EMACS. * lisp/eshell/esh-var.el (eshell-variable-aliases-list): Update doc string; remove mention of eshell-user-aliases-list and explain that variables can optionally be copied to subprocesses' environments. * test/lisp/eshell/eshell-tests.el (eshell-test/inside-emacs-var): Add test for the INSIDE_EMACS variable. * etc/NEWS: Announce changes. --- etc/NEWS | 6 ++++++ lisp/eshell/em-dirs.el | 5 +++++ lisp/eshell/esh-var.el | 23 ++++++++++++++++++----- test/lisp/eshell/eshell-tests.el | 7 +++++++ 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 4b477e5def..9ac90ecabf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -161,6 +161,12 @@ functions accessible to the user through the existing single function hook Modes should use the new hook instead of this user option to register their backends. +** Eshell + +--- +*** Environment variable INSIDE_EMACS is now copied to subprocesses. +Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'. + ** Tramp +++ diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 1949e5dc8f..51df6fa1d5 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -168,6 +168,9 @@ eshell-dirstack (defvar eshell-last-dir-ring nil "The last directory that Eshell was in.") +(defconst eshell-inside-emacs (format "%s,eshell" emacs-version) + "Value for the `INSIDE_EMACS' environment variable.") + ;;; Functions: (defun eshell-dirs-initialize () ;Called from `eshell-mode' via intern-soft! @@ -191,6 +194,8 @@ eshell-dirs-initialize (unless (ring-empty-p eshell-last-dir-ring) (expand-file-name (ring-ref eshell-last-dir-ring 0)))) + t) + ("INSIDE_EMACS" eshell-inside-emacs t)))) (when eshell-cd-on-directory diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 327a1def46..c12999ee0d 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -179,10 +179,9 @@ eshell-variable-aliases-list (eshell-apply-indices eshell-command-arguments indices))))) "This list provides aliasing for variable references. -It is very similar in concept to what `eshell-user-aliases-list' does -for commands. Each member of this defines the name of a command, -and the Lisp value to return for that variable if it is accessed -via the syntax `$NAME'. +Each member defines the name of a variable, and a Lisp value used to +compute the string value that will be returned when the variable is +accessed via the syntax `$NAME'. If the value is a function, that function will be called with two arguments: the list of the indices that was used in the reference, and @@ -190,7 +189,21 @@ eshell-variable-aliases-list For example, a reference of `$NAME[10][20]' would result in the function for alias `NAME' being called (assuming it were aliased to a function), and the arguments passed to this function would be the list -'(10 20)', and nil." +'(10 20)', and nil. + +If the value is a string, the value for the variable with that name in +the current environment will be returned. If no variable with that +name exists in the environment, but if a symbol with that same name +exists and has a value bound to it, then that value will be used. You +can prioritize symbol values over environment values by setting +`eshell-prefer-lisp-variables' to t. + +If the value is a symbol, the value bound to that symbol will be used. + +If the value has any other type, `error' will be signaled. + +Additionally, each member may specify if it should be copied to the +environment of created subprocesses." :type '(repeat (list string sexp (choice (const :tag "Copy to environment" t) (const :tag "Use only in Eshell" nil))))) diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 026818ab06..ce8d728833 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -169,6 +169,13 @@ eshell-test/last-arg-var (eshell-command-result-p "+ 1 2; + $_ 4" "3\n6\n"))) +(ert-deftest eshell-test/inside-emacs-var () + "Test presence of \"INSIDE_EMACS\" in subprocesses" + (with-temp-eshell + (eshell-command-result-p "env" + (format "INSIDE_EMACS=%s,eshell" + emacs-version)))) + (ert-deftest eshell-test/escape-nonspecial () "Test that \"\\c\" and \"c\" are equivalent when \"c\" is not a special character." -- 2.17.1 --=-=-=-- From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Mar 2020 23:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Federico Tedin Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.158560988312981 (code B ref 25496); Mon, 30 Mar 2020 23:12:01 +0000 Received: (at 25496) by debbugs.gnu.org; 30 Mar 2020 23:11:23 +0000 Received: from localhost ([127.0.0.1]:35251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJ3Yx-0003NI-KG for submit@debbugs.gnu.org; Mon, 30 Mar 2020 19:11:23 -0400 Received: from mail-qk1-f171.google.com ([209.85.222.171]:42120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJ3Yv-0003N4-WA for 25496@debbugs.gnu.org; Mon, 30 Mar 2020 19:11:22 -0400 Received: by mail-qk1-f171.google.com with SMTP id 139so11228380qkd.9 for <25496@debbugs.gnu.org>; Mon, 30 Mar 2020 16:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+oWOloY5wCvfoxrjoNGMzP63pv7GBrqwkhdv59osJYk=; b=pBWe+Kyh6450lNagy2uI0xiWm0v+3L9gnvq8KYr2jEsyCvYel0eZX24Fg1vVgAve3m oZ92x/S8QaYn5kHrezuuQKG712j+lkOYabEJKWNfnqjqJM/GWkt+ksZtCCWl2iZRHF/p iGaQv0iBJnwlkiRoljwYnbJaj5HYlm1hEdDhCqL2RtYsw6rsNKyf26cSNVxSm+Luf9+n LfJK1W7pphTwTgGdyxtUR2RHTqUdjiy4zzp/srnHFu4mfmWW9QQBtFD7L5RZWvqReiJS V8KpeJXNF9Y/m47S7Xr6+FRyv5FmQk35O+zxokodhB2yDCL3rEqjmlWc3ST9iTwXGJJy erCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+oWOloY5wCvfoxrjoNGMzP63pv7GBrqwkhdv59osJYk=; b=UETQK0fYjNPYotNDI6M3b4Tpnn9H1x1G+pTte9okS7aA29SjOtggB/5XGhTg4R7bEq TcKzXKxH8tOwbXPvQ7oTbEsuQRPXB906l4lOgdEBR1L680dVjXgBdTbyhU9pSpNC5XRk +/YkvhoY/ye+VTSQ9ZMgqXi9MIzD0rm3sJ4En+3td0F4L5jwnUbqU6z2LVWg/hv2IX3u wBuOMObUZhQk1jEmlfACRrJoMLhk4ZIXN3V8mrgrJqER4+Pf4SqTzDXAfxWlHIhgaMO3 CAQQy2s6TT3mID2RfJ1siwDkUbwcVHcOe5DkYhWHuxt1FS4f+Cn1AZblbT6dxUeBm432 e3VQ== X-Gm-Message-State: ANhLgQ3ZL+wTmWyHb/lm0qVfes7tMlZ0klyZa/3RKnRGG2gO9vYNV4PG tkMa084J2rw6p7PuHxem4BdJAVqA X-Google-Smtp-Source: ADFU+vv2dioLCAMDI4WfHdPmD1kaKtHfGxV7+tTBpRunMLiJ7B0kymNiGvKZlvh2q2JDklwT4pvf+w== X-Received: by 2002:a37:a281:: with SMTP id l123mr2494038qke.438.1585609876328; Mon, 30 Mar 2020 16:11:16 -0700 (PDT) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id q24sm12524084qtk.45.2020.03.30.16.11.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 16:11:15 -0700 (PDT) From: Noam Postavsky References: <87zhc0huyn.fsf@gmail.com> <874ku6yeu4.fsf@gmail.com> <87sghqipkx.fsf@gmail.com> <87wo71ipri.fsf@gmail.com> Date: Mon, 30 Mar 2020 19:11:04 -0400 In-Reply-To: <87wo71ipri.fsf@gmail.com> (Federico Tedin's message of "Mon, 30 Mar 2020 21:52:49 +0200") Message-ID: <87o8sdigl3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Federico Tedin writes: >>> I've removed the lambda, but I wasn't able to use a string directly, I >>> had to set the value elsewhere using a defconst. This is due to how >>> `eshell-get-variable' interprets string values associated to >>> variables. >> >> Oh, a string is actually taken as an environment variable to alias. I >> guess that does justify the name. I think we might actually be better >> off with the lambda, what do you think? > > Hmm, actually now it's working fine - the value associated with > INSIDE_EMACS is the symbol `eshell-inside-emacs'. Yeah, it works fine, I'm just not sure if having the extra eshell-inside-emacs variable is better than a lambda. But anyway, it doesn't really matter that much. I'll wait a couple of days (in case there are any more suggested changes) and then push to master. >> Again, not a problem introduced by your patch, but "Lisp value to >> return" seem pretty inaccurate (if you don't feel like fixing this, it's >> okay, I think describing it correctly is somewhat non-trivial). > > Aaah sorry, I hadn't read your comment correctly. No, no, you read it right. I just initially wrote the wrong thing: I hadn't realized the docstring was wrong before (that's why I mistakenly suggested using a string instead of a lambda). > +If the value is a string, the value for the variable with that name in > +the current environment will be returned. If no variable with that > +name exists in the environment, but if a symbol with that same name > +exists and has a value bound to it, then that value will be used. You > +can prioritize symbol values over environment values by setting > +`eshell-prefer-lisp-variables' to t. > + > +If the value is a symbol, the value bound to that symbol will be used. Much better, thanks. From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Apr 2020 23:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Federico Tedin Cc: 25496@debbugs.gnu.org Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.15858687933919 (code B ref 25496); Thu, 02 Apr 2020 23:07:01 +0000 Received: (at 25496) by debbugs.gnu.org; 2 Apr 2020 23:06:33 +0000 Received: from localhost ([127.0.0.1]:40917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jK8uu-000116-W1 for submit@debbugs.gnu.org; Thu, 02 Apr 2020 19:06:33 -0400 Received: from mail-qk1-f169.google.com ([209.85.222.169]:38841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jK8us-00010D-Sm; Thu, 02 Apr 2020 19:06:31 -0400 Received: by mail-qk1-f169.google.com with SMTP id h14so6144079qke.5; Thu, 02 Apr 2020 16:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=EuI7nllmETp2sdqTwD9MlXEUR4sZhxKcQ+WPiqEoj8w=; b=TZut4pyp6ha+meSHMEXtX/yaXVUgSUG8QgjB99LMnRajD90Co/G3mnlQgkrVhOsr5d HdMJfHgcG2xLNIczSuaHwbbOlJbjco4sxumF75dK9UZGDhPwVqpiWtJJ8ZKwZVoI8QSF o0dVdXzMYb0YBHunijT789DrRSiONOkMPmnYZCo2u1v2QHIyuHH9KjQl55ozOmG/Hv/X xnC/R60BcSAT9+TFZL+YbQ73Zm2KmtFgTx20TsW8Lzr809KUxiSWpBcGjPk27YalZFFY KrN0uD67SbrJmqzJKDSw8SofzpZ29U9kyQ3uIKWOtxlrVbrvc2+SZTOVMeU/VS5EKWor EZbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=EuI7nllmETp2sdqTwD9MlXEUR4sZhxKcQ+WPiqEoj8w=; b=hCMSb2jZ94I5i3NAJ2S+Vv4S5KeGr449DIHit+uDcaCUTWi15zePoPNrUvQmKIvxDI f4AX9P3k2QRdSo5ZwvlJ+CUVO0uc8LKuHR2nmx609xLq0GaFjrs0WBXHIXqAOxxDVQZ3 TRNFqUyLTMWxpvppjjy4GH003FVxrfPL5tzAp4uqVK8pdA90D/0mGBnYeN+y2dut9CqX JziO6kiKQFtp0U+vMi/0Iu50mmcfA34C1/tSx9Vkk55+ir6ZU0oh9igCClRkyHWdE3Ax CBUdQZ+md6W8sHcn9d9rAf17+hYGvYIKKYjWJpfMfRsjVyV9QNiHkOoy4NlhOztkBKjn 46lw== X-Gm-Message-State: AGi0PubGRIKpWj6nu++HszQE+X2bQX+8t3O/i5K+jHEL3QRB0yGfzK6b JdZJAOVD1akWPc6/S1VsBVP4PY3U X-Google-Smtp-Source: APiQypJKv/QbcsC5PBCEj2NLXaJaysvrq08k3rfkTClwvQxmTTua4UsSCK/DAqd1AF9ipGuH57uS4A== X-Received: by 2002:a37:428a:: with SMTP id p132mr2811154qka.267.1585868785166; Thu, 02 Apr 2020 16:06:25 -0700 (PDT) Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id r46sm4812139qtb.87.2020.04.02.16.06.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Apr 2020 16:06:24 -0700 (PDT) From: Noam Postavsky References: <87zhc0huyn.fsf@gmail.com> <874ku6yeu4.fsf@gmail.com> <87sghqipkx.fsf@gmail.com> <87wo71ipri.fsf@gmail.com> <87o8sdigl3.fsf@gmail.com> Date: Thu, 02 Apr 2020 19:06:23 -0400 In-Reply-To: <87o8sdigl3.fsf@gmail.com> (Noam Postavsky's message of "Mon, 30 Mar 2020 19:11:04 -0400") Message-ID: <87369lij2o.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 25496 fixed close 25496 28.1 quit Noam Postavsky writes: > I'll wait a couple of days (in case there are any more suggested > changes) and then push to master. Done. [1: f28166dc9a]: 2020-04-02 18:59:57 -0400 Copy INSIDE_EMACS env variable to subprocesses in Eshell (Bug#25496) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=f28166dc9a56111606be8ac50ad38179a66ea636 From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Apr 2020 12:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch To: Noam Postavsky Cc: 25496@debbugs.gnu.org, federicotedin@gmail.com Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.158591627318325 (code B ref 25496); Fri, 03 Apr 2020 12:18:02 +0000 Received: (at 25496) by debbugs.gnu.org; 3 Apr 2020 12:17:53 +0000 Received: from localhost ([127.0.0.1]:41338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKLGi-0004lU-U9 for submit@debbugs.gnu.org; Fri, 03 Apr 2020 08:17:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKLGh-0004ky-Be for 25496@debbugs.gnu.org; Fri, 03 Apr 2020 08:17:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jKLGc-0000R0-8i; Fri, 03 Apr 2020 08:17:46 -0400 Received: from [176.228.60.248] (port=2649 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jKLGb-0003zc-Ns; Fri, 03 Apr 2020 08:17:46 -0400 Date: Fri, 03 Apr 2020 15:17:30 +0300 Message-Id: <83k12wwyp1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87o8sdigl3.fsf@gmail.com> (message from Noam Postavsky on Mon, 30 Mar 2020 19:11:04 -0400) References: <87zhc0huyn.fsf@gmail.com> <874ku6yeu4.fsf@gmail.com> <87sghqipkx.fsf@gmail.com> <87wo71ipri.fsf@gmail.com> <87o8sdigl3.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Noam Postavsky > Date: Mon, 30 Mar 2020 19:11:04 -0400 > Cc: 25496@debbugs.gnu.org > > > +If the value is a string, the value for the variable with that name in > > +the current environment will be returned. If no variable with that > > +name exists in the environment, but if a symbol with that same name > > +exists and has a value bound to it, then that value will be used. You > > +can prioritize symbol values over environment values by setting > > +`eshell-prefer-lisp-variables' to t. > > + > > +If the value is a symbol, the value bound to that symbol will be used. > > Much better, thanks. Would it be possible to reword this so that passive tense is used less frequently? E.g., instead of "the variable with that name in the current environment will be returned", how about "return the variable with that name in the current environment"? And similarly with the rest of the doc string. Thanks. From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Apr 2020 10:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch To: Eli Zaretskii Cc: 25496@debbugs.gnu.org, Noam Postavsky Received: via spool by 25496-submit@debbugs.gnu.org id=B25496.158599493524263 (code B ref 25496); Sat, 04 Apr 2020 10:09:02 +0000 Received: (at 25496) by debbugs.gnu.org; 4 Apr 2020 10:08:55 +0000 Received: from localhost ([127.0.0.1]:43473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKfjT-0006JG-Bx for submit@debbugs.gnu.org; Sat, 04 Apr 2020 06:08:55 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:35544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKfjR-0006Il-0x for 25496@debbugs.gnu.org; Sat, 04 Apr 2020 06:08:53 -0400 Received: by mail-wr1-f45.google.com with SMTP id g3so9181111wrx.2 for <25496@debbugs.gnu.org>; Sat, 04 Apr 2020 03:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=aGWrOD+N3MN/SqMpqciVvHJ0TeL0BRgIlRD75Xz9gI8=; b=WUDd52fgzFWmNPizQWK7mrHIgVszOVKJm3lpimD8xyrVNHh+GW+U6HmA9Vq9uYhv76 Z6U+3ioE4dyZUV8Fm86bWzL3xMQHUKZ9sIqIpblWSubbnI20eUiBKUKDbbY2/bQTc472 bh/L4U7MNgU82yrZF+vugSHuso2cg7yynu2dDJ47aSXYXrg39hYqJWPV07keiF/2Jn+x cbYTU/3/1ccMOTTQvVCYhSu4bO1r4bsEa5o/Vrn4mK1WaMTKiEhuNdJZ364yfVR5eqIj pmMtByMfFl4AVnYq6grNK9ABPAM6GJ6jAjyjwIb7ACRWRYSzMxNvPGo52AZRqa0z/6VQ HFlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=aGWrOD+N3MN/SqMpqciVvHJ0TeL0BRgIlRD75Xz9gI8=; b=TNLJ5GpZLsnuUKKWlLJu40BdP1LX3HNvQ55vYm96dt/ZQrR+vs/SD4R0wEmOn6vVDG UC/I661U6r9KhGBWRtj2ztgetMVK8Ewk8jJNX0pOteLft3QyKzt//tim68X5o3k41tYR jX5XyprTDYkgdbnR5YxhKG5TUBg8OFB8EcxEhLOMAkEi2iLueJPxDSKvc8VVhswETlhh wmR8ZRwN8mO10ocCDbzla/zUcW6I90vyXVs3WI/RY33sy1sV6Fsef7PjBfNXPxrr0Ajj T8u1RQdKVvVjfm5gnu7s1Nnxb5BisDt6hyU5iSmJEM2LdYCnNObuQ3Cqqi0SbM4chBZq EaZg== X-Gm-Message-State: AGi0PubTSZ+MOae9j+HJUSMiWh0cV/s3+Ej7JFtB3zyacNTNFaa+lSxx 7ppTkjgcjc29ewNybqlbc++Qrj3UzPE= X-Google-Smtp-Source: APiQypKM3v5KaprwRYzlCxgFg+SPER4EvfErCxdQkavxVJi8bgoOwbmzsH9zaB3xbg6nPhlVEnHvrg== X-Received: by 2002:adf:d846:: with SMTP id k6mr13414696wrl.268.1585994926850; Sat, 04 Apr 2020 03:08:46 -0700 (PDT) Received: from lead ([2a02:8109:8ac0:2ff0:f8cd:4aa0:b23c:97a8]) by smtp.gmail.com with ESMTPSA id h26sm14850005wmb.19.2020.04.04.03.08.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 Apr 2020 03:08:46 -0700 (PDT) From: Federico Tedin References: <87zhc0huyn.fsf@gmail.com> <874ku6yeu4.fsf@gmail.com> <87sghqipkx.fsf@gmail.com> <87wo71ipri.fsf@gmail.com> <87o8sdigl3.fsf@gmail.com> <83k12wwyp1.fsf@gnu.org> Date: Sat, 04 Apr 2020 12:08:43 +0200 In-Reply-To: <83k12wwyp1.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 Apr 2020 15:17:30 +0300") Message-ID: <87ftdjo95g.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >> I'll wait a couple of days (in case there are any more suggested >> changes) and then push to master. > > Done. Thanks! > Would it be possible to reword this so that passive tense is used less > frequently? E.g., instead of "the variable with that name in the > current environment will be returned", how about "return the variable > with that name in the current environment"? And similarly with the > rest of the doc string. > > Thanks. No problem, I've attached a patch with the changes. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Reword-documentation-for-eshell-variable-aliases-lis.patch >From 1e77ef50a7bf24e67fa6003bb768cdae2202a270 Mon Sep 17 00:00:00 2001 From: Federico Tedin Date: Sat, 4 Apr 2020 12:04:11 +0200 Subject: [PATCH] Reword documentation for eshell-variable-aliases-list * lisp/eshell/esh-var.el (eshell-variable-aliases-list): Update documentation string. --- lisp/eshell/esh-var.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 3093abd830..70516b3b82 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -183,24 +183,24 @@ eshell-variable-aliases-list compute the string value that will be returned when the variable is accessed via the syntax `$NAME'. -If the value is a function, that function will be called with two -arguments: the list of the indices that was used in the reference, and -whether the user is requesting the length of the ultimate element. -For example, a reference of `$NAME[10][20]' would result in the -function for alias `NAME' being called (assuming it were aliased to a -function), and the arguments passed to this function would be the list -'(10 20)', and nil. - -If the value is a string, the value for the variable with that name in -the current environment will be returned. If no variable with that -name exists in the environment, but if a symbol with that same name -exists and has a value bound to it, then that value will be used. You -can prioritize symbol values over environment values by setting +If the value is a function, call that function with two arguments: the +list of the indices that was used in the reference, and whether the +user is requesting the length of the ultimate element. For example, a +reference of `$NAME[10][20]' would result in the function for alias +`NAME' being called (assuming it were aliased to a function), and the +arguments passed to this function would be the list '(10 20)', and +nil. + +If the value is a string, return the value for the variable with that +name in the current environment. If no variable with that name exists +in the environment, but if a symbol with that same name exists and has +a value bound to it, return its value instead. You can prioritize +symbol values over environment values by setting `eshell-prefer-lisp-variables' to t. -If the value is a symbol, the value bound to that symbol will be used. +If the value is a symbol, return the value bound to it. -If the value has any other type, `error' will be signaled. +If the value has any other type, signal `error'. Additionally, each member may specify if it should be copied to the environment of created subprocesses." -- 2.17.1 --=-=-=-- From unknown Sun Jun 22 07:34:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Apr 2020 09:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch To: Federico Tedin Cc: npostavs@gmail.com, 25496-done@debbugs.gnu.org Received: via spool by 25496-done@debbugs.gnu.org id=D25496.158659687714002 (code D ref 25496); Sat, 11 Apr 2020 09:22:02 +0000 Received: (at 25496-done) by debbugs.gnu.org; 11 Apr 2020 09:21:17 +0000 Received: from localhost ([127.0.0.1]:56159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNCKD-0003dm-7H for submit@debbugs.gnu.org; Sat, 11 Apr 2020 05:21:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNCKB-0003dW-0F for 25496-done@debbugs.gnu.org; Sat, 11 Apr 2020 05:21:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNCK5-0000d4-T0; Sat, 11 Apr 2020 05:21:09 -0400 Received: from [176.228.60.248] (port=4835 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNCK4-0003xD-P3; Sat, 11 Apr 2020 05:21:09 -0400 Date: Sat, 11 Apr 2020 12:20:54 +0300 Message-Id: <83tv1ql6o9.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ftdjo95g.fsf@gmail.com> (message from Federico Tedin on Sat, 04 Apr 2020 12:08:43 +0200) References: <87zhc0huyn.fsf@gmail.com> <874ku6yeu4.fsf@gmail.com> <87sghqipkx.fsf@gmail.com> <87wo71ipri.fsf@gmail.com> <87o8sdigl3.fsf@gmail.com> <83k12wwyp1.fsf@gnu.org> <87ftdjo95g.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Federico Tedin > Cc: Noam Postavsky , 25496@debbugs.gnu.org > Date: Sat, 04 Apr 2020 12:08:43 +0200 > > > Would it be possible to reword this so that passive tense is used less > > frequently? E.g., instead of "the variable with that name in the > > current environment will be returned", how about "return the variable > > with that name in the current environment"? And similarly with the > > rest of the doc string. > > > > Thanks. > > No problem, I've attached a patch with the changes. Thanks, pushed.