From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rehan Iftikhar Subject: Re: Including headlines in export with specific tags AND no tags? Date: Mon, 5 May 2014 06:51:29 -0700 Message-ID: References: <5366B5F2.7050409@gmail.com> Mime-Version: 1.0 Content-Type: multipart/related; boundary=047d7b450c56a3f1a304f8a76d1e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhJIq-0002Ly-8w for emacs-orgmode@gnu.org; Mon, 05 May 2014 09:51:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhJIo-0004uv-Un for emacs-orgmode@gnu.org; Mon, 05 May 2014 09:51:32 -0400 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:65370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhJIo-0004uR-IQ for emacs-orgmode@gnu.org; Mon, 05 May 2014 09:51:30 -0400 Received: by mail-wg0-f48.google.com with SMTP id b13so2226157wgh.7 for ; Mon, 05 May 2014 06:51:29 -0700 (PDT) In-Reply-To: <5366B5F2.7050409@gmail.com> 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: Leonard Avery Randall Cc: emacs-orgmode@gnu.org --047d7b450c56a3f1a304f8a76d1e Content-Type: multipart/alternative; boundary=047d7b450c56a3f1a004f8a76d1d --047d7b450c56a3f1a004f8a76d1d Content-Type: text/plain; charset=UTF-8 Hi Leonard Thanks for the tip. I am exporting via Emacs's batch mode so I wrote a short elisp function: (defun org-export-non-greedy-select-tags (lst) "Workaround to export a .org file with headlines that contain tags in `lst` AND headlines that have no tags" (let (all-buffer-tags) (setq all-buffer-tags (apply #'append (org-get-buffer-tags))) (dolist (tag lst) (delete tag all-buffer-tags) ) (setq org-export-exclude-tags all-buffer-tags) ) ) On Sun, May 4, 2014 at 2:49 PM, Leonard Avery Randall < leonard.a.randall@gmail.com> wrote: > Hi Rehan, > > Rehan Iftikhar wrote: > > > I'd like to export a .org file which includes all headlines without > any tags AND headlines with selected tags. Headlines with tags which > do not match the specified list are skipped. > > > > I am not sure exactly how to elegantly do what you wish to do, but > if your tag list is not too extensive, you may be able to simply > exclude all the tags you don't want. If you do not currently have a > complete list of tags, you can get one by attempting to add a tag to > headline by calling C-q and then pressing tab. That should give you > a completions buffer with a list that includes all tags in the > current .org file. Then just add all the tags you don't want to > org-export exclude tags or to an #+EXCLUDE_TAGS line. > > It's not elegant but it should work. > > Hope this helps, > > All the best, > > Leonard > > > Rehan Iftikhar > May 4, 2014 at 10:06 PM > Hello > > I'd like to export a .org file which includes all headlines without any > tags AND headlines with selected tags. Headlines with tags which do not > match the specified list are skipped. > > My testing so far reveals that setting org-export-select-tags only selects > headlines which strictly match the specified tag list. I have tried > including nil, an empty string, and an empty string with a space in the > specified tag list without any luck. > > Does anyone know if this is currently possible? > > Thanks, > -Rehan > > -- -Rehan --047d7b450c56a3f1a004f8a76d1d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Leonard

