emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
@ 2012-04-05 14:41 Dave Abrahams
  2012-04-06  7:38 ` Bastien
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Abrahams @ 2012-04-05 14:41 UTC (permalink / raw)
  To: emacs-orgmode



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
------------------------------------------------------------------------

Given the following:

--8<---------------cut here---------------start------------->8---
* TODO Some headline
SCHEDULED: <2012-04-05 Thu>
--8<---------------cut here---------------end--------------->8---

If I add body text between the headline and the SCHEDULED: line, some
things work, but others don't.  For example:

--8<---------------cut here---------------start------------->8---
* TODO Some headline
some body
SCHEDULED: <2012-04-05 Thu>
--8<---------------cut here---------------end--------------->8---

In agenda mode, I can hit `f' (org-agenda-date-later) and it will bump
the scheduled date forward and all is well.  However, if I hit `C-c C-s
+ RET' (org-agenda-schedule), the item changes to

--8<---------------cut here---------------start------------->8---
* TODO Some headline
SCHEDULED: <2012-04-06 Fri>
some body
SCHEDULED: <2012-04-05 Thu>
--8<---------------cut here---------------end--------------->8---

Moreover, the agenda still "thinks" this item is scheduled for
2012-04-05!  I can attempt to reschedule the item indefinitely and the
scheduled date will never appear to change, because the later one
overrides the earlier one.

There's no reason the format should be so sensitive to ordering.  If
org-agenda-date-later can do the right thing, so can org-agenda-schedule
and all the other commands that change the scheduled date of an item.

Emacs  : GNU Emacs 24.0.94.1 (x86_64-apple-darwin11.3.0, Carbon Version 1.6.0 AppKit 1138.32)
 of 2012-03-14 on pluto.luannocracy.com
Package: Org-mode version 7.8.06 (release_7.8.06.181.ga481)

current state:
==============
(setq
 org-hide-leading-stars t
 org-export-babel-evaluate nil
 org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
 org-tab-first-hook '(yas/org-very-safe-expand org-hide-block-toggle-maybe org-src-native-tab-command-maybe
                      org-babel-hide-result-toggle-maybe)
 org-adapt-indentation nil
 org-footnote-section nil
 org-time-clocksum-use-fractional t
 org-log-buffer-setup-hook '((lambda nil (setq fill-column (- fill-column 5))))
 org-habit-preceding-days 42
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-agenda-fontify-priorities t
 org-reverse-note-order t
 org-agenda-auto-exclude-function 'org-my-auto-exclude-function
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-agenda-scheduled-leaders '("" "S%d: ")
 org-agenda-start-on-weekday nil
 org-clock-into-drawer "LOGBOOK"
 org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers)
 org-confirm-shell-link-function nil
 org-x-backends '(ox-org ox-redmine)
 org-finalize-agenda-hook '(org-agenda-add-overlays)
 org-speed-commands-user '(("+" . org-priority-up) ("-" . org-priority-down))
 org-clock-idle-time 10
 org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fix-toc org-beamer-auto-fragile-frames
                               org-beamer-place-default-actions-for-lists)
 org-habit-completed-glyph 10004
 org-agenda-restore-windows-after-quit t
 org-agenda-deadline-leaders '("D: " "D%d: ")
 org-pretty-entities t
 org-special-ctrl-a/e 'reversed
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-x-redmine-title-prefix-function 'org-x-redmine-title-prefix
 org-agenda-prefix-format '((agenda . "  %-11:c%?-12t% s") (timeline . "  % s") (todo . "  %-11:c") (tags . "  %-11:c"))
 org-agenda-skip-scheduled-if-done t
 org-agenda-custom-commands '(("E" "Errands (next 3 days)" tags
                               "Errand&TODO<>\"DONE\"&TODO<>\"CANCELED\"&STYLE<>\"habit\"&SCHEDULED<\"<+3d>\""
                               ((org-agenda-overriding-header "Errands (next 3 days)")))
                              ("A" "Priority #A tasks" agenda ""
                               ((org-agenda-ndays 1) (org-agenda-overriding-header "Today's priority #A tasks: ")
                                (org-agenda-skip-function (quote (org-agenda-skip-entry-if (quote notregexp) "\\=.*\\[#A\\]"))))
                               )
                              ("b" "Priority #A and #B tasks" agenda ""
                               ((org-agenda-ndays 1) (org-agenda-overriding-header "Today's priority #A and #B tasks: ")
                                (org-agenda-skip-function (quote (org-agenda-skip-entry-if (quote regexp) "\\=.*\\[#C\\]"))))
                               )
                              ("w" "Waiting/delegated tasks" tags "TODO=\"WAITING\"|TODO=\"DELEGATED\""
                               ((org-agenda-overriding-header "Waiting/delegated tasks:")
                                (org-agenda-sorting-strategy (quote (todo-state-up priority-down category-up))))
                               )
                              ("p" "Unprioritized tasks" tags
                               "AREA<>\"Work\"&TODO<>\"\"&TODO<>{DONE\\|CANCELED\\|NOTE\\|PROJECT\\|DEFERRED\\|SOMEDAY}"
                               ((org-agenda-files (quote ("~/Documents/Tasks/todo.txt")))
                                (org-agenda-overriding-header "Unprioritized tasks: ")
                                (org-agenda-skip-function (quote (org-agenda-skip-entry-if (quote regexp) "\\=.*\\[#[A-Z]\\]"))))
                               )
                              ("u" "Unscheduled tasks" tags "AREA<>\"Work\"&TODO<>\"\"&TODO<>{DONE\\|CANCELED\\|NOTE\\|PROJECT}"
                               ((org-agenda-files (quote ("~/Documents/Tasks/todo.txt")))
                                (org-agenda-overriding-header "Unscheduled tasks: ")
                                (org-agenda-skip-function
                                 (quote
                                  (org-agenda-skip-entry-if (quote scheduled) (quote deadline) (quote timestamp) (quote regexp)
                                   "\\* \\(DEFERRED\\|SOMEDAY\\)")
                                  )
                                 )
                                (org-agenda-sorting-strategy (quote (priority-down))))
                               )
                              ("U" "Deferred tasks" tags "TODO=\"DEFERRED\""
                               ((org-agenda-files (quote ("~/Documents/Tasks/todo.txt")))
                                (org-agenda-overriding-header "Deferred tasks:"))
                               )
                              ("Y" "Someday tasks" tags "TODO=\"SOMEDAY\"" ((org-agenda-overriding-header "Someday tasks:")))
                              ("G" "Ledger tasks (all)" alltodo ""
                               ((org-agenda-files (quote ("~/src/ledger/plan/TODO"))) (org-agenda-overriding-header "Ledger tasks:")
                                (org-agenda-sorting-strategy (quote (todo-state-up priority-down category-up))))
                               )
                              ("N" "Ledger tasks (all, alphabetical)" alltodo ""
                               ((org-agenda-files (quote ("~/src/ledger/plan/TODO")))
                                (org-agenda-overriding-header "Ledger tasks, alphabetical:")
                                (org-agenda-sorting-strategy (quote (alpha-up))))
                               )
                              ("l" "Ledger tasks" tags-todo "TODO<>{SOMEDAY\\|DEFERRED}"
                               ((org-agenda-files (quote ("~/src/ledger/plan/TODO"))) (org-agenda-overriding-header "Ledger tasks:")
                                (org-agenda-sorting-strategy (quote (todo-state-up priority-down category-up)))
                                (org-agenda-skip-function (quote (org-agenda-skip-entry-if (quote regexp) "\\=.*\\[#C\\]"))))
                               )
                              ("r" "Uncategorized items" tags
                               "CATEGORY=\"Inbox ===>\"&LEVEL=2&TODO<>{DONE\\|CANCELED\\|NOTE\\|PROJECT}"
                               ((org-agenda-overriding-header "Uncategorized items")))
                              ("V" "Unscheduled work-related tasks" tags
                               "AREA=\"Work\"&TODO<>\"\"&TODO<>{DONE\\|CANCELED\\|NOTE\\|PROJECT}"
                               ((org-agenda-overriding-header "Unscheduled work-related tasks")
                                (org-agenda-files (quote ("~/Documents/Tasks/todo.txt")))
                                (org-agenda-sorting-strategy (quote (category-up)))
                                (org-agenda-skip-function
                                 (quote
                                  (org-agenda-skip-entry-if (quote scheduled) (quote deadline) (quote timestamp) (quote regexp)
                                   "\\* \\(DEFERRED\\|SOMEDAY\\)")
                                  )
                                 )
                                )
                               )
                              ("W" "Work-related tasks" tags "AREA=\"Work\"&TODO<>\"\"&TODO<>{DONE\\|CANCELED\\|NOTE\\|PROJECT}"
                               ((org-agenda-overriding-header "Work-related tasks")
                                (org-agenda-files (quote ("~/Documents/Tasks/todo.txt")))
                                (org-agenda-sorting-strategy (quote (category-up priority-down todo-state-up alpha-up)))
                                (org-agenda-skip-function
                                 (quote (org-agenda-skip-entry-if (quote regexp) "\\* \\(DEFERRED\\|SOMEDAY\\)")))
                                )
                               )
                              )
 org-return-follows-link t
 org-default-notes-file "~/Documents/Tasks/todo.txt"
 org-clock-in-resume t
 org-capture-templates '(("t" "Task" entry (file+headline "~/Documents/Tasks/todo.txt" "Inbox")
                          "* TODO %?\n  SCHEDULED: %t\n  :PROPERTIES:\n  :ID:       %(shell-command-to-string \"uuidgen\")  :CREATED:  %U\n  :END:" :prepend t)
                         )
 org-agenda-include-diary t
 org-drawers '("PROPERTIES" "CLOCK" "LOGBOOK" "OUT")
 org-after-todo-state-change-hook '(org-clock-out-if-current org-checklist)
 org-todo-repeat-to-state "TODO"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-tags-column -97
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '((lambda nil (set (make-local-variable (quote yas/trigger-key)) [tab])
                  (add-to-list (quote org-tab-first-hook) (quote yas/org-very-safe-expand))
                  (define-key yas/keymap [tab] (quote yas/next-field)))
                 (lambda nil (local-unset-key (kbd ".,")))
                 #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5]
                 #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-agenda-follow-indirect t
 org-refile-targets '((nil :todo . "PROJECT") (nil :maxlevel . 2))
 org-extend-today-until 6
 org-attach-method 'mv
 org-mobile-pre-pull-hook '(my-org-convert-incoming-items)
 org-use-speed-commands t
 org-agenda-sorting-strategy '((agenda habit-down time-up todo-state-up priority-down category-keep)
                               (todo priority-down category-keep) (tags priority-down category-keep) (search category-keep))
 org-clock-persist 'history
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-agenda-persistent-filter t
 org-clock-in-switch-to-state "STARTED"
 org-directory "~/Documents/Tasks/"
 org-enforce-todo-dependencies t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines
                  org-optimize-window-after-visibility-change)
 org-habit-show-habits-only-for-today nil
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-export-blocks '((src org-babel-exp-src-block nil) (export-comment org-export-blocks-format-comment t)
                     (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot nil))
 org-archive-location "TODO-archive::"
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-text-search-extra-files '(agenda-archives)
 org-habit-today-glyph 9483
 org-x-redmine-title-prefix-match-function 'org-x-redmine-title-prefix-match
 org-agenda-default-appointment-duration 60
 org-export-interblocks '((src org-babel-exp-non-block-elements))
 org-use-property-inheritance '("AREA")
 org-modules '(org-id org-info org-habit)
 org-agenda-ndays 1
 org-checkbox-statistics-hook '(dwa/checkbox-list-complete)
 org-fast-tag-selection-single-key 'expert
 org-agenda-window-setup 'current-window
 org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el"))
 org-confirm-elisp-link-function nil
 org-edit-src-content-indentation 0
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-log-into-drawer t
 org-mobile-post-push-hook '((lambda nil (shell-command "/bin/rm -f ~/Dropbox/MobileOrg/agendas.org")
                              (shell-command
                               (concat "perl -i -ne 'print unless /agendas\\.org/;'" "~/Dropbox/MobileOrg/checksums.dat"))
                              (shell-command (concat "perl -i -ne 'print unless /agendas\\.org/;'" "~/Dropbox/MobileOrg/index.org")))
                             )
 org-insert-heading-respect-content t
 org-agenda-skip-unavailable-files t
 org-checklist-export-function 'org-export-as-ascii
 org-default-priority 67
 org-clock-modeline-total 'current
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-agenda-skip-deadline-if-done t
 org-completion-use-ido t
 org-babel-load-languages '((emacs-lisp . t) (sh . t))
 org-cycle-global-at-bob t
 org-agenda-start-with-follow-mode t
 org-agenda-mode-hook '((lambda nil (local-unset-key (kbd ".,"))))
 org-agenda-files '("~/Documents/Tasks/todo.txt")
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-archive-save-context-info '(time category itags)
 org-src-fontify-natively t
 org-clock-out-remove-zero-time-clocks t
 org-refile-target-verify-function 'dwa/org-verify-refile-target
 org-agenda-skip-scheduled-if-deadline-is-shown t
 org-after-todo-statistics-hook '(dwa/org-summary-todo)
 )
-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  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-10 12:13   ` [PATCH] " Jérémie Courrèges-Anglas
  0 siblings, 2 replies; 18+ messages in thread
