unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: suvayu ali <fatkasuvayu+linux@gmail.com>
Cc: Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: lisp question
Date: Thu, 04 Aug 2011 10:22:07 +0530	[thread overview]
Message-ID: <814o1x4w3s.fsf@gmail.com> (raw)
In-Reply-To: <CAMXnza2GTLOeizi-QHz14zUOtkdcJfY3D87Q+V+4-cb1pRgMOw@mail.gmail.com> (suvayu ali's message of "Thu, 4 Aug 2011 04:25:56 +0200")


Suvayu

> Hi Elisp users,
>
> I was trying to write some simple elisp code to manipulate properties
> from an org-mode entry. I can't figure out what kind of variable is
> returned and how I can extract "somecategory" into a string from it.
>
> (org-get-category (point)) ; evaluating gives me the output below
> #("somecategory" 0 12 (fontified t font-lock-fontified t face
> org-meta-line org-category "property-test"))

Return value is a text with properties. You can use

(substring-no-properties (org-get-category (point))) 

to get just the text part.

I think you will be better off using the property APIs. You can use
(org-entry-get (point) "CATEGORY")

to extract the desired information.

See "Using the property API" section of the manual.

> Thanks for any guidance.

-- 



  reply	other threads:[~2011-08-04  4:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04  2:25 lisp question suvayu ali
2011-08-04  4:52 ` Jambunathan K [this message]
2011-08-04  6:49   ` suvayu ali
     [not found] <mailman.55.1178045196.32220.help-gnu-emacs@gnu.org>
2007-05-01 19:21 ` Maarten Bergvelt
2007-05-01 20:32 ` Scott Frazer
  -- strict thread matches above, loose matches on Subject: below --
2007-05-01 18:39 A Soare
2007-05-01 19:10 ` Jesper Harder
2007-05-01 21:11   ` Marco Almeida
     [not found] <mailman.5.1177957929.32220.help-gnu-emacs@gnu.org>
2007-05-01  8:23 ` Brendan Halpin
2007-05-01 11:41   ` Hartmut Figge
2007-05-01 13:24     ` Malte Spiess
2007-04-30 18:25 A Soare
2007-04-30 19:09 ` Peter Dyballa
2007-04-29 17:14 Hadron
2007-04-29 17:32 ` Barry Margolin
2007-04-29 23:06   ` Hadron

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=814o1x4w3s.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=fatkasuvayu+linux@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

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