Skip to content

Commit 52cc3e4

Browse files
authored
Merge pull request #154 from immerrr/set-comint-prompt-regexp-locally-in-process-buf
Set comint-prompt-regexp locally in process buffer
2 parents 770a83d + c7c3aaa commit 52cc3e4

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

lua-mode.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,9 +709,6 @@ Groups 6-9 can be used in any of argument regexps."
709709
:abbrev-table lua-mode-abbrev-table
710710
:syntax-table lua-mode-syntax-table
711711
:group 'lua
712-
(setq comint-prompt-regexp lua-prompt-regexp)
713-
714-
715712
(setq-local font-lock-defaults '(lua-font-lock-keywords ;; keywords
716713
nil ;; keywords-only
717714
nil ;; case-fold
@@ -1738,7 +1735,8 @@ When called interactively, switch to the process buffer."
17381735
(setq compilation-error-regexp-alist
17391736
(cons (list lua-traceback-line-re 1 2)
17401737
compilation-error-regexp-alist))
1741-
(compilation-shell-minor-mode 1))
1738+
(compilation-shell-minor-mode 1)
1739+
(setq-local comint-prompt-regexp lua-prompt-regexp))
17421740

17431741
;; when called interactively, switch to process buffer
17441742
(if (called-interactively-p 'any)

test/test-inferior-process.el

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
default-directory))
44
"utils.el") nil 'nomessage 'nosuffix)
55
(require 'cl-lib)
6-
6+
(require 'comint)
77

88

99
(describe "Hiding process buffer does not switch current window"
@@ -30,6 +30,16 @@
3030
(lua-hide-process-buffer)
3131
(expect (get-buffer-window cur-buf))))))
3232

33+
(describe "Compilation minor mode"
34+
(it "sets comint-prompt-regexp in process buffer"
35+
(with-lua-buffer
36+
(lua-start-process)
37+
(with-current-buffer lua-process-buffer
38+
(expect "" :not :to-match comint-prompt-regexp)
39+
(expect "> " :to-match comint-prompt-regexp))
40+
(expect comint-prompt-regexp :to-equal "^"))
41+
(expect comint-prompt-regexp :to-equal "^")))
42+
3343

3444
(require 'compile)
3545
(if (fboundp 'compilation--loc->file-struct)

0 commit comments

Comments
 (0)