[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/macrostep 0b1c0fe 069/110: Add swank/gray:stream-read-char
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/macrostep 0b1c0fe 069/110: Add swank/gray:stream-read-char-no-hang implementation |
Date: |
Sat, 7 Aug 2021 09:18:04 -0400 (EDT) |
branch: elpa/macrostep
commit 0b1c0fe4ca61cb44ed5a8d942ecd9b77331afc45
Author: Luís Borges de Oliveira <lbo@siscog.pt>
Commit: Luís Borges de Oliveira <lbo@siscog.pt>
Add swank/gray:stream-read-char-no-hang implementation
---
swank-macrostep.lisp | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/swank-macrostep.lisp b/swank-macrostep.lisp
index c94750b..c5f835a 100644
--- a/swank-macrostep.lisp
+++ b/swank-macrostep.lisp
@@ -136,19 +136,26 @@
:accessor newlines-of)
(forms :initform nil :accessor forms-of)))
-(defmethod swank/gray:stream-read-char ((stream form-tracking-stream))
+(defun %read-char (reader stream)
(handler-case
(let ((pos (position-of stream))
- (result (read-char (source-of stream))))
- (incf (position-of stream))
- (when (eql result #\Newline)
- (let* ((newlines (newlines-of stream))
- (n (length newlines)))
- (when (or (zerop n) (> pos (aref newlines (1- n))))
- (vector-push-extend pos newlines))))
- result)
+ (result (funcall reader (source-of stream))))
+ (when result
+ (incf (position-of stream))
+ (when (eql result #\Newline)
+ (let* ((newlines (newlines-of stream))
+ (n (length newlines)))
+ (when (or (zerop n) (> pos (aref newlines (1- n))))
+ (vector-push-extend pos newlines))))
+ result))
(end-of-file () :eof)))
+(defmethod swank/gray:stream-read-char ((stream form-tracking-stream))
+ (%read-char #'read-char stream))
+
+(defmethod swank/gray:stream-read-char-no-hang ((stream form-tracking-stream))
+ (%read-char #'read-char-no-hang stream))
+
(defmethod swank/gray:stream-unread-char ((stream form-tracking-stream)
character)
(prog1 (unread-char character (source-of stream))
(decf (position-of stream))))
- [nongnu] elpa/macrostep 8a85acc 022/110: Refactor backquote handling and text properties., (continued)
- [nongnu] elpa/macrostep 8a85acc 022/110: Refactor backquote handling and text properties., ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 2d216ba 109/110: Merge pull request #19 from fice-t/autoload, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 83b2a0a 015/110: Tweak visible highlight, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 3f815fb 031/110: Test for normal defmacro expansion, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 9d2c58c 040/110: Add option to expand in a separate buffer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 3f965b0 048/110: Use new `macrostep-macro-start` text property, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep ff3888f 065/110: Use a form-tracking stream rather than gensym substitution, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0fd292c 006/110: Better README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0db08ec 007/110: add Url: header for marmalade, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep aa4736c 067/110: Fix some silly errors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0b1c0fe 069/110: Add swank/gray:stream-read-char-no-hang implementation,
ELPA Syncer <=
- [nongnu] elpa/macrostep 704f164 091/110: Merge branch 'generic', ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep bf87b7c 095/110: Whitespace cleanup, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep d1e954d 099/110: Attempt to shell out to "indent" in macrostep-c, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep b65cc96 102/110: Makefile tweaks, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 424e373 110/110: Merge pull request #16 from fice-t/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep c5d1c5b 009/110: Autoload macro definitions if needed., ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 8b89694 012/110: Only enter macrostep-mode after successful macro expansion, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep b060e1a 014/110: Add visible highlight of expanded section, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 4b0d96f 013/110: Remove incorrect use of :version in defgroup, ELPA Syncer, 2021/08/07
- [nongnu] elpa/macrostep 0bcb143 019/110: Handle backquotes better, ELPA Syncer, 2021/08/07