[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 563ac50 325/468: Merge pull request #115 from Rob
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 563ac50 325/468: Merge pull request #115 from RobertCochran/escape-tabs |
Date: |
Thu, 5 Aug 2021 04:59:02 -0400 (EDT) |
branch: elpa/lua-mode
commit 563ac50158336a16243e1f3f22076e64a853ba72
Merge: 6511687 f2915c3
Author: dennis again <immerrr@gmail.com>
Commit: dennis again <immerrr@gmail.com>
Merge pull request #115 from RobertCochran/escape-tabs
Escape tabs in lua-make-lua-string
---
lua-mode.el | 12 ++++++++----
test/test-inferior-process.el | 7 +++++++
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index b34d1dd..95bf6dc 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
diff --git a/test/test-inferior-process.el b/test/test-inferior-process.el
index 2fedd29..e51f00c 100644
--- a/test/test-inferior-process.el
+++ b/test/test-inferior-process.el
@@ -142,3 +142,10 @@ function () end
(kill-buffer buf))
(delete-file fname)
(kill-buffer "*lua*")))))
+
+(describe "String escaping"
+ (it "Escapes literal tabs"
+ (expect (string=
+ (lua-make-lua-string "\
+ -- comment indented with a tab")
+ "'\\t-- comment indented with a tab'"))))
- [nongnu] elpa/lua-mode ceb74ae 296/468: Add file test/.nosearch, (continued)
- [nongnu] elpa/lua-mode ceb74ae 296/468: Add file test/.nosearch, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a7780dc 304/468: silence 25.1 byte-compiler, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 37f3c42 306/468: Silence compilation warning about referencing a variable from compile.el, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 148858c 309/468: Migrate tests to buttercup, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0ce2b96 314/468: Allow to set lua-indent-level as file local variable, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8b9d895 311/468: Fix comments being spilled into the code (issue #25), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cadc1ea 312/468: to-be-fontified-as: improve error messages, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 444ac2f 320/468: Merge 'stable' back into 'master', Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cae5db6 322/468: Fix derived-mode-p test, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6511687 323/468: Merge pull request #116 from immerrr/fix-derived-mode-p, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 563ac50 325/468: Merge pull request #115 from RobertCochran/escape-tabs,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 3019e75 327/468: Merge pull request #117 from immerrr/fix-string-parsing, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a0d6744 331/468: travis.yml: add Emacs-25.1, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dccda19 336/468: Wrap lua--fill-paragraph in save-excursion, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7a97e1b 341/468: correct spelling mistake, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0715340 337/468: Merge pull request #131 from jorams/fill-paragraph-save-excursion, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d759699 335/468: Merge pull request #129 from immerrr/fix-global-variable-in-lua-interpreter, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 459e3b7 427/468: Fix FIXME: `lua-prefix-key' is always `boundp', Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b793852 434/468: Add regression test, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6a30c39 447/468: lua-is-continuing-statement-p: short-circuit to false for "breaker" kws, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b043ca4 451/468: lua-is-continuing-statement-p-1: fix missing save-excursion on branch, Philip Kaludercic, 2021/08/05