bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash should look at INSIDE_EMACS not just EMACS


From: Paul Eggert
Subject: Bash should look at INSIDE_EMACS not just EMACS
Date: Mon, 30 Mar 2015 14:47:47 -0700 (PDT)

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' 
-DCONF_VENDOR='unknown' -DLOCALEDIR='/tmp/prefix/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g -O2
uname output: Linux Penguin.CS.UCLA.EDU 3.19.2-201.fc21.x86_64 #1 SMP Tue Mar 
24 03:08:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.3
Patch Level: 33
Release Status: release

Description:
        Currently 'bash' looks at the EMACS environment variable when
        deciding whether it is running under Emacs.  As described in
        the "Interactive Subshell" chapter of the Emacs manual
        
http://www.gnu.org/software/emacs/manual/html_node/emacs/Interactive-Shell.html
        this variable is obsolescent and software is supposed to use the
        variable INSIDE_EMACS instead.

Repeat-By:
        Run a future version of Emacs, which does not set EMACS,
        and run Bash as a subshell of it.

Fix:

2015-03-30  Paul Eggert  <eggert@cs.ucla.edu>

        * shell.c (main): Also look at INSIDE_EMACS when deciding
        whether to use line editing.  Simplify nearby code that tests
        'term', since 'term' is guaranteed to be non-null here.

--- bash-4.3.33/shell.c 2015-03-30 10:42:10.871889889 -0700
+++ bash-4.3.33-fix/shell.c     2015-03-30 14:34:28.698052813 -0700
@@ -580,12 +580,13 @@ main (argc, argv, env)
       emacs = get_string_value ("EMACS");

       /* Not sure any emacs terminal emulator sets TERM=emacs any more */
-      no_line_editing |= term && (STREQ (term, "emacs"));
+      no_line_editing |= STREQ (term, "emacs");
       no_line_editing |= emacs && emacs[0] == 't' && emacs[1] == '\0' && STREQ 
(term, "dumb");
+      no_line_editing |= get_string_value ("INSIDE_EMACS") != 0;

       /* running_under_emacs == 2 for `eterm' */
-      running_under_emacs = (emacs != 0) || (term && STREQN (term, "emacs", 
5));
-      running_under_emacs += term && STREQN (term, "eterm", 5) && emacs && 
strstr (emacs, "term");
+      running_under_emacs = (emacs != 0) || STREQN (term, "emacs", 5);
+      running_under_emacs += STREQN (term, "eterm", 5) && emacs && strstr 
(emacs, "term");

       if (running_under_emacs)
        gnu_error_format = 1;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]