|
From: | Xiha |
Subject: | Re: [O] Questions about exporting: subtitle, level formating, custom highlight markers error |
Date: | Tue, 28 Jul 2015 15:47:40 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
Thanks guys. Getting closer - but
please don't overestimate my backgound knowledge :)
On 07/28/2015 02:05 PM, Eric S Fraga wrote: Yes. Principally, I want the former.You need to differentiate between two aspects: highlighting of text within a org buffer and what happens to text when exported. 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. Right, so grabbing code from the manual about font lock mode, how do I adapt it? I tried putting this in my .emacs fileIn 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. ;; Highlight text between ·interpuncts· (add-hook 'org-mode-hook (lambda () (font-lock-add-keywords nil '(("·\w·" 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) can I define a new face for this purpose? Nick Dokos wrote: 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?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, 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. 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!except that the marker characters are copied verbatim to the output, so you'll have some cleanup to do. I am using 8.2.10 not 8.2.9 so that may explain the difference.I also tried 8.2.9 and got an error, but the error is different from what you get (backtrace attached). cheers |
[Prev in Thread] | Current Thread | [Next in Thread] |