emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Best way to check if a subtree with a property exists?
Date: Fri, 01 Dec 2017 15:17:04 +0000	[thread overview]
Message-ID: <CAFyQvY1gdmmanuvFfcvWMezvz1pyGiFR0UPe3EMkcS9tGzs3mg@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY3p7W=mLqkxFwes8rF8aFX8ngj62D3Mc8OMTGUgcE3+aw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

On Fri, Dec 1, 2017 at 9:00 AM Kaushal Modi <kaushal.modi@gmail.com> wrote:

> - How can I quit out of org-map-entries as soon as the first matching
> entry is found?
>

I think this is much better:

(let ((valid-found
       (catch 'break
         (org-map-entries
          (lambda ()
            (throw 'break t))
          ;; Only map through subtrees where
          ;; EXPORT_FILE_NAME property is not
          ;; empty.
          "EXPORT_FILE_NAME<>\"\""))))
  (message "valid-found: %S" valid-found))

- What's a better way to do the same?
>

Comments are welcome :)

Thanks.
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 1420 bytes --]

      reply	other threads:[~2017-12-01 15:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 14:00 Best way to check if a subtree with a property exists? Kaushal Modi
2017-12-01 15:17 ` Kaushal Modi [this message]

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.orgmode.org/

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

  git send-email \
    --in-reply-to=CAFyQvY1gdmmanuvFfcvWMezvz1pyGiFR0UPe3EMkcS9tGzs3mg@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@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.
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).