emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to check whether the headline the point is on has some tag?
@ 2014-10-24 23:09 Marcin Borkowski
  2014-10-24 23:30 ` John Kitchin
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2014-10-24 23:09 UTC (permalink / raw)
  To: orgmode

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,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to check whether the headline the point is on has some tag?
  2014-10-24 23:09 How to check whether the headline the point is on has some tag? Marcin Borkowski
@ 2014-10-24 23:30 ` John Kitchin
  2014-10-24 23:44   ` Thorsten Jolitz
  0 siblings, 1 reply; 3+ messages in thread
From: John Kitchin @ 2014-10-24 23:30 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: orgmode

Marcin Borkowski <mbork@wmi.amu.edu.pl> 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,

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to check whether the headline the point is on has some tag?
  2014-10-24 23:30 ` John Kitchin
@ 2014-10-24 23:44   ` Thorsten Jolitz
  0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Jolitz @ 2014-10-24 23:44 UTC (permalink / raw)
  To: emacs-orgmode

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> Marcin Borkowski <mbork@wmi.amu.edu.pl> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-24 23:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-24 23:09 How to check whether the headline the point is on has some tag? Marcin Borkowski
2014-10-24 23:30 ` John Kitchin
2014-10-24 23:44   ` Thorsten Jolitz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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