From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [New exporter] custom emphasis in org-emphasis-alist Date: Sun, 10 Feb 2013 09:37:08 +0100 Message-ID: <876220h8ej.fsf@gmail.com> References: <87ehgpc8jw.fsf@univie.ac.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4TEO-0004nw-Qh for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 04:29:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4TEM-0007ji-K4 for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 04:29:52 -0500 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:56531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4TEM-0007jE-Cj for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 04:29:50 -0500 Received: by mail-we0-f170.google.com with SMTP id z53so4071339wey.15 for ; Sun, 10 Feb 2013 01:29:49 -0800 (PST) In-Reply-To: <87ehgpc8jw.fsf@univie.ac.at> (Gregor Kappler's message of "Sun, 10 Feb 2013 01:32:51 +0100") 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: Gregor Kappler Cc: emacs-orgmode@gnu.org Hello, Gregor Kappler writes: > I am currently migrating my system and contribute my first stop: > custom emphasis characters that I use extensively: > - "!" is used for exclamations, > - "?" for questions, and > - "#" for in-text comments that I do not want exported. Emphasis characters are now hard-coded. You cannot change them, though, you can change how each back-end interprets them. We are solidifying Org syntax for parsing purposes. Allowing variable markup is asking for trouble. The plan is to make `org-emphasis-alist' a defconst. On the other hand, you may be able to parse custom markup with the help of a filter: #+begin_src emacs-lisp (defun my-special-markup (text backend info) (when (and (org-export-derived-backend-p backend 'html) (string-match "\\([ ('\"{]\\|^\\)\\(\\([?!#]\\)\\([^ ,\"']\\|[^ ,\"'].*?\\(?: .*?\\)\\{0,1\\}[^ ,\"']\\)\\3\\)\\([- .,:!?;'\")}\\]\\|$\\)" text)) (format (cond ((equal (match-string 3 text) "?") "%s") ((equal (match-string 3 text) "#") "") (t "%s")) (match-string 4 text)))) (add-to-list 'org-export-filter-plain-text-functions 'my-special-markup) #+end_src Regards, -- Nicolas Goaziou