From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlos Pita Subject: [Patch] [Feature request] Add option to natively fontify latex snippets and environment Date: Wed, 2 Jan 2019 19:52:26 -0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000adc971057e8180df" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gepNW-0002Js-8M for emacs-orgmode@gnu.org; Wed, 02 Jan 2019 17:52:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gepNS-0003U7-Nx for emacs-orgmode@gnu.org; Wed, 02 Jan 2019 17:52:44 -0500 Received: from mail-yw1-xc35.google.com ([2607:f8b0:4864:20::c35]:46608) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gepNS-0003Qw-EH for emacs-orgmode@gnu.org; Wed, 02 Jan 2019 17:52:42 -0500 Received: by mail-yw1-xc35.google.com with SMTP id t13so12600208ywe.13 for ; Wed, 02 Jan 2019 14:52:39 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --000000000000adc971057e8180df Content-Type: text/plain; charset="UTF-8" This patch adds a fourth 'native value to org-highlight-latex-and-related. It matches the same structures than 'latex but it calls org-src-font-lock-fontify-block instead. It's a simple change that brings full latex fontification by building on top of org-src. I'm using it (implemented as an advice) since a few weeks ago and haven't noticed any problem. Hope you like the idea. Best regards -- Carlos --000000000000adc971057e8180df Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Add-option-to-natively-fontify-latex-snippets-and-en.patch" Content-Disposition: attachment; filename="0001-Add-option-to-natively-fontify-latex-snippets-and-en.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attach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