branch: elpa/lua-mode
commit 52cc3e465a2d35dbcbad8a87fd5fe548840f5822
Merge: 770a83d c7c3aaa
Author: immerrr again <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #154 from
immerrr/set-comint-prompt-regexp-locally-in-process-buf
Set comint-prompt-regexp locally in process buffer
---
lua-mode.el | 6 ++----
test/test-inferior-process.el | 12 +++++++++++-
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 0323250..67de071 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -709,9 +709,6 @@ Groups 6-9 can be used in any of argument regexps."
:abbrev-table lua-mode-abbrev-table
:syntax-table lua-mode-syntax-table
:group 'lua
- (setq comint-prompt-regexp lua-prompt-regexp)
-
-
(setq-local font-lock-defaults '(lua-font-lock-keywords ;; keywords
nil ;; keywords-only
nil ;; case-fold
@@ -1738,7 +1735,8 @@ When called interactively, switch to the process buffer."
(setq compilation-error-regexp-alist
(cons (list lua-traceback-line-re 1 2)
compilation-error-regexp-alist))
- (compilation-shell-minor-mode 1))
+ (compilation-shell-minor-mode 1)
+ (setq-local comint-prompt-regexp lua-prompt-regexp))
;; when called interactively, switch to process buffer
(if (called-interactively-p 'any)
diff --git a/test/test-inferior-process.el b/test/test-inferior-process.el
index ae1b970..2d160a0 100644
--- a/test/test-inferior-process.el
+++ b/test/test-inferior-process.el
@@ -3,7 +3,7 @@
default-directory))
"utils.el") nil 'nomessage 'nosuffix)
(require 'cl-lib)
-
+(require 'comint)
(describe "Hiding process buffer does not switch current window"
@@ -30,6 +30,16 @@
(lua-hide-process-buffer)
(expect (get-buffer-window cur-buf))))))
+(describe "Compilation minor mode"
+ (it "sets comint-prompt-regexp in process buffer"
+ (with-lua-buffer
+ (lua-start-process)
+ (with-current-buffer lua-process-buffer
+ (expect "" :not :to-match comint-prompt-regexp)
+ (expect "> " :to-match comint-prompt-regexp))
+ (expect comint-prompt-regexp :to-equal "^"))
+ (expect comint-prompt-regexp :to-equal "^")))
+
(require 'compile)
(if (fboundp 'compilation--loc->file-struct)