[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sv: Sv: Sv: Sv: Christmas wish: Literate Elisp

From: arthur miller
Subject: Sv: Sv: Sv: Sv: Christmas wish: Literate Elisp
Date: Sun, 22 Dec 2019 07:01:03 +0000

My 2nd patch was wrong as I noticed too late yesterady, sorry for that.
Unfortunately I didn't have time to fix it. Here is one that works (at least
in my emacs), if any one would like to test the idea and play with idea of
using literal elisp. It is not only about being able to omit ';' in comments.

The idea is that normally in elisp, compiler skips comment-lines and
evaluate everything else. Here compiler evaluates code-lines and skips
everythign else. While it might seems like a same thing, it is not! There is
a certain inversion and slight difference because of that apparently subtle
difference. For instance, sine but code is ignored, this lets one use
org-mode as a kind of annotation tool or organisational tool for the
code. Normally the parser would choke and produced  error
messages if it was feeded with org headings and so n.

Another possibility is to maybe be able use elisp as a template or
annotation language or code generator for some other languages. For
example one could write a C code and use elisp macros or code
generators which expand to C after eval-buffer, kind -of what org-mode
does, but it would maybe make it easier or open some more possibilites
if one combines org-mode with directly evaluable elisp. Don't know, haven't
had time yet.

Anyway, I hope you can give it a try and discuss the idea not the
implementeation, implementation is just a sketch to give you something
to play with. It is unnecessary to theorycraft essays about all kind of
space problems before one tries it, in my opinion.


Från: arthur miller <address@hidden>
Skickat: den 21 december 2019 17:03
Till: Stefan Monnier <address@hidden>
Ämne: Sv: Sv: Sv: Sv: Christmas wish: Literate Elisp

> I personally would oppose these few-lines of new code in lread.c at
> least until this new feature is properly supported in the rest of the
> Elisp-manipulating tools we have (starting with the byte-compiler, but
> including checkdoc, autoload, ...) and until there's some clear evidence
> that it's useful (i.e. used by more than one person).

Completely agree on that one.

Unfortunately the time and effort and my struggle to just patch
bytecompiler.el to do this tells me I am not the right person to jump on
implementing "the skip" approach you suggest. Maybe some code, or
at least approach used in bytecompiler and eval can be even reused for
this, but to me personally it would take too much time and effort.

The other approach of copying file to temp buffer and modifying the file
is certainly less jobb and easier to implement. I also agree that it is suitable
for small toys and demo examples. It couldn't be difficult to implement, one
would need to keep track of balanced paranthesis + some few other small
things which isn't very difficult. While I can certainly hack elisp to a degree,
I am still not the right person to implement something you would distribute in
Emacs anyway, so if somebod else is interesting to implement this approach
it would be great.

Attachment: lread.patch
Description: lread.patch

Attachment: bytecomp.patch
Description: bytecomp.patch

Attachment: simple.patch
Description: simple.patch

Attachment: chatty.el
Description: chatty.el

reply via email to

[Prev in Thread] Current Thread [Next in Thread]