From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Lechtenboerger Subject: [PATCH] ox.el: Define subtitle macro Date: Thu, 16 Nov 2017 15:08:48 +0100 Message-ID: <87tvxub9jj.fsf@wi.uni-muenster.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFKqs-0001BI-5L for emacs-orgmode@gnu.org; Thu, 16 Nov 2017 09:09:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFKqm-0001BA-7P for emacs-orgmode@gnu.org; Thu, 16 Nov 2017 09:09:10 -0500 Received: from zivm-wwu3-1.uni-muenster.de ([128.176.192.17]:19164 helo=zivm-wwu3.uni-muenster.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFKql-0000vs-Qq for emacs-orgmode@gnu.org; Thu, 16 Nov 2017 09:09:04 -0500 Received: from localhost (D-3140W19.WIWI.UNI-MUENSTER.DE [128.176.158.169]) by udc-mail.uni-muenster.de (Postfix) with ESMTP id 6FD0720ADF3C for ; Thu, 16 Nov 2017 15:08:48 +0100 (CET) Received: from user by localhost with local (Exim 4.84_2) (envelope-from ) id 1eFKqW-0004NT-C6 for emacs-orgmode@gnu.org; Thu, 16 Nov 2017 15:08:48 +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" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi there, the attached patch adds a subtitle macro with documentation. Best wishes Jens --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Define-and-document-subtitle-macro.patch >From 3f54f515847f1f3034274d79fff6cfd1f92c72a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Lechtenb=C3=B6rger?= Date: Thu, 16 Nov 2017 15:03:33 +0100 Subject: [PATCH] Define and document subtitle macro * lisp/ox.el (org-export-as): Define macro for subtitle. * lisp/org-macro.el: Mention new macro in comment among others. * doc/org.texi: Document new macro. --- doc/org.texi | 2 ++ lisp/org-macro.el | 2 +- lisp/ox.el | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index e116a9b..3907eda 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -11080,9 +11080,11 @@ Org comes with following pre-defined macros: @table @code @item @{@{@{title@}@}@} +@item @{@{@{subtitle@}@}@} @itemx @{@{@{author@}@}@} @itemx @{@{@{email@}@}@} @cindex title, macro +@cindex subtitle, macro @cindex author, macro @cindex email, macro Org replaces these macro references with available information at the time of diff --git a/lisp/org-macro.el b/lisp/org-macro.el index 1d2823e..c82bfd8 100644 --- a/lisp/org-macro.el +++ b/lisp/org-macro.el @@ -43,7 +43,7 @@ ;; {{{n(counter,action}}}. ;; Upon exporting, "ox.el" will also provide {{{author}}}, {{{date}}}, -;; {{{email}}} and {{{title}}} macros. +;; {{{email}}}, {{{title}}}, and {{{subtitle}}} macros. ;;; Code: (require 'cl-lib) diff --git a/lisp/ox.el b/lisp/ox.el index cc3c48b..6feec3e 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3083,8 +3083,8 @@ Return code as a string." (let ((result (funcall filter info backend-name))) (when result (setq info result))))) ;; Expand export-specific set of macros: {{{author}}}, - ;; {{{date(FORMAT)}}}, {{{email}}} and {{{title}}}. It must - ;; be done once regular macros have been expanded, since + ;; {{{date(FORMAT)}}}, {{{email}}}, {{{title}}}, and {{{subtitle}}}. + ;; It must be done once regular macros have been expanded, since ;; parsed keywords may contain one of them. (org-macro-replace-all (list @@ -3102,6 +3102,8 @@ Return code as a string." value))) (cons "email" (org-element-interpret-data (plist-get info :email))) (cons "title" (org-element-interpret-data (plist-get info :title))) + (cons "subtitle" + (org-element-interpret-data (plist-get info :subtitle))) (cons "results" "$1")) 'finalize parsed-keywords) -- 2.1.4 --=-=-=--