[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode c49fb68 023/468: Fixed lua-prompt-regex and handl
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode c49fb68 023/468: Fixed lua-prompt-regex and handling of output without newline (bug #425) |
Date: |
Thu, 5 Aug 2021 04:58:01 -0400 (EDT) |
branch: elpa/lua-mode
commit c49fb688691e82dbdb8aee69f9720d578c72ae5c
Author: juergen <juergen>
Commit: juergen <juergen>
Fixed lua-prompt-regex and handling of output without newline (bug #425)
---
lua-mode.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index db60e62..db817ea 100755
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -141,7 +141,7 @@ Should be a list of strings."
:type 'string
:group 'lua)
-(defcustom lua-prompt-regexp "^>+[\t ]+"
+(defcustom lua-prompt-regexp "[^\n]*\\(>[\t ]+\\)+$"
"Regexp which matches the Lua program's prompt."
:group 'lua
:type 'regexp
@@ -1071,7 +1071,7 @@ If `lua-process' is nil or dead, start a new process
first."
;; send dofile(tempfile)
(with-current-buffer lua-process-buffer
(goto-char (point-max))
- (setq last-prompt (count-lines (point-min) (point-max)))
+ (setq last-prompt (point-max))
(comint-simple-send (get-buffer-process (current-buffer))
(format "dofile(\"%s\")"
(replace-in-string tempfile "\\\\" "\\\\\\\\"
)))
@@ -1079,7 +1079,7 @@ If `lua-process' is nil or dead, start a new process
first."
(while (not prompt-found)
(accept-process-output (get-buffer-process (current-buffer)))
(goto-char (point-max))
- (setq prompt-found (and (lua-prompt-line) (not (= (count-lines
(point-min) (point-max)) last-prompt)))))
+ (setq prompt-found (and (lua-prompt-line) (< last-prompt (point-max)))))
;; remove temp. lua file
(delete-file tempfile)
(lua-postprocess-output-buffer lua-process-buffer last-prompt
lua-stdin-line-offset)
@@ -1132,8 +1132,10 @@ t, otherwise return nil. BUF must exist."
(defun lua-prompt-line ()
(save-excursion
- (forward-line 0)
- (looking-at comint-prompt-regexp)))
+ (save-match-data
+ (forward-line 0)
+ (if (looking-at comint-prompt-regexp)
+ (match-end 0)))))
;;{{{ lua-send-lua-region
;;}}}
- [nongnu] elpa/lua-mode ea5c4a1 015/468: Documentation: Added installation notes, (continued)
- [nongnu] elpa/lua-mode ea5c4a1 015/468: Documentation: Added installation notes, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9d20d58 019/468: fold mode cleanup, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 78fc3ba 005/468: lua-postprocess-output-buffer: jump to lua errors in source files, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8802c43 006/468: fixed lua-postprocess-output-buffer: start search from last prompt, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3d6f6ed 012/468: enforce interactive mode by default: (defcustom lua-default-command-switches (list "-i")..., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8ab6df6 026/468: Fix bug #619: Wrong identation with .. operator, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d313ff5 024/468: New Release: 20061208, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 31acb6b 029/468: Fix bug #621: Wrong comment block detection, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8f17c27 021/468: fix [#472] lua-mode colorization, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b11a136 022/468: implemented lua-forward-sexp using lua-find-matching-token-word, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c49fb68 023/468: Fixed lua-prompt-regex and handling of output without newline (bug #425),
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 99324a4 034/468: minor font-lock fix, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c61bda2 040/468: Commit from Reuben:, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cd5fa7d 010/468: lua-start-process: made program &optional argument (defaults to name), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 13363db 017/468: Fixed typo (#470), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9730289 027/468: Insert Project page Link, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode bf0b902 033/468: New Release 20070708, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ab9783f 041/468: Applied patch from Reuben Thomas:, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2786823 043/468: Add example code to trigger lua-mode for hash-bang lines containing, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4f4d3de 047/468: Add Makefile with dist and release targets, and ignore release zips., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 16861a3 032/468: Fix bug #620 again: Wrong identation with tables, Philip Kaludercic, 2021/08/05