From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.help Subject: Re: How to add more markups and formatting for markups to Org Date: Mon, 01 Jun 2015 01:52:35 +0200 Message-ID: <87pp5ge24c.fsf@gmx.us> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433116440 4494 80.91.229.3 (31 May 2015 23:54:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 May 2015 23:54:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 01 01:53:51 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YzD38-000717-3j for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Jun 2015 01:53:50 +0200 Original-Received: from localhost ([::1]:43721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzD37-0008Li-CH for geh-help-gnu-emacs@m.gmane.org; Sun, 31 May 2015 19:53:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzD2x-0008Lb-Kk for help-gnu-emacs@gnu.org; Sun, 31 May 2015 19:53:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzD2s-0004HX-Hn for help-gnu-emacs@gnu.org; Sun, 31 May 2015 19:53:39 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzD2s-0004HQ-Af for help-gnu-emacs@gnu.org; Sun, 31 May 2015 19:53:34 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YzD2p-0006rp-IR for help-gnu-emacs@gnu.org; Mon, 01 Jun 2015 01:53:31 +0200 Original-Received: from 142.red-88-21-140.staticip.rima-tde.net ([88.21.140.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Jun 2015 01:53:31 +0200 Original-Received: from rasmus by 142.red-88-21-140.staticip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Jun 2015 01:53:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 142.red-88-21-140.staticip.rima-tde.net User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:FIuAiH4rvvI/DfmpK6eKIPVql0o= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104707 Archived-At: Hi, "Tu, Do" writes: > For example, anything in between *...* is bold by default. I want to > add a markup with my own formatting for such markup, > i.e. ... with a box surrounds such markup. I also want the > mark up to be compatible with (setq org-hide-emphasis-markers t). That > is, when the variable is set to t, the and tags should > disappear, leaving the text between it with the specified formatting > above. The org format has a fixed number of supported types. From the context, it seems like you have a case in mind where you export to html. Try (with-temp-buffer (insert "a *b*") (org-element-context)). As you see it's bold. When exporting to html, it's transcoded via org-html-bold. Thus, adding new markup the way you want in non-trivial as you have to add it to both org-element and the export backend, e.g. ox-html. For your case, I'd use a macro: #+macro: kbd @@html:@@$1@@html:@@ {{{kbd(my-key)}}} See also org-hide-macro-markers and font-lock-add-keywords for changing the face. Rasmus -- This message is brought to you by the department of redundant departments