emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Gregor Kappler <g.kappler@gmx.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [New exporter] custom emphasis in org-emphasis-alist
Date: Sun, 10 Feb 2013 09:37:08 +0100	[thread overview]
Message-ID: <876220h8ej.fsf@gmail.com> (raw)
In-Reply-To: <87ehgpc8jw.fsf@univie.ac.at> (Gregor Kappler's message of "Sun, 10 Feb 2013 01:32:51 +0100")

Hello,

Gregor Kappler <g.kappler@gmx.net> 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) "?")
                   "<span class=\"org-question\">%s</span>")
                  ((equal (match-string 3 text) "#") "<!--%s-->")
                  (t "<span class=\"org-exclamation\">%s</span>"))
            (match-string 4 text))))
(add-to-list 'org-export-filter-plain-text-functions 'my-special-markup)
#+end_src


Regards,

-- 
Nicolas Goaziou

  parent reply	other threads:[~2013-02-10  9:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-10  0:32 [New exporter] custom emphasis in org-emphasis-alist Gregor Kappler
2013-02-10  0:55 ` François Pinard
2013-02-10  8:37 ` Nicolas Goaziou [this message]
2013-02-10  9:45   ` Nicolas Goaziou
2013-02-14 17:42   ` Gregor Kappler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=876220h8ej.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=g.kappler@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).