From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiha Subject: Re: Questions about exporting: subtitle, level formating, custom highlight markers error Date: Tue, 28 Jul 2015 15:47:40 +0200 Message-ID: <55B787FC.5050409@laposte.net> References: <55B4DAEC.7030805@laposte.net> <87egjugfry.fsf@ucl.ac.uk> <55B63847.5050101@laposte.net> <871tftprsd.fsf@ucl.ac.uk> <55B769D0.8060306@laposte.net> <87y4i01o89.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------050702040103030208090809" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK5D9-0003kc-Cc for emacs-orgmode@gnu.org; Tue, 28 Jul 2015 09:46:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZK5D2-0002At-29 for emacs-orgmode@gnu.org; Tue, 28 Jul 2015 09:46:27 -0400 Received: from smtpoutz25.laposte.net ([194.117.213.100]:41083 helo=smtp.laposte.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZK5D1-0002AX-MW for emacs-orgmode@gnu.org; Tue, 28 Jul 2015 09:46:20 -0400 Received: from smtp.laposte.net (localhost [127.0.0.1]) by lpn-prd-vrout013 (Postfix) with ESMTP id 11FC9F8B0D for ; Tue, 28 Jul 2015 15:46:18 +0200 (CEST) Received: from lpn-prd-vrin002 (unknown [10.128.63.3]) by lpn-prd-vrout013 (Postfix) with ESMTP id 0C4E9F8AFD for ; Tue, 28 Jul 2015 15:46:18 +0200 (CEST) Received: from lpn-prd-vrin002 (localhost [127.0.0.1]) by lpn-prd-vrin002 (Postfix) with ESMTP id F05F75BFA4C for ; Tue, 28 Jul 2015 15:46:17 +0200 (CEST) Received: from [192.168.1.12] (ptr-178-51-32-206.dyn.mobistar.be [178.51.32.206]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lpn-prd-vrin002 (Postfix) with ESMTPSA id 1C38B5BFA1E for ; Tue, 28 Jul 2015 15:46:16 +0200 (CEST) In-Reply-To: <87y4i01o89.fsf@ucl.ac.uk> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------050702040103030208090809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Thanks guys. Getting closer - but please don't overestimate my backgound=20 knowledge :) On 07/28/2015 02:05 PM, Eric S Fraga wrote: > You need to differentiate between two aspects: highlighting of text > within a org buffer and what happens to text when exported. Yes. Principally, I want the former. As to the latter: (1) my custom highlighting shouldn't break exporting.=20 (2) /If/ highlighting can appear in the exported document, that's a=20 bonus. But clearly it's not trivial to do; so never mind. > In the new exporter, I don't think you can implement anything that cove= rs > both use cases. > > I am not entirely sure what it is you want. If you want just one of > these, for the former, font-lock-add-keywords is probably what you want > to pursue. Right, so grabbing code from the manual about font lock mode=20 ,=20 how do I adapt it? I tried putting this in my .emacs file ;; Highlight text between =B7interpuncts=B7 (add-hook 'org-mode-hook (lambda () (font-lock-add-keywords nil '(("=B7\w=B7" 1 font-lock-warning-face t))))) but that doesn't work. Probably that regexp is all wrong? Also, I don't want it to use font-lock-warning-face particularly. (How)=20 can I define a new face for this purpose? Nick Dokos wrote: > Emphasis is detected in the parser, so it is indeed difficult to add ne= w > emphasis for export. > > Since you don't care about the added emphasis in the exported document > (only in the org buffer), using latest org from git works OK, So do I understand correctly that this is a completely different route=20 than the font-lock-add-keywords one above? I.e. using this latest git=20 version, I can define the highlight marker as I did and described=20 earlier, and there's no need for a new face, because it uses the=20 'highlight' defined in the theme I'm using. Correct? I cloned the git files, but I'm wary of the next steps. If I just make=20 and make install, will it not half-overwrite my current stable Org, and=20 become a big mess? Sorry, this stuff is new to me and not really obvious. Also: I tried reinstalling Org via the menu, Options >> Manage Emacs=20 Packages in hopes that it would install the git version while taking=20 care of avoiding a mess. It now lists 20150727 as the version, so that's=20 recent, but is that the 'bleeding edge' version or the stable version at=20 that date? It didn't solve the problem, at any rate. > except > that the marker characters are copied verbatim to the output, so you'll > have some cleanup to do. That's okay. It's not a problem for draft versions of the document; and=20 by the time the final document is ready, all this temporary highlighting=20 should be gone! > I also tried 8.2.9 and got an error, but the error is different from > what you get (backtrace attached). I am using 8.2.10 not 8.2.9 so that may explain the difference. cheers --------------050702040103030208090809 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Thanks guys. Getting closer - but please don't overestimate my backgound knowledge :)

On 07/28/2015 02:05 PM, Eric S Fraga wrote:
You need to differentiate between two aspects: highlighting of text
within a org buffer and what happens to text when exported.
Yes. Principally, I want the former.

As to the latter: (1) my custom highlighting shouldn't break exporting. (2) If highlighting can appear in the exported document, that's a bonus. But clearly it's not trivial to do; so never mind.

In the new exporter, I don't think you can implement anything that covers
both use cases.

I am not entirely sure what it is you want.  If you want just one of
these, for the former, font-lock-add-keywords is probably what you want
to pursue.
Right, so grabbing code from the manual about font lock mode, how do I adapt it? I tried putting this in my .emacs file

;; Highlight text between ·interpuncts·                                                                                                            
(add-hook 'org-mode-hook                                                                                                                                     
          (lambda ()                                                                                                                                         
           (font-lock-add-keywords nil                                                                                                                      
            '(("·\w·" 1                                                                                                                                    & nbsp;
               font-lock-warning-face t)))))

but that doesn't work. Probably that regexp is all wrong?

Also, I don't want it to use font-lock-warning-face particularly. (How) can I define a new face for this purpose?

Nick Dokos wrote:
Emphasis is detected in the parser, so it is indeed difficult to add new
emphasis for export. 

Since you don't care about the added emphasis in the exported document
(only in the org buffer), using latest org from git works OK,
So do I understand correctly that this is a completely different route than the font-lock-add-keywords one above? I.e. using this latest git version, I can define the highlight marker as I did and described earlier, and there's no need for a new face, because it uses the 'highlight' defined in the theme I'm using. Correct?

I cloned the git files, but I'm wary of the next steps. If I just make and make install, will it not half-overwrite my current stable Org, and become a big mess? Sorry, this stuff is new to me and not really obvious.

Also: I tried reinstalling Org via the menu, Options >> Manage Emacs Packages in hopes that it would install the git version while taking care of avoiding a mess. It now lists 20150727 as the version, so that's recent, but is that the 'bleeding edge' version or the stable version at that date? It didn't solve the problem, at any rate.

except
that the marker characters are copied verbatim to the output, so you'll
have some cleanup to do.
That's okay. It's not a problem for draft versions of the document; and by the time the final document is ready, all this temporary highlighting should be gone!

I also tried 8.2.9 and got an error, but the error is different from
what you get (backtrace attached).
I am using 8.2.10 not 8.2.9 so that may explain the difference.

cheers
--------------050702040103030208090809--