From: Bastien @ 2012-04-06  7:38 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode

Hi Dave,

Dave Abrahams <dave@boostpro.com> writes:

> Given the following:
>
> * TODO Some headline
> SCHEDULED: <2012-04-05 Thu>
>
> If I add body text between the headline and the SCHEDULED: line, some
> things work, but others don't.  

See this footnote in the section "8.3.1 Inserting deadlines or
schedules" of the manual:

   (1) The `SCHEDULED' and `DEADLINE' dates are inserted on the line
right below the headline.  Don't put any text between this line and the
headline.

HTH,

-- 
 Bastien

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-06  7:38 ` Bastien
@ 2012-04-06 12:18   ` Dave Abrahams
  2012-04-09 11:01     ` Bastien
  2012-04-10 12:13   ` [PATCH] " Jérémie Courrèges-Anglas
  1 sibling, 1 reply; 18+ messages in thread
From: Dave Abrahams @ 2012-04-06 12:18 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode


on Fri Apr 06 2012, Bastien <bzg-AT-gnu.org> wrote:

> Hi Dave,
>
> Dave Abrahams <dave@boostpro.com> writes:
>
>> Given the following:
>>
>> * TODO Some headline
>> SCHEDULED: <2012-04-05 Thu>
>>
>> If I add body text between the headline and the SCHEDULED: line, some
>> things work, but others don't.  
>
> See this footnote in the section "8.3.1 Inserting deadlines or
> schedules" of the manual:
>
>    (1) The `SCHEDULED' and `DEADLINE' dates are inserted on the line
> right below the headline.  Don't put any text between this line and the
> headline.

