From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Timothy Newsgroups: gmane.emacs.devel Subject: Re: Core package offering - engrave-faces.el Date: Fri, 16 Jul 2021 14:04:00 +0800 Message-ID: <871r7yztf3.fsf@gmail.com> References: <87y2afv122.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18035"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 28.0.50 To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 16 08:05:37 2021 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 1m4Gyf-0004WO-9L for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Jul 2021 08:05:37 +0200 Original-Received: from localhost ([::1]:52164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4Gyd-0003NE-BS for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Jul 2021 02:05:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4GxE-0002aA-UD for emacs-devel@gnu.org; Fri, 16 Jul 2021 02:04:08 -0400 Original-Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:45951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4GxD-0006Dl-3L for emacs-devel@gnu.org; Fri, 16 Jul 2021 02:04:08 -0400 Original-Received: by mail-pf1-x434.google.com with SMTP id q10so7981039pfj.12 for ; Thu, 15 Jul 2021 23:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:in-reply-to:message-id:date :mime-version; bh=sfTJbQFYpzw9QiacIa+VOvrq3xpcg45387CU1v6N2Nc=; b=sms5tCXWRr5m8552WoPK09soEHnx2xnCSxuI+N0pwAm23SUu2LeXqEd2gdQ3wOjrqK 4egfhgPzQOgwf68v2QA/hnq6qDA0zPJ5a3/viEs2K00Htu1954Op7t559i40GNBOLkst n1v8UXNiwXVOI9ZEJsNHCRLNsCFrdnjiXTmjz/pOId/HVYzvdJNqCD4bXwEv5Zcous4F ze/59x7kZK/Lw9d1UaF4d1nR6c4/Ug2WJUNKpF3RjKFe6wKbKbNpwHAcfTY7G5K7pWVv +B0N4BPsYbtKQPq85fokssbP1KFiIAY03zc5+GrOyPuC1nzi5ducbCo+OI4UhFAgWBMp Dmgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject :in-reply-to:message-id:date:mime-version; bh=sfTJbQFYpzw9QiacIa+VOvrq3xpcg45387CU1v6N2Nc=; b=EHQmR7+It5wgNAXnjbyUs3c7svvSRi4kADk2NU+VeeZkDVq2Du/Aq2sYeeoiMDjrO3 YwlW/lmKihpxNZa8ejR3YXHxYcKJgtSzvJZZrxAwmT7QZV+G3VCET4ha9Xb3Q5gLSWZ5 Sckd4WSotPuTXthCZP7vAHaZF+xfReyT4tR86aRqEgmahlGocbpk/e9dHQ+Aj0BaeFuM at67q8NLtEC++rNOO/B80f6aJVhbYTu009CA/CoSjpmzyniz0z4sHCmkc8lvaijJBdM6 shJ7nnz9k7tV51kYjNlLZOk7xoEeRWG5sTN50SCQE88NN9Zjn8HYNPYB4X5BpUjAs0aW shVw== X-Gm-Message-State: AOAM531PN178jpBv8+18ej12VzIpUqRFSLN7AlBNbMYa6bIPstMTcS7n GCyI745r/i3dRfq/bJBTcKWCL/AkYfA= X-Google-Smtp-Source: ABdhPJzhfCxKZ4DlT/9BJBofOXaX2CNxbuFrZw88lGABy0l9K307OdxdluJSql1JFNjSeYJGxwEsCQ== X-Received: by 2002:a63:5f04:: with SMTP id t4mr8275477pgb.307.1626415444628; Thu, 15 Jul 2021 23:04:04 -0700 (PDT) Original-Received: from localhost (180-150-91-8.b4965b.per.nbn.aussiebb.net. [180.150.91.8]) by smtp.gmail.com with ESMTPSA id p24sm8922346pfh.17.2021.07.15.23.04.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 23:04:04 -0700 (PDT) In-reply-to: <87y2afv122.fsf@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=tecosaur@gmail.com; helo=mail-pf1-x434.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271283 Archived-At: It would be great if someone might be willing to take a look at this and respond :) If my proposal doesn't sound good, I'd rather it was rejected outright so I know where I stand before I get started with an exploratory Org branch to integrate this with some of the current exporters. -- Timothy writes: > Hi All, > > Over the last few months I have worked on a package that I think may be > a good candidate for inclusion into Emacs. It has recently reached what > I consider a sufficient quality for consideration - though I anticipate > that should this be seen as promising there will likely be suggested > improvements. > > This has been motivated by a desire to produce a better method of > formatting Org source blocks in PDF export, and inspired by htmlize. > > Unlike htmlize, Engrave Faces provides general functionality to > transform a buffer into another format with font-lock information. > This core functionality is currently made us of in > engrave-faces-latex.el, engrave-faces-ansi.el, and engrave-faces-html.el > to provide exporters for LaTeX, ASCII/ANSI, and HTML. > > Compared to htmlize and htmlfontify.el, Engrave Faces currently lacks > the ability to treat links specially, or properly handle the text > transformation performed by overlays*. However, this is also much smaller > and hopefully more maintainable. > - engrave-faces.el is 250 sloc > - engrave-faces-latex.el is 100 sloc > - engrave-faces-ansi.el is 140 sloc > - engrave-faces-html.el is 115 sloc > ( *there may be other differences, but this is what's apparent to me. ) > > For comparison, htmlize.el is 1700 sloc and htmlfontify.el is 2200 sloc. > > Engrave Faces also possesses the unique capability that it can be given > a list of preset face styles which will override the current attributes > of those faces. These overrides are also passed down with inheritance, > via an internal expansion and merging of face attribute information. > This allows one to save the details for a certain theme, and "engrave" > the buffer with font-lock attributes from that theme regardless of what > the current theme is. For ease of applying this to with your current > theme a function `engrave-faces-generate-preset' is provided which > re-generates the saved face information using the current theme. > > I feel that this is likely generally useful functionality, and so would > like to offer it to Emacs to make it more accessible and more visible > for improvement. > > I am currently an FSF-assigned contributor to Org mode, and assume that > this should make contributing to Emacs fairly straightforward. > > Attached you may find the engrave-faces{,-latex,-ansi,-html}.el as well > as LaTeX, ASCII/ANSI, and HTML versions of engrave-faces.el for sampling. > The code is also available at https://github.com/tecosaur/engrave-faces. > > All the best, -- Timothy