emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Make tag inheritance explicit


From: Karl Voit
Subject: Re: [O] Make tag inheritance explicit
Date: Tue, 23 Jan 2018 18:33:52 +0100
User-agent: slrn/pre1.0.0-18 (Linux)

* Kaushal Modi <address@hidden> wrote:
>
> On Tue, Jan 23, 2018 at 9:45 AM Karl Voit <address@hidden> wrote:
>
>> > 2. Use `org-get-tags-at' with point on "Task 1" heading in your example.
>> > `org-get-tags' returns a list of tags *only* at the current heading.
>> > `org-get-tags-at' returns inherited tags too.
>>
>> You mean for developing a custom-made function that provides the
>> feature I was asking for?
>
> By "feature", you mean copying all the inherited tags to the heading at
> point?

Yes.

With your help, I wrote:

(defun my-set-tags-including-inherited ()
  (interactive)
  (let (
    (alltags (org-get-tags-at))
    )
    (org-set-tags-to alltags)
    )
  )

Which provides me "the feature" I was looking for. It can be
simplified, I know. However, I tried to add a list of tags I *don't*
want to be added to the heading but failed so far.

alltags content example:
(#("test1" 0 5 (inherited t)) #("foobar" 0 6 (inherited t))
 #("test2" 0 5 (inherited t)) #("baz" 0 3 (inherited t)))

Do you have an idea, how I can delete all items contained in my
black-list?

My example black list would be: (ignored-tags '(test1 2del crypt))

My latest approach on a single-item level was:
(remove* "test1" alltags :test 'equal :key 'car)

>> First, I wanted to get a confirmation that this feature is not
>> already part of Org-mode because (as usual) this seemed obvious to
>> me when using export functionality ;-)
>
> It's not clear what you mean by "feature is not already part of Org-mode".

Sorry for being unclear.

I thought, there might be something like "org-add-inherited-tags" or
similar I was not aware of.

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]