That doesn't make it right.  This is a serious usability bug and a
newbie trap.

As I mentioned in my report, if some of the commands can handle it,
there's no reason all of them shouldn't handle it.  The only other valid
interpretation is that those commands that are handling it as I expect
are broken and they're changing things that should really be treated as
body text and just happen to look like a SCHEDULED line.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-06 12:18   ` Dave Abrahams
@ 2012-04-09 11:01     ` Bastien
  2012-04-09 11:20       ` Dave Abrahams
  0 siblings, 1 reply; 18+ messages in thread
From: Bastien @ 2012-04-09 11:01 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode

Dave Abrahams <dave@boostpro.com> writes:

>>> Given the following:
>>>
>>> * TODO Some headline
>>> SCHEDULED: <2012-04-05 Thu>
>>>
>>> If I add body text between the headline and the SCHEDULED: line, some
>>> things work, but others don't.  
>>
>> See this footnote in the section "8.3.1 Inserting deadlines or
>> schedules" of the manual:
>>
>>    (1) The `SCHEDULED' and `DEADLINE' dates are inserted on the line
>> right below the headline.  Don't put any text between this line and the
>> headline.
>
> That doesn't make it right.  

No, but it makes it clear that users should put SCHEDULED: <...> lines
right after the headline.  

> This is a serious usability bug and a newbie trap.
>
> As I mentioned in my report, if some of the commands can handle it,
> there's no reason all of them shouldn't handle it.  

