From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: [patch, koma-letter] Change of subject behavior Date: Tue, 17 Mar 2015 18:37:19 +0100 Message-ID: <87d247h6eo.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXvR5-0007Bj-4x for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 13:37:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXvR1-0004cz-1B for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 13:37:47 -0400 Received: from plane.gmane.org ([80.91.229.3]:43991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXvR0-0004ct-QS for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 13:37:42 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YXvQy-0002Ay-Aa for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 18:37:40 +0100 Received: from 46.166.188.207 ([46.166.188.207]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2015 18:37:40 +0100 Received: from rasmus by 46.166.188.207 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 Mar 2015 18:37:40 +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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi, I want to change the subject inference in ox-koma-letter to only happen on top-level headlines. Thus, in the following example the opening would be "opening" and not "h1" as it is currently. * opening ** h1 Typically, "h1" is just there to help me organize the letter. Any objections? —Rasmus -- Together we will make the possible totalllly impossible! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-koma-letter-Stricter-subject-inference.patch >From 2ce18b7f061109f0006fb1b823029d35fee4f9a9 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Tue, 17 Mar 2015 18:32:26 +0100 Subject: [PATCH] ox-koma-letter: Stricter subject inference * ox-koma-letter.el (org-koma-letter-headline): Subject can only be inferred from top-level heading. --- contrib/lisp/ox-koma-letter.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 1b5dd17..1e905a9 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -561,7 +561,8 @@ appropriate place." (push (cons tag contents) org-koma-letter-special-contents))) ;; Opening is not defined yet: use headline's title. (when (and org-koma-letter-headline-is-opening-maybe - (not (org-string-nw-p (plist-get info :opening)))) + (not (org-string-nw-p (plist-get info :opening))) + (eq 1 (org-export-get-relative-level headline info))) (plist-put info :opening (org-export-data (org-element-property :title headline) info))) ;; In any case, insert contents in letter's body. -- 2.3.3 --=-=-=--