From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YOrzFqm6YF+9BgAA0tVLHw (envelope-from ) for ; Tue, 15 Sep 2020 12:59:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0Mo1Eam6YF+GewAAbx9fmQ (envelope-from ) for ; Tue, 15 Sep 2020 12:59:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D3423940390 for ; Tue, 15 Sep 2020 12:59:20 +0000 (UTC) Received: from localhost ([::1]:60928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIAYJ-00063i-5B for larch@yhetil.org; Tue, 15 Sep 2020 08:59:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIADF-0004vk-1f for emacs-orgmode@gnu.org; Tue, 15 Sep 2020 08:37:34 -0400 Received: from mail.tuxteam.de ([5.199.139.25]:44633) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1kIADA-0002mB-Cu for emacs-orgmode@gnu.org; Tue, 15 Sep 2020 08:37:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:Date; bh=+bLGnyfASVEs4voAQLnVqBR6i1xhiuWKgg6LdjCW7J8=; b=IIQbe6e761fznhThg2O7nLHyfzh35nsRZrjYjeNRL11OTJXy9d4TMk/P66LKK+SChSJk/hpJVnQkWLbrrHA1wWraCis/4HOrDQuQOJR8MDJ6/lReXjmzXGEpmMidbTPbfoHlu3Ja0YYb7Q+TAuSWTRO6bOHZe+M0CKtm6Bivb5NMfoQGMrD/fgUTjF9OF5dFlEV3/kBdaeDF5wXriB6OUKVuz1h0JAMcvz5A6IBGsMF+lSlz6eoPJXpKlmPiuZKUiU/eREq3TBRgG2h+2SEtLVKxeqhRQFrmPnMLgcQ36+5gc1a7iiu/oqMXlsxK0CUZrJpYD3Tg1TdP8cmQ857mFQ==; Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1kIAD4-0005WV-MI; Tue, 15 Sep 2020 14:37:22 +0200 Date: Tue, 15 Sep 2020 14:37:22 +0200 To: =?utf-8?B?UHJ6ZW15c8WCYXcgS2FtacWEc2tp?= Subject: Re: official orgmode parser Message-ID: <20200915123722.GA20532@tuxteam.de> References: <68dc1ea1-52e8-7d9e-fb2d-bcf08c111eca@intrepidus.pl> <87d02n2yyr.fsf@gmail.com> <482cea5c-4214-57ac-dfeb-1e305180fee5@intrepidus.pl> <20200915095548.GP20869@maokai> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) From: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/15 08:37:25 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=tuxteam.de header.s=mail header.b=IIQbe6e7; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -3.31 X-TUID: ihc9zIYfo8R7 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 15, 2020 at 01:15:56PM +0200, Przemys=C5=82aw Kami=C5=84ski wro= te: [...] > There's the org-json (or ox-json) package but for some reason I > wasn't able to run it successfully. I guess export to S-exps would > be best here. But yes I'll check that out. If that's your route, perhaps the "Org element API" [1] might be helpful. Especially `org-element-parse-buffer' gives you a Lisp data structure which is supposed to be a parse of your Org buffer. =46rom there to S-expression can be trivial (e.g. `print' or `pp'), depending on what you want to do. Walking the structure should be nice in Lisp, too. The topic of (non-Emacs) parsing of Org comes up regularly, and there is a good (but AFAIK not-quite-complete) Org syntax spec in Worg [2], but there are a couple of difficulties to be mastered before such a thing can become really enjoyable and useful. The loose specification of Org's format (arguably its second or third strongest asset, the first two being its incredible community and Emacs itself) is something which makes this problem "interesting". People have invented lots of usages which might be broken should Org change to a strict formal spec. You don't want to break those people. But yes, perhaps some day someone nails it. Perhaps it's you :) Cheers [1] https://orgmode.org/worg/dev/org-element-api.html [2] https://orgmode.org/worg/dev/org-syntax.html - t --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAl9gtYIACgkQBcgs9XrR2kaMZACdEY4G4/rC3694N/Y+x6K22Gid a2YAnj8N5mG4bhxKxWLgn5T7uIleK3j+ =RZ3K -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF--