Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
Hi Rainer, Rainer Stengele 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
Am 09.04.2012 16:51, schrieb Bastien: > Hi Dave, > > Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
> Bastien 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
on Mon Apr 09 2012, Bastien wrote: > Hi Dave, > > Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
Hi Dave, Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
on Mon Apr 09 2012, Bastien wrote: > Hi Dave, > > Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
Hi Dave, Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
on Mon Apr 09 2012, Bastien wrote: > Hi Dave, > > Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
Hi Dave, Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
on Mon Apr 09 2012, Bastien 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
on Fri Apr 06 2012, Bastien wrote: > Hi Dave, > > Dave Abrahams 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
Re: [O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
Hi Dave, Dave Abrahams 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
[O] Bug: "SCHEDULED: " positioning is fragile [7.8.06 (release_7.8.06.181.ga481)]
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:"