[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 8802c43 006/468: fixed lua-postprocess-output-buf
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 8802c43 006/468: fixed lua-postprocess-output-buffer: start search from last prompt |
Date: |
Thu, 5 Aug 2021 04:57:57 -0400 (EDT) |
branch: elpa/lua-mode
commit 8802c43ffb4d184453602da003f1ed65ac84dfce
Author: juergen <juergen>
Commit: juergen <juergen>
fixed lua-postprocess-output-buffer: start search from last prompt
simplified: lua-send-current-line
---
lua-mode.el | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index e99639a..9c30674 100755
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -28,7 +28,7 @@
;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
;; MA 02110-1301, USA.
-(defconst lua-version "$Revision: 1.5 $"
+(defconst lua-version "$Revision: 1.6 $"
"Lua Mode version number.")
;; Keywords: languages, processes, tools
@@ -962,13 +962,7 @@ If `lua-process' is nil or dead, start a new process
first."
(interactive)
(let ((start (save-excursion (beginning-of-line) (point)))
(end (save-excursion (end-of-line) (point))))
- (or (and lua-process
- (eq (process-status lua-process) 'run))
- (lua-start-process lua-default-application lua-default-application))
- (comint-simple-send lua-process (buffer-substring start end))
- (forward-line 1)
- (if lua-always-show
- (display-buffer lua-process-buffer))))
+ (lua-send-region start end)))
;;}}}
;;{{{ lua-send-region
@@ -981,6 +975,7 @@ If `lua-process' is nil or dead, start a new process first."
(current-prompt nil)
(lua-stdin-line-offset (count-lines (point-min) start))
(lua-stdin-buffer (current-buffer))
+ current-prompt
)
(write-region start end tempfile)
(or (and lua-process
@@ -992,28 +987,28 @@ If `lua-process' is nil or dead, start a new process
first."
;; send dofile(tempfile)
(save-excursion
(set-buffer lua-process-buffer)
- (let ((current-prompt (comint-next-prompt 1)))
- (comint-simple-send (get-buffer-process (current-buffer)) (format
"dofile(\"%s\")" tempfile))
- ;; wait for prompt
- (while (or (= (comint-next-prompt 1) current-prompt)
- (not (lua-prompt-line)))
- (accept-process-output (get-buffer-process (current-buffer))))))
+ (setq current-prompt (comint-next-prompt 1))
+ (comint-simple-send (get-buffer-process (current-buffer)) (format
"dofile(\"%s\")" tempfile))
+ ;; wait for prompt
+ (while (or (= (comint-next-prompt 1) current-prompt)
+ (not (lua-prompt-line)))
+ (accept-process-output (get-buffer-process (current-buffer)))))
;; remove temp. lua file
(delete-file tempfile)
- (lua-postprocess-output-buffer lua-process-buffer lua-stdin-line-offset)
+ (lua-postprocess-output-buffer lua-process-buffer current-prompt
lua-stdin-line-offset)
(if lua-always-show
(display-buffer lua-process-buffer))))
;;}}}
;;{{{ lua-prompt-line
-(defun lua-postprocess-output-buffer (buf &optional lua-stdin-line-offset)
+(defun lua-postprocess-output-buffer (buf start &optional
lua-stdin-line-offset)
"Highlight tracebacks found in buf. If an traceback occurred return
t, otherwise return nil. BUF must exist."
(let ((lua-stdin-line-offset (or lua-stdin-line-offset 0))
line file bol err-p)
(save-excursion
(set-buffer buf)
- (beginning-of-buffer)
+ (goto-char start)
(while (re-search-forward lua-traceback-line-re nil t)
(setq file (match-string 1)
line (string-to-int (match-string 2)))))
- [nongnu] elpa/lua-mode fb12d2b 003/468: lua-send-region: create temporary file to send lua code as one chunk, (continued)
- [nongnu] elpa/lua-mode fb12d2b 003/468: lua-send-region: create temporary file to send lua code as one chunk, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 05a9513 004/468: fixed copyright notice, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode f9cbb91 007/468: make lua-process-buffer and lua-process global, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c13235f 008/468: fixed indention, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d91bf2b 011/468: new buffer-local variable: lua-electric-flag, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6a7929a 013/468: lua-postprocess-output-buffer: match first error, not last, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 78f7b78 014/468: emacs-compatibility: replace-in-string not available on GNU emacs, Philip Kaludercic, 2021/08/05
- [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 <=
- [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, 2021/08/05
- [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