emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: Bastien <bzg@altern.org>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Tags included in subtree export title despite tags:nil in header
Date: Sun, 30 Oct 2011 01:10:58 +0200	[thread overview]
Message-ID: <20111030011058.2e53a791@kuru.homelinux.net> (raw)
In-Reply-To: <871utvu66a.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]

Hi Bastien and others,

On Sat, 29 Oct 2011 18:13:49 +0200
Bastien <bzg@altern.org> wrote:

> Hi Suvayu,
> Suvayu Ali <fatkasuvayu+linux@gmail.com> 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.


Open source is the future. It sets us free.

[-- Attachment #2: 0001-Respect-export-options-for-subtree-export-title.patch --]
[-- Type: text/plain, Size: 1118 bytes --]

From efae8fc1eaa8bdfbc8cf36aa2ae8ab0a3ec91c40 Mon Sep 17 00:00:00 2001
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
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.

 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)))
 	 (add-text-properties (point) (1+ (point-at-eol))
 			      (list :org-license-to-kill t)))

  reply	other threads:[~2011-10-29 23:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26 18:20 Tags included in subtree export title despite tags:nil in header suvayu ali
2011-10-27  9:06 ` Giovanni Ridolfi
2011-10-27 11:42   ` Suvayu Ali
2011-10-27 12:05     ` Suvayu Ali
2011-10-29 13:08       ` Bastien
2011-10-29 14:48         ` Suvayu Ali
2011-10-29 16:13           ` Bastien
2011-10-29 23:10             ` Suvayu Ali [this message]
2011-10-30  1:07               ` Nick Dokos
2011-10-30  7:57                 ` Suvayu Ali
2011-10-30  8:48                   ` Bastien
2011-11-01 23:31                     ` suvayu ali
2011-11-02 10:17                       ` Bastien

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:

  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=20111030011058.2e53a791@kuru.homelinux.net \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \


* 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


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).