emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] How to check whether the headline the point is on has some tag?


From: Thorsten Jolitz
Subject: Re: [O] How to check whether the headline the point is on has some tag?
Date: Sat, 25 Oct 2014 01:44:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

John Kitchin <address@hidden> writes:

> Marcin Borkowski <address@hidden> writes:
>
>
> Check the last element of org-heading-components. 
>
> * Headline                                :tag1:
>
> #+BEGIN_SRC emacs-lisp
> (org-heading-components)
> #+END_SRC
>
> #+RESULTS:
> | 1 | 1 | nil | nil | Headline | :tag1: |
>
>
>
>
>> Hi list,
>>
>> I'd like to implement splitting an org file at tagged entries in my
>> org-one-to-many library (as requested on the list by Daniel Clemente).
>> How do I check whether a specific headline (say, one a point is at) has
>> some tag (but not inherited)?
>>
>> TIA,

alternatively you could use:

* Headline                                  :tag1:

#+BEGIN_SRC emacs-lisp
(let ((org-use-tag-inheritance nil))
(save-excursion
 (outline-previous-heading)
 (org-element-property :tags (org-element-at-point))))
#+END_SRC

#+results:
| tag1 |


-- 
cheers,
Thorsten




reply via email to

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