emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/eat b3c81c3078 4/7: Move Bash global variables to function


From: ELPA Syncer
Subject: [nongnu] elpa/eat b3c81c3078 4/7: Move Bash global variables to function
Date: Wed, 7 Dec 2022 04:58:42 -0500 (EST)

branch: elpa/eat
commit b3c81c30787b095e4f7d7d7dce9e416d0dfaefe5
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Move Bash global variables to function
    
    * integration/bash (__eat_current_command, __eat_exit_status)
    (__eat_inhibit_preexec): Move to '__eat_enable_integration'.
    * integration/bash (__eat_prompt_start, __eat_prompt_end)
    (__eat_continuation_start, __eat_continuation_end): Move to
    '__eat_enable_integration' and make local there.
---
 integration/bash | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/integration/bash b/integration/bash
index 41b530136b..03ca465436 100644
--- a/integration/bash
+++ b/integration/bash
@@ -17,9 +17,6 @@
 # For a full copy of the GNU General Public License
 # see <https://www.gnu.org/licenses/>.
 
-__eat_current_command=""
-__eat_exit_status=0
-
 __eat_prompt_command () {
   # Send exit status.
   if test -n "$__eat_current_command"
@@ -55,8 +52,6 @@ __eat_preexec () {
          "$__eat_current_command"
 }
 
-__eat_inhibit_preexec=yes
-
 __eat_before_prompt_command ()
 {
   __eat_exit_status="$?"
@@ -77,14 +72,16 @@ __eat_before_exec () {
   fi
 }
 
-__eat_prompt_start='\e]51;e;B\e\\'
-__eat_prompt_end='\e]51;e;C\e\\'
-__eat_continuation_start='\e]51;e;D\e\\'
-__eat_continuation_end='\e]51;e;E\e\\'
-
 __eat_enable_integration ()
 {
   __eat_integration_enabled=yes
+  __eat_current_command=""
+  __eat_exit_status=0
+  __eat_inhibit_preexec=yes
+  local __eat_prompt_start='\e]51;e;B\e\\'
+  local __eat_prompt_end='\e]51;e;C\e\\'
+  local __eat_continuation_start='\e]51;e;D\e\\'
+  local __eat_continuation_end='\e]51;e;E\e\\'
   PS1="\[$__eat_prompt_start\]$PS1\[$__eat_prompt_end\]"
   PS2="\[$__eat_continuation_start\]$PS2\[$__eat_continuation_end\]"
   PROMPT_COMMAND+=(__eat_prompt_command)



reply via email to

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