Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"One Architecture, One OS" also translates as "One Egg, One Basket".


devel / comp.lang.lisp / Re: tiny editor written in common lisp?

SubjectAuthor
o Re: tiny editor written in common lisp?Steve G

1
Re: tiny editor written in common lisp?

<87pmk1srnr.fsf@l0ft.tpl>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=3306&group=comp.lang.lisp#3306

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 25 May 2022 07:50:09 -0500
From: Sgonedes1977@gmail.com (Steve G)
Newsgroups: comp.lang.lisp
Subject: Re: tiny editor written in common lisp?
References: <t3gje0$m2h$1@dont-email.me>
Date: Wed, 25 May 2022 08:50:00 -0400
Message-ID: <87pmk1srnr.fsf@l0ft.tpl>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Ax3l+/2KCXIMbtRQF0P7gWWNeGU=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 68
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-ncfMRaLYUVLSJ98B0A2WGo6qoWUXC5eEdGK4pilWKZ38JlweIEuqmDo3s9osb3PT9dZcK4FUyFIm/eg!bZjbCIBiN+kPa8xGT5OlS6A9+eNwBvrsya2JbKz/Gl+VOYTd
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3458
 by: Steve G - Wed, 25 May 2022 12:50 UTC

Jinsong Zhao <jszhao@yeah.net> writes:

> Hi there,
>
> Is there any tiny editor (the smaller, the better) that is written in Common
> Lisp?

I have written a terminfo to lisp code compiler. I was trying to
implement a readline like interface to terminfo for the ED function.
Unfortunately I got interrupted again. Let me know if your interested.
It is only ~ 2000 lines :)

I am trying to figure out how to implement the buffer. I would like fast
searching so a gap buffer would be better than a line structure.

I started it out as a rule/planning system to implement the best
possible sequences - the rule engine is too slow for practical use but
it is very fun to play with.

I have a working version that uses linux kernel keysyms. I am
struggling with signals and intervals for text highlighting.

Anyone have a solution for intervals. I was thinking to use displaced
arrays.

The other problem is unicode. I do not understand this. I planned on
just supporting the 96 letters in common lisp.

The rules are simple, they look like:

(define-motion ("cursor_home") (curscr)
(cm-cursor-save-xy curscr)
(setf (screen-cur-x curscr) (screen-beg-x curscr))
(setf (screen-cur-y curscr) (screen-beg-y curscr))
(output-cond! ((=> "home"))
((=> "cup") (output-sequence! "cup" (screen-beg-x curscr) (screen-beg-y curscr)))))

.

After the terminal definition is loaded it expands the rule into the following.

(PROGN
(DEFUN CM-CURSOR-HOME ()
"[cursor_home;home;ho]: home cursor (if no cup)"
(DECLARE
(OPTIMIZE SPEED (SAFETY 1) (DEBUG 2) (SPACE 0) (COMPILATION-SPEED 0)))
(LET ((CURSCR (CURRENT-SCREEN)))
(DECLARE (SCREEN CURSCR))
(CM-CURSOR-SAVE-XY CURSCR)
(SETF (SCREEN-CUR-X CURSCR) (SCREEN-BEG-X CURSCR))
(SETF (SCREEN-CUR-Y CURSCR) (SCREEN-BEG-Y CURSCR))
(BLOCK #:CURSOR-HOME
(LOCALLY
(DECLARE
(OPTIMIZE SPEED (SPACE 0) (DEBUG 3) (SAFETY 3) (COMPILATION-SPEED 0)))
(SB-UNIX:UNIX-WRITE (SCREEN-OFD CURSCR) "\E[H" 0 3)
T))))
(PUSHNEW 'CM-CURSOR-HOME *CM-FUNCTIONS* :TEST #'EQ))

I wanted to use it for goal planning - but this would be far to slow for
a read text editor.

I am using it across virtual terminals successfully. The buffering is a
pain. It also implements termios so that you can set the read to 4 bytes
UTF8.

If you have an example that is simple I would love to hear more.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor