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

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

[nongnu] elpa/lua-mode ea7e35c 321/468: Escape tabs in lua-make-lua-stri


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode ea7e35c 321/468: Escape tabs in lua-make-lua-string
Date: Thu, 5 Aug 2021 04:59:01 -0400 (EDT)

branch: elpa/lua-mode
commit ea7e35cc71efa0acda7e6f6c53fe3adc6951bc1a
Author: Robert Cochran <robert-git@cochranmail.com>
Commit: Robert Cochran <robert-git@cochranmail.com>

    Escape tabs in lua-make-lua-string
    
    Doing so prevents comint from intercepting the tabs and passing them to
    the underlying shell process, which inserts shell tab completion text
    into the code string, mangling it so that it can't run.
---
 lua-mode.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lua-mode.el b/lua-mode.el
index 3126d21..0223be1 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1708,10 +1708,14 @@ This function just searches for a `end' at the 
beginning of a line."
     (with-temp-buffer
       (insert str)
       (goto-char (point-min))
-      (while (re-search-forward "[\"'\\\n]" nil t)
-        (if (string= (match-string 0) "\n")
-            (replace-match "\\\\n")
-          (replace-match "\\\\\\&" t)))
+      (while (re-search-forward "[\"'\\\t\\\n]" nil t)
+        (cond
+        ((string= (match-string 0) "\n")
+         (replace-match "\\\\n"))
+        ((string= (match-string 0) "\t")
+         (replace-match "\\\\t"))
+        (t
+          (replace-match "\\\\\\&" t))))
       (concat "'" (buffer-string) "'"))))
 
 ;;;###autoload



reply via email to

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