emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: Dave Abrahams <dave@boostpro.com>
Cc: emacs-orgmode@gnu.org, John Wiegley <johnw@boostpro.com>
Subject: Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
Date: Mon, 09 Apr 2012 16:51:59 +0200	[thread overview]
Message-ID: <87aa2lufe8.fsf@altern.org> (raw)
In-Reply-To: <m2iph92ehu.fsf@boostpro.com> (Dave Abrahams's message of "Mon, 09 Apr 2012 09:58:53 -0400")

Hi Dave,

Dave Abrahams <dave@boostpro.com> writes:

> Sorry, but I don't want to spend the time on that.  I'm trying to get
> the rules changed so that it isn't so easy to corrupt an org file.  

The current rule is "Leave SCHEDULED: and DEADLINE: information where
Org's `org-schedule' and `org-deadline' put it."

Maybe I don't understand how do you want to change this rule.

> I'm not much interested in building a tool to undo corruption.
>
>> FYI: Nicolas and I have been discussing about the issue you raised, and
>> the integration of org-element.el will force us to be clearer about such
>> cases, which is good.
>
> I sincerely hope that when you become clearer about such cases you pick
> a liberal set of rules that isn't so error-prone.  The ideas that I
> can't just hit return after a headline and start typing a body, and that
> I'll be nagged about misplaced SCHEDULED: lines, are both very
> unappealing.

I have just added this hack:

  "Check for misplaced SCHEDULED and DEADLINE cookies"
  http://orgmode.org/worg/org-hacks.html#sec-1-2-8

Here is the function:

(defun org-check-misformatted-subtree ()
  "Check misformatted entries in the current buffer."
  (interactive)
  (show-all)
  (org-map-entries
   (lambda ()
     (move-beginning-of-line 2)
     (if (or (and (org-get-scheduled-time (point))
                  (not (looking-at (concat "^.*" org-scheduled-regexp))))
             (and (org-get-deadline-time (point))
                  (not (looking-at (concat "^.*" org-deadline-regexp)))))
         (when (y-or-n-p "Fix this subtree? ")
           (message "Call the function again when you're done fixing this subtree.")
           (recursive-edit))
       (message "All subtrees checked.")))))

HTH,

-- 
 Bastien

  reply	other threads:[~2012-04-09 14:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 14:41 Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)] Dave Abrahams
2012-04-06  7:38 ` Bastien
2012-04-06 12:18   ` Dave Abrahams
2012-04-09 11:01     ` Bastien
2012-04-09 11:20       ` Dave Abrahams
2012-04-09 12:49         ` Bastien
2012-04-09 13:58           ` Dave Abrahams
2012-04-09 14:51             ` Bastien [this message]
2012-04-09 14:54               ` Dave Abrahams
2012-04-09 15:05                 ` Bastien
2012-04-09 15:52                   ` Dave Abrahams
2012-04-10 13:43               ` Rainer Stengele
2012-04-10 14:12                 ` Bastien
2012-04-09 20:24           ` John Wiegley
2012-04-10 12:13   ` [PATCH] " Jérémie Courrèges-Anglas
2012-04-10 12:34     ` Bastien
2012-04-10 13:34       ` Jérémie Courrèges-Anglas
2012-04-10 13:40         ` Bastien

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=87aa2lufe8.fsf@altern.org \
    --to=bzg@altern.org \
    --cc=dave@boostpro.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=johnw@boostpro.com \
    /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).