> The only other valid interpretation is that those commands that are
> handling it as I expect are broken and they're changing things that
> should really be treated as body text and just happen to look like a
> SCHEDULED line.

Patch welcome.

Or even more useful: write a small function that goes an Org buffer 
and spot misformatted subtrees, offering to fix them interactively.
Can you write this?

Thanks,

-- 
 Bastien

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 11:01     ` Bastien
@ 2012-04-09 11:20       ` Dave Abrahams
  2012-04-09 12:49         ` Bastien
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Abrahams @ 2012-04-09 11:20 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, John Wiegley


on Mon Apr 09 2012, Bastien <bzg-AT-gnu.org> wrote:

>> This is a serious usability bug and a newbie trap.
>>
>> As I mentioned in my report, if some of the commands can handle it,
>> there's no reason all of them shouldn't handle it.  
>
>> The only other valid interpretation is that those commands that are
>> handling it as I expect are broken and they're changing things that
>> should really be treated as body text and just happen to look like a
>> SCHEDULED line.
>
> Patch welcome.
>
> Or even more useful: write a small function that goes an Org buffer 
> and spot misformatted subtrees, offering to fix them interactively.
> Can you write this?

Actually:

1. I strongly disagree that that would be more useful.  It would leave
   the newbie trap and usability bug in place.

2. John Wiegley has been working on some code that allows such things to
   be trivially implemented and I'd rather not duplicate / overlap with
   him.  John, would you care to push your org-x stuff upstream soon?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 11:20       ` Dave Abrahams
