emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dave Abrahams <dave@boostpro.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Bug: org-clock-out-if-current => "marker does not point anywhere" [7.7 (release_7.7.397.g5adafd)]
Date: Tue, 22 Nov 2011 20:49:12 -0800	[thread overview]
Message-ID: <m2aa7nmojb.fsf@pluto.luannocracy.com> (raw)
In-Reply-To: m2obw99uc4.fsf@pluto.luannocracy.com


The following patch fixes the bug.

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index e026d93..b47ac66 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1697,6 +1697,7 @@ from the `before-change-functions' in the current buffer."
 This is used to stop the clock after a TODO entry is marked DONE,
 and is only done if the variable `org-clock-out-when-done' is not nil."
   (when (and org-clock-out-when-done
+	     (marker-buffer org-clock-marker)
 	     (or (and (eq t org-clock-out-when-done)
 		      (member state org-done-keywords))
 		 (and (listp org-clock-out-when-done)
--8<---------------cut here---------------end--------------->8---


on Fri Nov 18 2011, Dave Abrahams <dave-AT-boostpro.com> wrote:

> 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.
>
> ------------------------------------------------------------------------
>
> The bug is caused by the following lines:
>
> 	     (< (point) org-clock-marker)
> 	     (> (save-excursion (outline-next-heading) (point))
>
> where org-clock-marker is `#<marker in no buffer>'
>   org-clock-out-if-current()
>   run-hooks(org-after-todo-state-change-hook)
>   byte-code("\306\307!\210\310\b!\203..\311\225Sb\210\310\312	\313Q!\204..\310\314!\210\302 .\315 .\302 .\316\216\317\320\321\307\211$*..@.@.A.A.B.B\322\323!.C\311\224.D\324.C!.E\325.E.F\"\211.GA@.H\326.G8.I\327.G8.J.C\206i.\330.K\307.L.C.M\235\211.NA.O.P\203\242..Q\331\232\203\214..R\332=\204\235..Q\204\242..R\203\242..R\332=\204\242.\333 \202\367..Q\334\232\203\300..R\203\263..P\204\300.\335\336\337\340.M\"\320\307$\202\367..Q\341=\203\335..C\203\327..O\205\367..O@\202\367..M@\202\367..Q\342=\203...N.M\232?\205\367..C\203..\343.MG.OG\344#.M8\202\367..M.S\345.S!@)\202\367..R\307=\203#..Q\346\232\203#.\320\211.Q\206\367..Q\203\247..Q\330\232\2033.\320\202\367..Q\347=\203>.\320\202\367..Q\350=\203P..I\206\367..T@\202\367..Q\351=\203g..E.U\235A@\206\367..U@\202\367..Q\352=\203\205.\353.U!.U.E.U\235A@\206\201..U@)\202\367..Q.M\235@\206\367..Q;\203\234.\354\355.Q\"\202\367.\356.Q!S.M8\202\367..N\204\267..E\206\367..M@\202\367..C.J\232\203\303.\320\202\367..O\204\314.\320\202\367..H\357>\203\364..V.W=\203\341..O@\202\367..OG\311V\205\367..I\206\367..T@\202\367..O@.X\360\361.X.K#\206...X\211.X\203..\362.X\362Q\202..\362.Y\363\364\365.C\366.X\367\v\257\b.Z\320\211.[.\\.:\203j..C.T\235?.]\212\302 .\370\216\212\214~\210\371\372.Z\"-\204j.\373\374!\203[.\354\375.C.X#\210\202j.\376\375.C.X#\210\377\201g.\320\"\210\201h.\n!\210\201i..Y\307\211#\210\201j..D!\204\216.\376\201k.\201l..Y!\"\210.E\204\262.\324.X!.E\325.E.F\"\211.GA@.H\326.G8.I\327.G8.J.Q\201m.>\203\344.\376\201n.\343.^G\201o.\325.X.^\".^>G#.^G\201p.\201q.\325.X.^\"\362#$\210.X.T\235?.].X.T\235\205\372..C.T\235?.\\.\203..\201r.
> !\210.B\204...@\203\271.._\307=\204\271..Q\201s.>\204\271.\325.X.B\"A@\2063.\344\325.C.B\"8\211.[\201t.=\203K.._\201t.=\203K.\201u..[.X\203j..X.`\235\203j..C.`\235\204j.\201v.\320\211\201w.#\210.\\\203\236..@\203\236.\201v.\201w.\201x. \"\210.[\204\236..@\201t.=\203\236.\201y.\350.X.C\201z.\201t.%\210.X\203\271..[\203\271.\201y.\201X..X.C\201z..[%\210\201{..X!\210.a\203\321..b\204\321.\201|.\320\307\"\210.c\203\333.\201}. \210\201~.\201\x7f.!\210.Q\203\366..X.T\235\204\366.\324.X!.E\201\200.\315 \201\201. \201\202..E$\210.\\\203*.\201\203.\201d.!\203#.\302 .\201\204.\216\201\205. .d*\201\206..X!\210\201\207. \203f.n\204f.\212\201\210.\323!\210\310.e!)\203f.`\344\211\225\206M.\323\225\\W\203f.\344\225\206Y.\323\225b\210\310\362!\203f.\201\211. \210.f\205v.\212\201\212.\201f..Z\")..\207" [org-outline-regexp org-todo-regexp match-data startpos save-match-data-internal logging org-back-to-heading t looking-at 0 " +" "\\( +\\|$\\)" " *" point-at-bol ((byte-code "\301\b\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) org-entry-get nil "LOGGING" match-string 1 org-get-todo-sequence-head assoc 3 4 "" (4) prefix org-fast-todo-selection (4) org-icompleting-read "State: " mapcar #[(x) "\bC\207" [x] 1] right left - 2 last (4) none done nextset previousset reverse error "State `%s' not valid in this file" prefix-numeric-value (type priority) run-hook-with-args-until-success org-todo-get-default-hook ...] 10)
>   org-todo(done)
>   (if (or (match-string 2) (and ... ...)) (org-todo (quote done)) (org-todo (quote todo)))
>   (progn (if (or ... ...) (org-todo ...) (org-todo ...)))
>   (if (looking-at (concat "^\\*+[ 	]+" org-todo-regexp "[ 	].*\\[" "\\(?:" "\\(?2:100%\\)\\|[0-9]+%" "\\|" "\\(?3:[0-9]+\\)" "/" "\\(?4:[0-9]+\\)" "\\)" "\\]")) (progn (if ... ... ...)))
>   (when (looking-at (concat "^\\*+[ 	]+" org-todo-regexp "[ 	].*\\[" "\\(?:" "\\(?2:100%\\)\\|[0-9]+%" "\\|" "\\(?3:[0-9]+\\)" "/" "\\(?4:[0-9]+\\)" "\\)" "\\]")) (if (or ... ...) (org-todo ...) (org-todo ...)))
>   (save-excursion (org-back-to-heading t) (when (looking-at ...) (if ... ... ...)))
>   dwa/checkbox-list-complete()
>   run-hooks(org-checkbox-statistics-hook)
>   org-update-checkbox-count-maybe()
>   org-ctrl-c-ctrl-c(nil)
>   call-interactively(org-ctrl-c-ctrl-c nil nil)
> Emacs  : GNU Emacs 23.3.1 (x86_64-apple-darwin11.2.0, Carbon Version 1.6.0 AppKit 1138.23)
>  of 2011-11-13 on pluto.luannocracy.com
> Package: Org-mode version 7.7 (release_7.7.397.g5adafd)
>
> current state:
> ==============
> (setq
>  org-x-backends '(ox-org ox-redmine)
>  org-log-done 'time
>  org-agenda-deadline-leaders '("D: " "D%d: ")
>  org-clock-in-switch-to-state "STARTED"
>  org-agenda-skip-scheduled-if-deadline-is-shown t
>  org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
>  org-special-ctrl-a/e '(nil . t)
>  org-x-redmine-title-prefix-match-function 'org-x-redmine-title-prefix-match
>  org-default-priority 67
>  org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
>  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\\]")))
>                                 )
>                                )
>                               ("L" "Ledger tasks not in Bugzilla" tags
>                                "TODO<>{DONE\\|TESTED\\|CLOSED\\|NOTE}&LEVEL=2"
>                                ((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) "#"))))
>                                )
>                               ("r" "Uncategorized items" tags "CATEGORY=\"Inbox\"&LEVEL=2"
>                                ((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-agenda-files '("~/Documents/Tasks/todo.txt")
>  org-agenda-include-diary t
>  org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
>  org-src-fontify-natively t
>  org-habit-completed-glyph 10004
>  org-habit-show-habits-only-for-today nil
>  org-agenda-window-setup 'current-window
>  org-hide-leading-stars t
>  org-clock-into-drawer "LOGBOOK"
>  org-checklist-export-function 'org-export-as-ascii
>  org-completion-use-ido t
>  org-metaup-hook '(org-babel-load-in-session-maybe)
>  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-footnote-section nil
>  org-agenda-scheduled-leaders '("" "S%d: ")
>  org-archive-save-context-info '(time category itags)
>  org-after-todo-state-change-hook '(org-clock-out-if-current org-checklist)
>  org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el"))
>  org-agenda-text-search-extra-files '(agenda-archives)
>  org-x-priority-B-silent nil
>  org-agenda-follow-indirect t
>  org-archive-location "TODO-archive::"
>  org-agenda-skip-unavailable-files t
>  org-agenda-default-appointment-duration 60
>  org-speed-commands-user '(("+" . org-priority-up) ("-" . org-priority-down))
>  org-habit-today-glyph 9483
>  org-time-clocksum-use-fractional t
>  org-edit-src-content-indentation 0
>  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-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup)
>  org-agenda-prefix-format '((agenda . "  %-11:c%?-12t% s") (timeline . "  % s") (todo . "  %-11:c")
>                             (tags . "  %-11:c"))
>  org-after-todo-statistics-hook '(dwa/org-summary-todo)
>  org-agenda-restore-windows-after-quit t
>  org-habit-preceding-days 42
>  org-export-latex-format-toc-function 'org-export-latex-format-toc-default
>  org-agenda-skip-scheduled-if-done t
>  org-x-redmine-title-prefix-function 'org-x-redmine-title-prefix
>  org-clock-in-resume t
>  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-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
>  org-finalize-agenda-hook '(org-agenda-add-overlays)
>  org-cycle-global-at-bob t
>  org-confirm-shell-link-function nil
>  org-export-first-hook '(org-beamer-initialize-open-trackers)
>  org-clock-persist 'history
>  org-agenda-before-write-hook '(org-agenda-add-entry-text)
>  org-agenda-start-with-follow-mode t
>  org-default-notes-file "~/Documents/Tasks/todo.txt"
>  org-use-property-inheritance '("AREA")
>  org-directory "~/Documents/Tasks/"
>  org-agenda-persistent-filter t
>  org-blank-before-new-entry nil
>  org-babel-pre-tangle-hook '(save-buffer)
>  org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines
>                   org-optimize-window-after-visibility-change)
>  org-export-preprocess-before-normalizing-links-hook '(org-remove-file-link-modifiers)
>  org-enable-table-editor t
>  org-refile-target-verify-function 'dwa/org-verify-refile-target
>  org-use-speed-commands t
>  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-clock-out-remove-zero-time-clocks t
>  org-agenda-ndays 1
>  org-refile-targets '((nil :todo . "PROJECT") (nil :maxlevel . 2))
>  org-extend-today-until 6
>  org-mobile-pre-pull-hook '(my-org-convert-incoming-items)
>  org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
>  org-log-buffer-setup-hook '((lambda nil (setq fill-column (- fill-column 5))))
>  org-pretty-entities t
>  org-return-follows-link t
>  org-confirm-elisp-link-function nil
>  org-fast-tag-selection-single-key 'expert
>  org-todo-repeat-to-state "TODO"
>  org-log-into-drawer t
>  org-clock-modeline-total 'current
>  org-agenda-mode-hook '((lambda nil (local-unset-key (kbd ".,"))))
>  org-agenda-start-on-weekday nil
>  org-agenda-fontify-priorities t
>  org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src org-babel-exp-inline-src-blocks))
>  org-log-repeat nil
>  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
>  org-enforce-todo-dependencies t
>  org-agenda-skip-deadline-if-done t
>  org-reverse-note-order t
>  org-occur-hook '(org-first-headline-recenter)
>  org-checkbox-statistics-hook '(dwa/checkbox-list-complete)
>  org-export-babel-evaluate nil
>  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-drawers '("PROPERTIES" "CLOCK" "LOGBOOK" "OUT")
>  org-export-preprocess-before-selecting-backend-code-hook '(org-beamer-select-beamer-code)
>  org-tags-column -97
>  org-modules '(org-id org-info org-habit)
>  org-agenda-auto-exclude-function 'org-my-auto-exclude-function
>  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-metadown-hook '(org-babel-pop-to-session-maybe)
>  org-clock-idle-time 10
>  org-attach-method 'mv
>  org-export-blocks '((src org-babel-exp-src-block nil) (comment org-export-blocks-format-comment t)
>                      (ditaa org-export-blocks-format-ditaa nil) (dot org-export-blocks-format-dot nil))
>  )

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

      parent reply	other threads:[~2011-11-23  5:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 18:08 Bug: org-clock-out-if-current => "marker does not point anywhere" [7.7 (release_7.7.397.g5adafd)] Dave Abrahams
2011-11-19 21:44 ` [PATCH] Fix marker in no buffer error for task state change in an indirect buffer Bernt Hansen
2011-12-11 17:23   ` [Accepted] " Bastien Guerry
2011-12-11 17:23   ` [PATCH] " Bastien
2011-11-23  4:49 ` Dave Abrahams [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=m2aa7nmojb.fsf@pluto.luannocracy.com \
    --to=dave@boostpro.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).