branch: elpa/lua-mode
commit ea7e35cc71efa0acda7e6f6c53fe3adc6951bc1a
Author: Robert Cochran <[email protected]>
Commit: Robert Cochran <[email protected]>
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