@ 2012-04-09 12:49         ` Bastien
  2012-04-09 13:58           ` Dave Abrahams
  2012-04-09 20:24           ` John Wiegley
  0 siblings, 2 replies; 18+ messages in thread
From: Bastien @ 2012-04-09 12:49 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode, John Wiegley

Hi Dave,

Dave Abrahams <dave@boostpro.com> writes:

> 1. I strongly disagree that that would be more useful.  It would leave
>    the newbie trap and usability bug in place.

Well, we disagree then :)  I think it is useful to have a function that
let everyone (not just newbies) know that some subtrees don't respect
Org's writing conventions.

> 2. John Wiegley has been working on some code that allows such things to
>    be trivially implemented and I'd rather not duplicate / overlap with
>    him.  John, would you care to push your org-x stuff upstream soon?

You might also look at org-element.el.  

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.

In the meantime, let's restate this again: don't put SCHEDULED: and
DEADLINE: cookies anywhere else than on the line right below the
headline.

Thanks,

-- 
 Bastien

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 12:49         ` Bastien
@ 2012-04-09 13:58           ` Dave Abrahams
  2012-04-09 14:51             ` Bastien
  2012-04-09 20:24           ` John Wiegley
  1 sibling, 1 reply; 18+ messages in thread
From: Dave Abrahams @ 2012-04-09 13:58 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, John Wiegley


on Mon Apr 09 2012, Bastien <bzg-AT-gnu.org> wrote:

> Hi Dave,
>
> Dave Abrahams <dave@boostpro.com> writes:
>
>> 1. I strongly disagree that that would be more useful.  It would leave
>>    the newbie trap and usability bug in place.
>
> Well, we disagree then :)  I think it is useful to have a function that
> let everyone (not just newbies) know that some subtrees don't respect
> Org's writing conventions.

It would be very useful.  Just not /more/ useful.  The most useful
functionality is the one that just works without any intervention from
the user.

>> 2. John Wiegley has been working on some code that allows such things to
>>    be trivially implemented and I'd rather not duplicate / overlap with
>>    him.  John, would you care to push your org-x stuff upstream soon?
>
> You might also look at org-element.el.  

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

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 13:58           ` Dave Abrahams
@ 2012-04-09 14:51             ` Bastien
  2012-04-09 14:54               ` Dave Abrahams
  2012-04-10 13:43               ` Rainer Stengele
  0 siblings, 2 replies; 18+ messages in thread
From: Bastien @ 2012-04-09 14:51 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode, John Wiegley

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

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 14:51             ` Bastien
@ 2012-04-09 14:54               ` Dave Abrahams
  2012-04-09 15:05                 ` Bastien
  2012-04-10 13:43               ` Rainer Stengele
  1 sibling, 1 reply; 18+ messages in thread
From: Dave Abrahams @ 2012-04-09 14:54 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, John Wiegley


on Mon Apr 09 2012, Bastien <bzg-AT-altern.org> wrote:

> 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 want the rule to be that you can have as much body text as you want
between the headline and the SCHEDULED: line.  Or failing that, I'd like
org's default keybindings to make it really hard to insert text between
the headline and SCHEDULED:.  Any typing in that area should, by
default, force the point to jump after SCHEDULED:

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

Thanks, I think... but I can't tell if everybody is missing my point.
I've been trying to argue for something that doesn't allow mistakes to
happen in the first place.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 14:54               ` Dave Abrahams
@ 2012-04-09 15:05                 ` Bastien
  2012-04-09 15:52                   ` Dave Abrahams
  0 siblings, 1 reply; 18+ messages in thread
