From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Sv: Sv: Sv: Christmas wish: Literate Elisp Date: Wed, 18 Dec 2019 16:59:52 -0600 Message-ID: <874kxxqlxz.fsf@alphapapa.net> References: <87r213qkhm.fsf@alphapapa.net> <878sn9qxk3.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="7222"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 19 00:00:12 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ihiIe-0001lD-CE for ged-emacs-devel@m.gmane.org; Thu, 19 Dec 2019 00:00:12 +0100 Original-Received: from localhost ([::1]:33672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihiId-0000eE-0e for ged-emacs-devel@m.gmane.org; Wed, 18 Dec 2019 18:00:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52677) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihiIW-0000dr-71 for emacs-devel@gnu.org; Wed, 18 Dec 2019 18:00:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihiIU-0004R3-Tz for emacs-devel@gnu.org; Wed, 18 Dec 2019 18:00:04 -0500 Original-Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:34626 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihiIU-0004L3-MH for emacs-devel@gnu.org; Wed, 18 Dec 2019 18:00:02 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1ihiIR-0001aF-W9 for emacs-devel@gnu.org; Wed, 18 Dec 2019 23:59:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243459 Archived-At: Stefan Monnier writes: > Thre is no discussion of changing the existing syntax/semantic of > Elisp here. Arthur is proposing a new file format/syntax as an > alternative to the use of weave/tangle or Org-mode. That's not my understanding of what Arthur is proposing. You did propose an alternative file format in earlier messages when you wrote: > 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'd welcome such a > package in GNU ELPA. And: > 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. But Arthur has been proposing to alter the Emacs Elisp parser itself, e.g. when he wrote: > My proposal is to slightly change Elisp parser to treat lines that > start with any other printable character but '(' as a start of comment > and to simply ignore the line, just as it treats ';' as a comment And: > I was able to make readevalloop do what I want. It was rather trivial > to implement this (once I realized how it works 🙂). Emacs built fine > and I was able to test wtih eval-buffer and eval-regionwhich worked as > intended. > It was just 4 code lines, I just copied codeto parse comment and > change the condition in if-statement: > However, byte compiler is not happy about this. It emits warnings for > every word out of code blocks as references to free variables. I am > not sure where to look to patch it, maybe another day. And: > 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. I've looked again at all messages in the thread. Am I missing something?