Thanks for the tip. I am exp= orting via Emacs's batch mode so I wrote a short elisp function:
<= div>
(defun org-export-non-greedy-select-tags (lst)
=C2=A0 "Workaround to export a .org file with headlines that cont= ain
tags in `lst` AND headlines that have no tags"
=C2=A0 (let (all-buffer-tags)
=C2=A0 =C2=A0 (setq all-buffer-tag= s (apply #'append (org-get-buffer-tags)))
=C2=A0 =C2=A0=C2=A0
=C2=A0 =C2=A0 (dolist (tag lst)
=C2=A0 =C2=A0 =C2=A0 (delete tag all-buffer-tags)
=C2=A0 =C2=A0= =C2=A0 )
=C2=A0 =C2=A0 (setq org-export-exclude-tags all-buffer-= tags) =C2=A0
=C2=A0 =C2=A0 )
=C2=A0 )
<= br>


On Sun,= May 4, 2014 at 2:49 PM, Leonard Avery Randall <leonard.a.randal= l@gmail.com> wrote:
Hi Rehan,

Rehan Iftikhar wrote:


I'd like to export a .org file which includes all headlines without any tags AND headlines with selected tags. Headlines with tags which
do not match the specified list are skipped.


I am not sure exactly how to elegantly do what you wish to do, but if your tag list is not too extensive, you may be able to simply
exclude all the tags you don't want. If you do not currently have a
complete list of tags, you can get one by attempting to add a tag to=
headline by calling C-q and then pressing tab. That should give you<= br style=3D"font-family:monospace"> a completions buffer with a list that includes all tags in the
current .org file.=C2=A0 Then just add all the tags you don't want to
org-export exclude tags or to an #+EXCLUDE_TAGS line.

It's not elegant but it should work.

Hope this helps,

All the best,

Leonard=C2=A0


=20 May 4, 2014 at= =20 10:06 PM
Hell= o

I'd like to export a .org file which includes all headlines without any=20 tags AND headlines with selected tags. Headlines with tags which do not=20 match the specified list are skipped.

My testing so far reveals that setting=20 org-export-select-tags only selects headlines which strictly match the=20 specified tag list. I have tried including nil, an empty string, and an=20 empty string with a space in the specified tag list without any luck.

Does anyone know if this is currently possible?

Thanks,
-Rehan



--
-Rehan --047d7b450c56a3f1a004f8a76d1d-- --047d7b450c56a3f1a304f8a76d1e Content-Type: image/jpeg; x-apple-mail-type=stationery; name="compose-unknown-contact.jpg" Content-Disposition: inline; filename="compose-unknown-contact.jpg" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: 88b9165ae1e9c409_0.1.1 /9j/4AAQSkZJRgABAQEARwBHAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQECAQEB AQEBAgICAgICAgICAgICAgICAgICAgICAgICAgICAgL/2wBDAQEBAQEBAQICAgICAgICAgICAgIC AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgL/wAARCAAZABkDAREA AhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAABgcICQr/xAA0EAABAwMCAgUKBwAAAAAAAAACAQME BQYRABITIQcUMUF2CBUXIjI2N0JRtVRWkZOV0dL/xAAYAQEAAwEAAAAAAAAAAAAAAAADAAEEAv/E ACQRAAICAAQGAwAAAAAAAAAAAAABAhEDMrHREyExM0FxgfDx/9oADAMBAAIRAxEAPwDuEt+gW/UL et6oVC3rfqNQqFv0OfPn1GhUqfOmzZtKZlS5UqZMaNwzNwiJVIl7eXLCaZIGwBl3TY8epPx2+jy2 ZNPjvkwc9uhW8j7nCPhvOsQliYIeS7cvCpp8o50qwrC4v3lsNSDbdmTEhvs2tahxpfV3WnmbbozJ Ew/gwdadbYExVRXKEKoSdvJcaOSqxE7/AAiX0gXx+a69/JSf9alIlste0VzaNpeFrcT9KKymotyi aZ0KRCnzacoE7Kjzn4gi2KqUh3jqDHDHv4mRUfruTWlMzlVUKIVNp9GguEJnAh0+IZjyAiisgyRD nu5azS8miKqjOTVkKqS/psG37fo1Fbabeg25b8eZPeFJBBJSjMG5HjMeyihnaauZwe4OGiju13GA cpOwBeN+U8/IkGbsiS8b7ryogmbzhbyc9REROfZhERO5ETShjPtvpGqTUyLErytS4siSwx5x2tRH 4hPOI0DkjZtaJtFxuVEbIUUiyeNujlBUJGbJN6nM/Cyf2Hf60YgjvKA+NPSP4gT7axpcPtr51YWJ nYn9dnAQWl722p4ot37yzqnlfp6FrqbwawG8/9k= --047d7b450c56a3f1a304f8a76d1e--