From: Bastien @ 2012-04-09 15:05 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode, John Wiegley

Hi Dave,

Dave Abrahams <dave@boostpro.com> writes:

> I want the rule to be that you can have as much body text as you want
> between the headline and the SCHEDULED: line.  

This won't happen.  

> Or failing that, I'd like
> org's default keybindings to make it really hard to insert text between
> the headline and SCHEDULED:.  Any typing in that area should, by
> default, force the point to jump after SCHEDULED:

Yes, this is a possibility.  The other possibility is to store SCHEDULED
and DEADLINE information in a drawer.

In both cases, this requires a careful discussion.

As I cannot spend this time right now, the helper function to fix
misformatted subtrees is better than nothing.  And unless there is 
a Global Internet Strike (©) requesting this issue to be fixed,
I think we should live with it -- or make a collective effort.

> Thanks, I think... but I can't tell if everybody is missing my point.
> I've been trying to argue for something that doesn't allow mistakes to
> happen in the first place.

I understand.

But again: the mistake happens for people who move this line manually
and for poeple who don't read the manual.

Thanks for your understanding!

-- 
 Bastien

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 15:05                 ` Bastien
@ 2012-04-09 15:52                   ` Dave Abrahams
  0 siblings, 0 replies; 18+ messages in thread
From: Dave Abrahams @ 2012-04-09 15:52 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, John Wiegley


on Mon Apr 09 2012, Bastien <bzg-AT-gnu.org> wrote:

> Hi Dave,
>
> Dave Abrahams <dave@boostpro.com> writes:
>
>> I want the rule to be that you can have as much body text as you want
>> between the headline and the SCHEDULED: line.  
>
> This won't happen.  

Because...?

>> Or failing that, I'd like
>> org's default keybindings to make it really hard to insert text between
>> the headline and SCHEDULED:.  Any typing in that area should, by
>> default, force the point to jump after SCHEDULED:
>
> Yes, this is a possibility.  The other possibility is to store SCHEDULED
> and DEADLINE information in a drawer.

That would be an "easy" solution.

> In both cases, this requires a careful discussion.
>
> As I cannot spend this time right now, the helper function to fix
> misformatted subtrees is better than nothing.  

Yes.

> And unless there is a Global Internet Strike (©) requesting this issue
> to be fixed, I think we should live with it -- or make a collective
> effort.

I understand.

>> Thanks, I think... but I can't tell if everybody is missing my point.
>> I've been trying to argue for something that doesn't allow mistakes
>> to happen in the first place.
>
> I understand.
>
> But again: the mistake happens for people who move this line manually
> and for poeple who don't read the manual.

