From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Convert README.org to plain text README while installing package Date: Mon, 06 Jun 2022 08:59:09 +0800 Message-ID: <87tu8y4nfm.fsf@localhost> References: <87leuca7v7.fsf@disroot.org> <87czfopmsd.fsf@gnu.org> <87h74ztshe.fsf@gmx.de> <871qw31ois.fsf@yahoo.com> <8735gj4ceo.fsf@gnu.org> <87leub5p6i.fsf@localhost> <87tu8yzl41.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35011"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tassilo Horn , Po Lu , Michael Albinus , Alan Mackenzie , Stefan Kangas , Akib Azmain Turja , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 06 02:59:16 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ny15Q-0008wQ-Ps for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jun 2022 02:59:16 +0200 Original-Received: from localhost ([::1]:50238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ny15P-0000cO-Ah for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jun 2022 20:59:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ny14m-0008KX-0x for emacs-devel@gnu.org; Sun, 05 Jun 2022 20:58:36 -0400 Original-Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:47015) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ny14k-0002Z0-Hq; Sun, 05 Jun 2022 20:58:35 -0400 Original-Received: by mail-pl1-x632.google.com with SMTP id w3so10915589plp.13; Sun, 05 Jun 2022 17:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=ly26obocqtutsDt2wDG+wVyTYA9PHl6MhlLAZcZusZc=; b=C++i3Ikit/gdTZL1RJaU24YJb6EA6AkR+HWQM48fSojZfT3+imxYBmP5MTJ7heYrir 2Wcs9o20tSBChhbG3yeqQgjWZ/oDsfYuaLImKWoVULMTTJR7h8gRtxTTn1Bqg2dnZqDZ 6qtZaZ420KccqwOLSp78E/xyqebVsSb8VGVPUOnl9KhK/xBYMfDumXq4XuGj4CabvexO fzMY2OYef1aZwmUjBmgyZOYu2K1IYYP4cflM2BzUo3zhfnM9WyicjfaHcLUdTNk6Hrqt lR+brNyI7ILvTxE7wVqo9dh1dT5qo24OXSWXP/T3QMRKVjHwHrkAyYHbkNtzUDMS9zHz 8f4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=ly26obocqtutsDt2wDG+wVyTYA9PHl6MhlLAZcZusZc=; b=MDReFTqV+hdYU6uazJnQCtezI0gg5poI7Zod5GWd12glztwmPSqimmzCjSIdSu/DKg DZWJwBBzkOmcNAbfGRahZsAXGSkABcyB0HcG9WfynWHcHBPSZOFtMLrvfVyKPpdwm+Mc QtwVmHKtWOvw0uYQEGr+RYSZ7mJ4xuRUj9XbbofVG2DIP1S6oP6E4nLG8Y5sWCakSCyG UljuugntbnAuUQFn8wVt8/VDqJ+zRHob65GWC3EGLQjXjksPxVA/SVzkApV9yrTgEB0T PongL9a9dZNHLER3OO8xLAafJlH2MBhvcr2DmcnWz/ZjT1uHtuTsoPiWPhIi53D/IBF9 zjTQ== X-Gm-Message-State: AOAM530jjqqXn8qerBW2yOVLqfZk4Hpr2IhMQc6NsBTk3fxNZsW9MYSQ h7QjAVhtK+yFjRaVsKd8CS4= X-Google-Smtp-Source: ABdhPJzGGrdM+COo9gZn1K65hwMl6kkaBk3Q0kpgzIpnIXicf+P1u89YL/A/6jpW1uycyp2Jm6FUGg== X-Received: by 2002:a17:90b:1646:b0:1e3:15ef:2871 with SMTP id il6-20020a17090b164600b001e315ef2871mr38464283pjb.105.1654477112592; Sun, 05 Jun 2022 17:58:32 -0700 (PDT) Original-Received: from localhost ([208.115.232.2]) by smtp.gmail.com with ESMTPSA id q7-20020a056a0002a700b0051008603b66sm9362106pfs.219.2022.06.05.17.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 17:58:31 -0700 (PDT) In-Reply-To: <87tu8yzl41.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=yantar92@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290761 Archived-At: Lars Ingebrigtsen writes: > Ihor Radchenko writes: > >> We, Org devs, are working on modularizing Org. >> Currently, extracting fontification is not trivial because it depends on >> most of Org being loaded. >> >> If everything goes as planned (famous last words), fontification will >> only require Org parser and Org fontification library. > > Perhaps it would be a smaller project to just make a super-simple Org > parser/displayer to handle what we typically see in a README.org file? > I.e., something that does nice fontification of #+ blocks and *** > headings and =this= (etc.), and then just removes all the rest of the > markup. > > I mean, it sounds like it could be a very small, lightweight library to > get to a 90% solution that would be acceptable to show in the *Help* > buffer. And then we wouldn't have to convert anything. In short, no. Org is not context free, so we at least need org-element.el parser to handle various edge cases. In particular, there are quite annoying edge cases with fontification of links containing */- markup symbols. One could extract a subset of allowed Org elements from org-element.el, but it would also involve refactoring org-element--current-element, making the whole effort a maintenance burden against future changes in Org. And even if that job is done, we cannot remove links from the parser. Yet, according to the previous benchmarks in this thread, loading links (that is what org-modules contains by default) is giving the largest overheads. IMHO, the proposed lightweight library will require similar efforts to modularizing Org + loading it with some minimal variable settings (for example, org-modules set to nil). Best, Ihor