[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/forth-mode b8024ac331 088/153: Loading a Forth file provid
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/forth-mode b8024ac331 088/153: Loading a Forth file provides some feedback. |
Date: |
Sat, 29 Jan 2022 08:02:21 -0500 (EST) |
branch: elpa/forth-mode
commit b8024ac331d926a74ad938c508ed38db8f050da7
Author: Lars Brinkhoff <lars@nocrew.org>
Commit: Lars Brinkhoff <lars@nocrew.org>
Loading a Forth file provides some feedback.
---
forth-interaction-mode.el | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/forth-interaction-mode.el b/forth-interaction-mode.el
index 760fc23fbf..c40286d71c 100644
--- a/forth-interaction-mode.el
+++ b/forth-interaction-mode.el
@@ -1,3 +1,5 @@
+(eval-when-compile (byte-compile-disable-warning 'cl-functions))
+
(require 'comint)
(require 'forth-mode)
@@ -91,18 +93,19 @@
(run-forth))
(get-buffer-process forth-interaction-buffer))
-(defun forth-scrub (string)
+(defun forth-scrub (string &optional keep-ok)
"Remove terminal escape sequences from STRING."
(let ((n 0))
(while (setq n (string-match "[?[0-9;]*[a-z]" string n))
(setq string (replace-match "" t t string))))
(setq string (replace-regexp-in-string "\\`[[:space:]\n]*" "" string))
(setq string (replace-regexp-in-string "[[:space:]\n]*\\'" "" string))
- (setq string (replace-regexp-in-string "ok\\'" "" string))
- (setq string (replace-regexp-in-string "[[:space:]\n]*\\'" "" string)))
+ (if keep-ok
+ string
+ (setq string (replace-regexp-in-string "ok\\'" "" string))
+ (setq string (replace-regexp-in-string "[[:space:]\n]*\\'" "" string))))
-;;;###autoload
-(defun forth-interaction-send (&rest strings)
+(defun forth-interaction-send-raw-result (&rest strings)
(let* ((proc (forth-ensure))
(forth-result nil)
(forth-interaction-callback (lambda (x)
@@ -115,7 +118,11 @@
(while (< (float-time) end-time)
(accept-process-output proc 0.1))
(setq forth-words-cache nil)
- (forth-scrub forth-result)))
+ forth-result))
+
+;;;###autoload
+(defun forth-interaction-send (&rest strings)
+ (forth-scrub (apply #'forth-interaction-send-raw-result strings)))
;;;###autoload
(defun forth-words ()
@@ -144,7 +151,15 @@
;;;###autoload
(defun forth-load-file (file)
(interactive (list (buffer-file-name (current-buffer))))
- (forth-interaction-send "include " file))
+ (let ((result (forth-interaction-send-raw-result "include " file)))
+ (setq result (forth-scrub result t))
+ (if (< (count ?\n result) 2)
+ (message "%s" result)
+ (let ((buffer (current-buffer)))
+ (pop-to-buffer forth-interaction-buffer)
+ (goto-char (point-max))
+ (insert result "\n")
+ (pop-to-buffer buffer)))))
;;;###autoload
(defun forth-see (word)
- [nongnu] elpa/forth-mode 8d1d8ea795 099/153: Re-add test for 'syntax-propertize-function., (continued)
- [nongnu] elpa/forth-mode 8d1d8ea795 099/153: Re-add test for 'syntax-propertize-function., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 55de74bb4f 033/153: Query Forth session about defined words., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 44dd013096 059/153: Remove terminal escape sequences from strings returned from Forth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 399fd00921 055/153: Fix killing interactive Forth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 56bbc06a16 079/153: Error out if byte compilation fails in Emacs 23., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 531c9e11e2 023/153: Add autoload cookie to extension configuration, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 847481f866 061/153: Tweak window handling., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 5a08c82adb 111/153: Improve word movement commands inside symbols., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 50a7eb4bf1 094/153: Handle indentation of : and with smie instead of syntax-table., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 45f3f20f18 104/153: Make indentation case-insensitive, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode b8024ac331 088/153: Loading a Forth file provides some feedback.,
ELPA Syncer <=
- [nongnu] elpa/forth-mode 9eb3550cdc 045/153: Add imenu items to autocomplete candidates., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 350638bb0c 106/153: Make indentation case-insensitive, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 039bf122ee 067/153: Document key bindings in the manual., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 1a05d27d82 077/153: Fix loading backend file., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode b95f1b8a02 146/153: Fix typos in doc, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 2e75fb156f 081/153: Fix warning about defvar ignored., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 96c20f03f5 128/153: Make completion-at-point test work with Emacs23, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 867922d61e 112/153: Handle string literals more correctly, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 16f359442e 109/153: Add tests for word movement commands, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 45650c28a2 140/153: Check if forth interactive buffer is live, ELPA Syncer, 2022/01/29