And again: this is a developer-centric response.  As a matter of
usability it doesn't matter very much that "you told me so" (in a manual
100s of pages long --- and it's buried in a footnote, for chrissake!)
when the mistake is trivially easy to make... and it is.  I only have
only ever "moved that line" without knowing I was doing it.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 12:49         ` Bastien
  2012-04-09 13:58           ` Dave Abrahams
@ 2012-04-09 20:24           ` John Wiegley
  1 sibling, 0 replies; 18+ messages in thread
From: John Wiegley @ 2012-04-09 20:24 UTC (permalink / raw)
  To: Bastien; +Cc: Dave Abrahams, emacs-orgmode

>>>>> Bastien  <bzg@gnu.org> writes:

> You might also look at org-element.el.

> 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 think Org-X and org-element can be merged.

Org-X is a bidirectional system for turning Org entries into Lisp structure,
and back again.  Because of this bidirectionality, it lets you send Org
entries to other "Backends" (like Redmine, Bugzilla, etc.), and also
receive/sync Org entries with those backends.

While Org-X does parse major structural elements within entries (the scheduled
date, property drawer, and a few others), it makes no attempt to interpret the
textual content of entries, nor does it deal with whole trees, or the
ancillary data outside of heading lines (like the #+keyword markers).

It might be very useful at this point to combine the efforts of these two
projects into a complete abstraction layer for Org.  And it would be
unfortunate to have two entirely separate efforts with different areas of
focus, fragmenting the community of people who want to work with their Org
data programmatically.

I've been using Org-X for utility code for many months now, and I'm ready to
push it to mainstream.  It simply needs some documentation at this point.

If you guys are interested in merging org-element and Org-X, we should discuss
that.  Org-X is already doing a few of the things that org-element does, but I
don't believe org-element is doing much of what Org-X does, in terms of
built-in support for shuttling data to/from various backends.  Even the
Org-mode support itself is implemented as a backend on top of a more general
abstraction layer.

John

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

* [PATCH] Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-06  7:38 ` Bastien
  2012-04-06 12:18   ` Dave Abrahams
@ 2012-04-10 12:13   ` Jérémie Courrèges-Anglas
  2012-04-10 12:34     ` Bastien
  1 sibling, 1 reply; 18+ messages in thread
From: Jérémie Courrèges-Anglas @ 2012-04-10 12:13 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 502 bytes --]

Bastien <bzg@gnu.org> writes:
[snip]
> See this footnote in the section "8.3.1 Inserting deadlines or
> schedules" of the manual:
>
>    (1) The `SCHEDULED' and `DEADLINE' dates are inserted on the line
> right below the headline.  Don't put any text between this line and the
> headline.

Hi. Then I guess the example in "8.3 Deadlines and scheduling" should be
amended. Patch attached.

-- 
Jérémie Courrèges-Anglas
Empreinte GPG : 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Deadlines and scheduling documentation patch --]
[-- Type: text/x-patch, Size: 1078 bytes --]

From 0644fc9f9eabc536348841550900a74f4bb5a5e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= <jca@wxcvbn.org>
Date: Tue, 10 Apr 2012 14:10:03 +0200
Subject: [PATCH] Deadlines and scheduling: Fix order in DEADLINE example

* doc/org.texi (Deadlines and scheduling): fix example, the DEADLINE item
should come right after the headline.

Maybe should the footnote (in 8.3.1) documenting this requirement should come
right into the 8.3 section, after the example?
---
 doc/org.texi |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 0be6e2b..f0f6e9d 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -5721,8 +5721,8 @@ until the entry is marked DONE.  An example:
 
 @example
 *** TODO write article about the Earth for the Guide
-    The editor in charge is [[bbdb:Ford Prefect]]
     DEADLINE: <2004-02-29 Sun>
+    The editor in charge is [[bbdb:Ford Prefect]]
 @end example
 
 You can specify a different lead time for warnings for a specific
-- 
1.7.6


