[Top][All Lists]

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

RE: Sv: Sv: Christmas wish: Literate Elisp

From: arthur miller
Subject: RE: Sv: Sv: Christmas wish: Literate Elisp
Date: Tue, 17 Dec 2019 02:09:00 +0000

Of course, I am aware of outline modes, but my proposal is more about literate programming then outlining. Being able to use org outlining in elisp is just an extra icing on the cake that comes out implicitly as a bi product for free. Otherwise of course one can use outline code for folding. 

It is true, that keeping directives in comments does not break the existing parser, but then it is not so much of literate programming, is it?

If we would just use directives in comments then we already have org + babel. But I think 4 extra lines of C code to enable this feature in eval-loop was a trivial price to pay :-). 

Now I just wonder how to change the bytecode compiler. Unfortunately it seems to be much more involved process. I don't know  if I can do it, since I am  not so acquainted with Emacs internals, so it would be cool if someone more knowledgeable can at least hint me if not help.

Skickat från min Samsung Galaxy-smartphone.

-------- Originalmeddelande --------
Från: Jonathan Leech-Pepin <address@hidden>
Datum: 2019-12-16 17:07 (GMT+01:00)
Till: arthur miller <address@hidden>
Kopia: Stefan Monnier <address@hidden>, address@hidden, emacs-devel <address@hidden>
Ämne: Re: Sv: Sv: Christmas wish: Literate Elisp


Have you happened to have looked at Outshine (https://github.com/alphapapa/outshine)?

It enhances outline-minor-mode and lets it work with standard org-syntax while in comment blocks (and defines hotkeys to swap into an edit buffer that makes it look like a normal Org-Mode buffer).

By keeping the literate syntax in comments you don't break the existing parser.


On Mon, Dec 16, 2019 at 9:03 AM arthur miller <address@hidden> wrote:

Aha 😊

Sorry, I didn’t realized what you ment. I am not sure I know that much of elisp,

but I may try to look at, would be lots of learning for me 😊.


Skickades från E-post för Windows 10


Från: Stefan Monnier
Skickat: den 16 december 2019 14:41
Till: arthur miller
Kopia: emacs-devel; address@hidden
Ämne: Re: Sv: Sv: Christmas wish: Literate Elisp


>> As for using it in Elisp: I don't think there's anything stopping anyone
>> from making such a `literate-elisp-mode` and even arrange for `load` to
>> handle such a file (just like there is already a package that lets
>> `load` work directly on .org files).
> I was able to make readevalloop do what I want. It was rather trivial to

Note that in my comment above I meant it in existing Emacsen,
i.e. without any modification to the C code.
The idea is to make use of existing hooks such as
`load-source-file-function` or `file-name-handler-alist`.

I'm not sure what hook could be used to do the same with
byte-compilation, but in the worst case, an advice should do the trick.



reply via email to

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