emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: dybbuk-qPb3x58jdZkAvxtiuMwx3w@public.gmane.org (Erik L. Arneson)
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: org-mobile-push error with no headings
Date: Wed, 09 Jun 2010 15:53:58 -0700	[thread overview]
Message-ID: <m239wvx1fd.fsf@tyche.LNouv.com> (raw)

Howdy all,

I just upgraded to org-mode 6.36c, and for some reason `org-mobile-push'
started throwing an error when it got to a file with no headings in it.
The error was in `org-back-to-heading'.  This little one-line patch
fixes it, though I'm not certain it's the right thing to do at all:

diff --git a/lisp/org.el b/lisp/org.el
index c041db1..81f9866 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10851,7 +10851,7 @@ Returns the new TODO keyword, or nil if no state change should occur."
 
 (defun org-get-todo-state ()
   (save-excursion
-    (org-back-to-heading t)
+    (ignore-errors (org-back-to-heading t))
     (and (looking-at org-todo-line-regexp)
         (match-end 2)
         (match-string 2))))

-- 
Erik Arneson <dybbuk-qPb3x58jdZkAvxtiuMwx3w@public.gmane.org>
  GPG Key ID: 1024D/62DA1D25
  Office: +1.541.291.9776
  Skype: pymander


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2010-06-09 22:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 22:53 Erik L. Arneson [this message]
2010-06-16  5:42 ` org-mobile-push error with no headings John Wiegley
2010-06-16 16:19   ` Erik L. Arneson

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=m239wvx1fd.fsf@tyche.LNouv.com \
    --to=dybbuk-qpb3x58jdzkavxtiumwx3w@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).