From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.devel Subject: Re: Sv: Sv: Christmas wish: Literate Elisp Date: Fri, 20 Dec 2019 13:34:41 -0300 Message-ID: References: <87r213qkhm.fsf@alphapapa.net> <878sn9qxk3.fsf@alphapapa.net> <874kxxqlxz.fsf@alphapapa.net> <87v9qdp4x8.fsf@alphapapa.net> <207B2E96-FE0D-4F53-8D5F-1B6C96480661@traduction-libre.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d9ac36059a254186" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="30267"; mail-complaints-to="usenet@blaine.gmane.org" Cc: arthur miller , "emacs-devel@gnu.org" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 20 17:36:43 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 1iiLGc-0007i9-Hh for ged-emacs-devel@m.gmane.org; Fri, 20 Dec 2019 17:36:42 +0100 Original-Received: from localhost ([::1]:58786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiLGb-0001MN-A4 for ged-emacs-devel@m.gmane.org; Fri, 20 Dec 2019 11:36:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54070) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiLEu-0007ZA-HQ for emacs-devel@gnu.org; Fri, 20 Dec 2019 11:34:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iiLEs-0002hG-Cr for emacs-devel@gnu.org; Fri, 20 Dec 2019 11:34:56 -0500 Original-Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:43556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iiLEs-0002fU-5u for emacs-devel@gnu.org; Fri, 20 Dec 2019 11:34:54 -0500 Original-Received: by mail-pg1-x534.google.com with SMTP id k197so5181235pga.10 for ; Fri, 20 Dec 2019 08:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XAnISCjYIGxeC8YA7WfkqiwBkDgvKJthv2oWbqWBArA=; b=MlsWrE9zfHMUeI/R/p7jC6hbkVdvGGtY044u0GTL28g4vSccl7cSPapTmtlWby5xDy fWrjkUoM7aShaWFlzsX+PTAmClCWPSfNK13U9ixGwXUhgbOia5zxiA1iSSU2xyloBW9t bIYvlxqeRyJK7NCw6fE9528SAKrl4OnHM2+0k7I6sHNJ/nURq6tKSHpqRJCJrxUEI9G2 gWBkxMkAFWtz4tA4FuEoj8hqFaAP+J0BmDMx5Nahgx8ZbvnmaBoZf0BSeQPESUx3MDuQ +NEZKDNPdltlBeAZSNS/9evQah+Fs/BgwIR+BvaaRyHno+ow6mO1PukOFe+k91AGqhY4 MIjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XAnISCjYIGxeC8YA7WfkqiwBkDgvKJthv2oWbqWBArA=; b=jMaJ6t5DQUBcOTl6+mTL4nOtKGa3R3DXBwNMAWIsXKr5hOFtGZyVDRPrfQZnNh8yca sT37XkfX17gaJQy/cYZClk1zVhWDYNWhly4FN/8lVagEJsC7GkyW6EJxM7146vGpaEjY 8plbdyJ7Rqf4ykQXA2mEjW9fYbgoBBK2+88XmYuBuRR65s4Z9eXEiZaEv67HN8KfZYjb KZMFSg9oO1WXXbNIUWsfhwEyWaDNjLh5d1zvxhiHLTt0o4bTrDHuPY3Z2oxBBTLfoUdz RwixP4d/v45UG4At18TEb0xGVMVDcZiH4FgG7XQzFReihhl3MoBrw3TfA010xDoJYf2o nhjg== X-Gm-Message-State: APjAAAXNdqUwDxrosgvVfJfr+lkrYWht3gpqUeARPwlsb6ZmIFOUVGqp vwPmosFQS6bAWYqKvHIgM1MEImJQ6/MzgJ66xh0= X-Google-Smtp-Source: APXvYqyfO1aENJ8AZVB2ilJxZ3nT22PcbaJ3VyRYl6blQHSlSJ4mnAssGrcMW4d7wB2QX38uOOhe5knHz4QFRnwmbNk= X-Received: by 2002:a63:f743:: with SMTP id f3mr15835781pgk.28.1576859692803; Fri, 20 Dec 2019 08:34:52 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::534 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:243516 Archived-At: --000000000000d9ac36059a254186 Content-Type: text/plain; charset="UTF-8" I was expecting that Arthur would come up with a preprocessor written in (I guess) 30 lines of Elisp... a lot of people would like to play with it, add tests, modify it, and so on - and we could use it to learn how to create our own preprocessors. A preprocessor written as patch to the C source of Emacs feels useless to me. [[]], Eduardo Ochs http://angg.twu.net/#eev http://angg.twu.net/emacsconf2019.html On Fri, 20 Dec 2019 at 13:18, Stefan Monnier wrote: > > I really understand the concern, but I must ask how would one change the > > elisp itself without re-implementing much or some of of elisp parser if > it would > > be done externally? > > I recommend you take a look at the existing function used on > load-source-file-function (i.e. load-with-code-conversion): it loads the > source file into a buffer and then calls `eval-buffer`. > > So all it would take is for you to erase the text (aka non-code) part of > the source code before passing it to `eval-buffer` (but of course, only > do it when that source is using your new format). > > Or instead of `eval-buffer` you might "manually" skip the text parts, > then use `read` + `eval` on the code parts. This would probably take > a bit more effort in order to correctly handle (defvar foo). > > > Stefan > > > --000000000000d9ac36059a254186 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I was expecting that Arthur would come up= with a preprocessor written
in (I guess) 30 lines of Elisp... a lot of = people would like to play
with it, add tests, modify it, and so on - and= we could use it to
learn how to create our own preprocessors.

A = preprocessor written as patch to the C source of Emacs feels useless
to = me.

=C2=A0 [[]],
=C2=A0 =C2=A0 Eduardo Ochs
=C2=A0 =C2=A0 http://angg.twu.net/#eev
=C2=A0 =C2= =A0 http://angg.twu.net/= emacsconf2019.html

On Fri, 20 Dec 2019 at 13:18, Stefan Monnier <= monnier@iro.umontreal.ca>= ; wrote:
> I = really understand the concern, but I must ask how would one change the
> elisp itself without re-implementing much or some of of elisp parser i= f it would
> be done externally?

I recommend you take a look at the existing function used on
load-source-file-function (i.e. load-with-code-conversion): it loads the source file into a buffer and then calls `eval-buffer`.

So all it would take is for you to erase the text (aka non-code) part of the source code before passing it to `eval-buffer` (but of course, only
do it when that source is using your new format).

Or instead of `eval-buffer` you might "manually" skip the text pa= rts,
then use `read` + `eval` on the code parts.=C2=A0 This would probably take<= br> a bit more effort in order to correctly handle (defvar foo).


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


--000000000000d9ac36059a254186--