From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: Tags included in subtree export title despite tags:nil in header Date: Sun, 30 Oct 2011 01:10:58 +0200 Message-ID: <20111030011058.2e53a791@kuru.homelinux.net> References: <83vcra2493.fsf@yahoo.it> <20111027134220.510ec38b@kuru.homelinux.net> <20111027140516.2f6d5508@kuru.homelinux.net> <87fwic6j37.fsf@gnu.org> <20111029164832.1c83474b@kuru.homelinux.net> <871utvu66a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/g9eSQMyYGqGooB7Abg5tcZD" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKI3N-00017K-5E for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 19:11:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKI3L-0002Cu-1P for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 19:11:05 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:37059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKI3K-0002Cq-So for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 19:11:03 -0400 Received: by faat2 with SMTP id t2so2499434faa.0 for ; Sat, 29 Oct 2011 16:11:01 -0700 (PDT) In-Reply-To: <871utvu66a.fsf@gnu.org> 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: Bastien Cc: org-mode mailing list --MP_/g9eSQMyYGqGooB7Abg5tcZD Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Bastien and others, On Sat, 29 Oct 2011 18:13:49 +0200 Bastien wrote: > Hi Suvayu, > > Suvayu Ali writes: > > > Sorry I should have provided an example file in the first place. I > > am not setting the EXPORT_TITLE property. The bug is the tags:nil > > option is not respected whether it is present in the file header or > > it is set by the EXPORT_OPTIONS property for the exported subtree. > > This is puzzling since other export options (e.g. ^:{}) is respected > > irrespective of whether it is present in the file header or the > > EXPORT_OPTIONS property. > > > >> So I can't reproduce this... > > > > I hope this clearly describes the bug. > > Yes it does, thanks a lot. > > Note that EXPORT_OPTIONS is well respected for the children of the > subtree: tags:nil will prevent tags to be displayed (tested in both > HTML and LaTeX.) > > Setting EXPORT_TITLE works as a workaround. > > If you have time to fix `org-export-get-title-from-subtree' so that it > is aware of the options and removes the tags when needed, that'd be > nice. I put it on my todo list otherwise, but that's not very urgent. > I worked up a (somewhat working) patch, but I am stuck at one little point. I was wondering if someone could help me. In the attached patch, I use the variable org-export-with-tags to check whether tags should be included or skipped in the export title. However irrespective of the export options I get the value not-in-toc. As a result, the tags are not included even if tags:t is set. Is my use of org-export-with-tags incorrect? Is there something else I need to do before I can use it? Thanks for any pointers. -- Suvayu Open source is the future. It sets us free. --MP_/g9eSQMyYGqGooB7Abg5tcZD Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Respect-export-options-for-subtree-export-title.patch >From efae8fc1eaa8bdfbc8cf36aa2ae8ab0a3ec91c40 Mon Sep 17 00:00:00 2001 From: Suvayu Ali Date: Sun, 30 Oct 2011 00:54:25 +0200 Subject: [PATCH] Respect export options for subtree export title * org-exp.el (org-solidify-link-text): Respect org-export-with-tags when forming the export title during subtree export. TINY CHANGE --- lisp/org-exp.el | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index fa54242..4a69be8 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -2167,8 +2167,10 @@ (defun org-export-get-title-from-subtree () (>= (org-end-of-subtree t t) rend)) ;; This is a subtree, we take the title from the first heading (goto-char rbeg) - (looking-at org-todo-line-regexp) - (setq title (match-string 3)) + (looking-at org-todo-line-tags-regexp) + (setq title (if (eq org-export-with-tags t) + (format "%s\t%s" (match-string 3) (match-string 4)) + (match-string 3))) (org-unmodified (add-text-properties (point) (1+ (point-at-eol)) (list :org-license-to-kill t))) -- 1.7.7 --MP_/g9eSQMyYGqGooB7Abg5tcZD--