[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  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
  0 siblings, 1 reply; 18+ messages in thread
From: Bastien @ 2012-04-10 12:34 UTC (permalink / raw)
  To: emacs-orgmode

Hi Jérémie,

jca+org@wxcvbn.org (Jérémie Courrèges-Anglas) writes:

> Bastien <bzg@gnu.org> writes:
> [snip]
>> See this footnote in the section "8.3.1 Inserting deadlines or
>> schedules" of the manual:
>>
>>    (1) The `SCHEDULED' and `DEADLINE' dates are inserted on the line
>> right below the headline.  Don't put any text between this line and the
>> headline.
>
> Hi. Then I guess the example in "8.3 Deadlines and scheduling" should be
> amended. Patch attached.

Indeed.  I applied the patch.  

I added "TINYCHANGE" in the commit message.  Please do so for small
changes when you are not a FSF-signed contributor.

Thanks!

-- 
 Bastien

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

* Re: [PATCH] Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-10 12:34     ` Bastien
@ 2012-04-10 13:34       ` Jérémie Courrèges-Anglas
  2012-04-10 13:40         ` Bastien
  0 siblings, 1 reply; 18+ messages in thread
From: Jérémie Courrèges-Anglas @ 2012-04-10 13:34 UTC (permalink / raw)
  To: emacs-orgmode

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

Bastien <bzg@gnu.org> writes:
[snip]
> I added "TINYCHANGE" in the commit message.  Please do so for small
> changes when you are not a FSF-signed contributor.

Oops, forgot that, thanks for the reminder, and thanks to the Org-mode
developers and community for such a great piece of software.

-- 
Jérémie Courrèges-Anglas
GPG fingerprint: 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494

[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-10 13:34       ` Jérémie Courrèges-Anglas
@ 2012-04-10 13:40         ` Bastien
  0 siblings, 0 replies; 18+ messages in thread
From: Bastien @ 2012-04-10 13:40 UTC (permalink / raw)
  To: emacs-orgmode

jca+org@wxcvbn.org (Jérémie Courrèges-Anglas) writes:

> Bastien <bzg@gnu.org> writes:
> [snip]
>> I added "TINYCHANGE" in the commit message.  Please do so for small
>> changes when you are not a FSF-signed contributor.
>
> Oops, forgot that, thanks for the reminder, and thanks to the Org-mode
> developers and community for such a great piece of software.

No problem -- thanks again for the patch!

-- 
 Bastien

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-09 14:51             ` Bastien
  2012-04-09 14:54               ` Dave Abrahams
@ 2012-04-10 13:43               ` Rainer Stengele
  2012-04-10 14:12                 ` Bastien
  1 sibling, 1 reply; 18+ messages in thread
From: Rainer Stengele @ 2012-04-10 13:43 UTC (permalink / raw)
  Cc: Dave Abrahams, emacs-orgmode, John Wiegley

Am 09.04.2012 16:51, schrieb Bastien:
> 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,

why does the function fire in this case:


***** test
****** TODO task
       SCHEDULED: <2012-04-10 Di>


Did I misunderstand?

Rainer

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

* Re: Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
  2012-04-10 13:43               ` Rainer Stengele
@ 2012-04-10 14:12                 ` Bastien
  0 siblings, 0 replies; 18+ messages in thread
From: Bastien @ 2012-04-10 14:12 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: Dave Abrahams, emacs-orgmode, John Wiegley

Hi Rainer,

Rainer Stengele <rainer.stengele@online.de> writes:

> why does the function fire in this case:
>
> ***** test
> ****** TODO task
>        SCHEDULED: <2012-04-10 Di>

Because it was buggy -- here is a better version (also updated on Worg)

(defun org-check-misformatted-subtree ()
  "Check misformatted entries in the current buffer."
  (interactive)
  (show-all)
  (org-map-entries
   (lambda ()
     (when (and (move-beginning-of-line 2)
		(not (looking-at org-heading-regexp)))
       (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."))))))

Thanks for testing!

-- 
 Bastien

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

end of thread, other threads:[~2012-04-10 14:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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