danielma / magit-org-todos.el

Get `todo.org` into your magit status
GNU General Public License v3.0
62 stars 3 forks source link

todo.org file with checkbox will crash magit #9

Open nasyxx opened 5 years ago

nasyxx commented 5 years ago

if todo.org have checkbox like this:

* TODO Http Functions

** TODO Get [1/2]

+ [X] Get
+ [ ] Decorator

** TODO Post [0/2]

+ [ ] Post
+ [ ] Decorator

magit-status will crash.

Debugger entered--Lisp error: (wrong-type-argument char-or-string-p (statistics-cookie (:begin 36 :end 41 :value "[1/2]" :post-blank 0 :parent (headline (:raw-value "Get [1/2]" :begin 24 :end 70 :pre-blank 1 :contents-begin 43 :contents-end 69 :level 2 :priority nil :tags nil :todo-keyword #("TODO" 0 4 (fontified nil)) :todo-type todo :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 24 :title (#("Get " 0 4 (:parent #15)) #3) :parent (headline (:raw-value "Http Functions" :begin 1 :end 117 :pre-blank 1 :contents-begin 24 :contents-end 117 :level 1 :priority nil :tags nil :todo-keyword #("TODO" 0 4 ...) :todo-type todo :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (...) :parent (org-data nil #53)) #15 (headline (:raw-value "Post [0/2]" :begin 70 :end 117 :pre-blank 1 :contents-begin 90 :contents-end 117 :level 2 :priority nil :tags nil :todo-keyword ... :todo-type todo :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 70 :title ... :parent #53) (section ... ...)))) (section (:begin 43 :end 70 :contents-begin 43 :contents-end 69 :post-blank 1 :post-affiliated 43 :parent #15) (plain-list (:type unordered :begin 43 :end 69 :contents-begin 43 :contents-end 69 :structure (... ...) :post-blank 0 :post-affiliated 43 :parent #18) (item (:bullet "+ " :begin 43 :end 53 :contents-begin 49 :contents-end 53 :checkbox on :counter nil :structure ... :post-blank 0 :post-affiliated 43 :tag nil :parent #21) (paragraph ... ...)) (item (:bullet "+ " :begin 53 :end 69 :contents-begin 59 :contents-end 69 :checkbox off :counter nil :structure ... :post-blank 0 :post-affiliated 53 :tag nil :parent #21) (paragraph ... ...))))))))
  magit-org-todos-insert-org-todos()
  apply(magit-org-todos-insert-org-todos nil)
  (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) (apply entry args))
  (let ((entry (car --dolist-tail--))) (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) (apply entry args)) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((entry (car --dolist-tail--))) (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) (apply entry args)) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- entries)) (while --dolist-tail-- (let ((entry (car --dolist-tail--))) (let ((magit--current-section-hook (cons (list hook entry) magit--current-section-hook))) (apply entry args)) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (let ((entries (symbol-value hook))) (if (listp entries) nil (setq entries (list entries))) (let ((it (-remove #'functionp entries))) (if it (progn (message "`%s' contains entries that are no longer valid.\n%s..." hook (mapconcat #'(lambda ... ...) it "\n")) (sit-for 5) (setq entries (eval (car (get hook ...))))))) (let ((--dolist-tail-- entries)) (while --dolist-tail-- (let ((entry (car --dolist-tail--))) (let ((magit--current-section-hook (cons ... magit--current-section-hook))) (apply entry args)) (setq --dolist-tail-- (cdr --dolist-tail--))))))
  magit-run-section-hook(magit-status-sections-hook)
  (catch 'cancel-section (magit-run-section-hook 'magit-status-sections-hook) (run-hooks 'magit-insert-section-hook) (magit-insert-child-count section191) (set-marker-insertion-type (eieio-oref section191 'start) t) (let* ((end (eieio-oset section191 'end (point-marker))) (class-map (eieio-oref-default section191 'keymap)) (magit-map (intern (format "magit-%s-section-map" (eieio-oref section191 'type)))) (forge-map (intern (format "forge-%s-section-map" (eieio-oref section191 'type)))) (map (or (and class-map (symbol-value class-map)) (and (boundp magit-map) (symbol-value magit-map)) (and (boundp forge-map) (symbol-value forge-map))))) (save-excursion (goto-char (eieio-oref section191 'start)) (while (< (point) end) (let ((next (or ... end))) (if (get-text-property (point) 'magit-section) nil (put-text-property (point) next 'magit-section section191) (if map (progn ...))) (goto-char next))))) (if (eq section191 magit-root-section) (let ((magit-section-cache-visibility nil)) (magit-section-show section191)) (eieio-oset (eieio-oref section191 'parent) 'children (nconc (eieio-oref (eieio-oref section191 'parent) 'children) (list section191)))))
  (let ((magit-insert-section--current section191) (magit-insert-section--parent section191) (magit-insert-section--oldroot (or magit-insert-section--oldroot (if magit-insert-section--parent nil (prog1 magit-root-section (setq magit-root-section section191)))))) (catch 'cancel-section (magit-run-section-hook 'magit-status-sections-hook) (run-hooks 'magit-insert-section-hook) (magit-insert-child-count section191) (set-marker-insertion-type (eieio-oref section191 'start) t) (let* ((end (eieio-oset section191 'end (point-marker))) (class-map (eieio-oref-default section191 'keymap)) (magit-map (intern (format "magit-%s-section-map" (eieio-oref section191 ...)))) (forge-map (intern (format "forge-%s-section-map" (eieio-oref section191 ...)))) (map (or (and class-map (symbol-value class-map)) (and (boundp magit-map) (symbol-value magit-map)) (and (boundp forge-map) (symbol-value forge-map))))) (save-excursion (goto-char (eieio-oref section191 'start)) (while (< (point) end) (let ((next ...)) (if (get-text-property ... ...) nil (put-text-property ... next ... section191) (if map ...)) (goto-char next))))) (if (eq section191 magit-root-section) (let ((magit-section-cache-visibility nil)) (magit-section-show section191)) (eieio-oset (eieio-oref section191 'parent) 'children (nconc (eieio-oref (eieio-oref section191 'parent) 'children) (list section191))))) section191)
  (let* ((type190 'status) (section191 (funcall (if (class-p type190) type190 (or (cdr (assq type190 magit--section-type-alist)) 'magit-section)) :type (if (class-p type190) (or (car (rassq type190 magit--section-type-alist)) (error "BUG: No entry for %s in %s" type190 'magit--section-type-alist)) type190) :value nil :start (point-marker) :parent magit-insert-section--parent))) (eieio-oset section191 'hidden (let* ((value (and t (run-hook-with-args-until-success 'magit-section-set-visibility-hook section191)))) (if value (eq value 'hide) (let* ((incarnation (and t ...))) (if incarnation (eieio-oref incarnation 'hidden) (let* (...) (if value ... nil))))))) (let ((magit-insert-section--current section191) (magit-insert-section--parent section191) (magit-insert-section--oldroot (or magit-insert-section--oldroot (if magit-insert-section--parent nil (prog1 magit-root-section (setq magit-root-section section191)))))) (catch 'cancel-section (magit-run-section-hook 'magit-status-sections-hook) (run-hooks 'magit-insert-section-hook) (magit-insert-child-count section191) (set-marker-insertion-type (eieio-oref section191 'start) t) (let* ((end (eieio-oset section191 'end (point-marker))) (class-map (eieio-oref-default section191 'keymap)) (magit-map (intern (format "magit-%s-section-map" ...))) (forge-map (intern (format "forge-%s-section-map" ...))) (map (or (and class-map ...) (and ... ...) (and ... ...)))) (save-excursion (goto-char (eieio-oref section191 'start)) (while (< (point) end) (let (...) (if ... nil ... ...) (goto-char next))))) (if (eq section191 magit-root-section) (let ((magit-section-cache-visibility nil)) (magit-section-show section191)) (eieio-oset (eieio-oref section191 'parent) 'children (nconc (eieio-oref (eieio-oref section191 ...) 'children) (list section191))))) section191))
  magit-status-refresh-buffer()
  apply(magit-status-refresh-buffer nil)
  (save-excursion (apply refresh magit-refresh-args))
  (let ((inhibit-read-only t)) (erase-buffer) (save-excursion (apply refresh magit-refresh-args)))
  (let* ((buffer (current-buffer)) (windows (apply 'append (mapcar #'(lambda (it) (let ... ...)) (or (get-buffer-window-list buffer nil t) (list (selected-window))))))) (deactivate-mark) (setq magit-section-highlight-overlays nil) (setq magit-section-highlighted-section nil) (setq magit-section-highlighted-sections nil) (setq magit-section-unhighlight-sections nil) (magit-process-unset-mode-line-error-status) (let ((inhibit-read-only t)) (erase-buffer) (save-excursion (apply refresh magit-refresh-args))) (let ((--dolist-tail-- windows)) (while --dolist-tail-- (let ((window (car --dolist-tail--))) (let ((save-selected-window--state (internal--before-with-selected-window ...))) (save-current-buffer (unwind-protect (progn ... ...) (internal--after-with-selected-window save-selected-window--state)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (run-hooks 'magit-refresh-buffer-hook) (magit-section-update-highlight) (set-buffer-modified-p nil))
  (progn (if magit-refresh-verbose (progn (message "Refreshing buffer `%s'..." (buffer-name)))) (let* ((buffer (current-buffer)) (windows (apply 'append (mapcar #'(lambda ... ...) (or (get-buffer-window-list buffer nil t) (list ...)))))) (deactivate-mark) (setq magit-section-highlight-overlays nil) (setq magit-section-highlighted-section nil) (setq magit-section-highlighted-sections nil) (setq magit-section-unhighlight-sections nil) (magit-process-unset-mode-line-error-status) (let ((inhibit-read-only t)) (erase-buffer) (save-excursion (apply refresh magit-refresh-args))) (let ((--dolist-tail-- windows)) (while --dolist-tail-- (let ((window (car --dolist-tail--))) (let ((save-selected-window--state ...)) (save-current-buffer (unwind-protect ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (run-hooks 'magit-refresh-buffer-hook) (magit-section-update-highlight) (set-buffer-modified-p nil)) (if magit-refresh-verbose (progn (message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name) (float-time (time-subtract (current-time) magit-refresh-start-time))))))
  (if (functionp refresh) (progn (if magit-refresh-verbose (progn (message "Refreshing buffer `%s'..." (buffer-name)))) (let* ((buffer (current-buffer)) (windows (apply 'append (mapcar #'... (or ... ...))))) (deactivate-mark) (setq magit-section-highlight-overlays nil) (setq magit-section-highlighted-section nil) (setq magit-section-highlighted-sections nil) (setq magit-section-unhighlight-sections nil) (magit-process-unset-mode-line-error-status) (let ((inhibit-read-only t)) (erase-buffer) (save-excursion (apply refresh magit-refresh-args))) (let ((--dolist-tail-- windows)) (while --dolist-tail-- (let ((window ...)) (let (...) (save-current-buffer ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (run-hooks 'magit-refresh-buffer-hook) (magit-section-update-highlight) (set-buffer-modified-p nil)) (if magit-refresh-verbose (progn (message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name) (float-time (time-subtract (current-time) magit-refresh-start-time)))))))
  (let ((refresh (intern (format "%s-refresh-buffer" (substring (symbol-name major-mode) 0 -5)))) (magit--refresh-cache (or magit--refresh-cache (list (cons 0 0))))) (if (functionp refresh) (progn (if magit-refresh-verbose (progn (message "Refreshing buffer `%s'..." (buffer-name)))) (let* ((buffer (current-buffer)) (windows (apply 'append (mapcar ... ...)))) (deactivate-mark) (setq magit-section-highlight-overlays nil) (setq magit-section-highlighted-section nil) (setq magit-section-highlighted-sections nil) (setq magit-section-unhighlight-sections nil) (magit-process-unset-mode-line-error-status) (let ((inhibit-read-only t)) (erase-buffer) (save-excursion (apply refresh magit-refresh-args))) (let ((--dolist-tail-- windows)) (while --dolist-tail-- (let (...) (let ... ...) (setq --dolist-tail-- ...)))) (run-hooks 'magit-refresh-buffer-hook) (magit-section-update-highlight) (set-buffer-modified-p nil)) (if magit-refresh-verbose (progn (message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name) (float-time (time-subtract ... magit-refresh-start-time))))))))
  magit-refresh-buffer()
  (save-current-buffer (set-buffer buffer) (run-hooks 'magit-mode-setup-hook) (magit-refresh-buffer))
  (let* ((value (and locked (magit-buffer-lock-value mode args))) (buffer (magit-mode-get-buffer mode nil nil value)) (section (and buffer (magit-current-section))) (created (not buffer))) (if buffer nil (setq buffer (let ((toplevel85 (magit-toplevel))) (if toplevel85 (let ((default-directory toplevel85)) (magit-generate-new-buffer mode value)) (magit--not-inside-repository-error))))) (save-current-buffer (set-buffer buffer) (setq magit-previous-section section) (setq magit-refresh-args args) (funcall mode) (if created (progn (magit-status-goto-initial-section) (run-hooks 'magit-create-buffer-hook)))) (magit-display-buffer buffer) (save-current-buffer (set-buffer buffer) (run-hooks 'magit-mode-setup-hook) (magit-refresh-buffer)))
  magit-mode-setup-internal(magit-status-mode nil)
  magit-mode-setup(magit-status-mode)
  (let ((default-directory directory)) (magit-mode-setup #'magit-status-mode))
  magit-status-internal("/Users/Nasy/Project/nacf/")
  (if directory (let ((toplevel (magit-toplevel directory))) (setq directory (file-name-as-directory (expand-file-name directory))) (if (and toplevel (file-equal-p directory toplevel)) (magit-status-internal directory) (if (y-or-n-p (if toplevel (format "%s is a repository.  Create another in %s? " toplevel directory) (format "Create repository in %s? " directory))) (progn (setq magit--refresh-cache nil) (magit-init directory))))) (magit-status-internal default-directory))
  (let ((magit--refresh-cache (or cache (list (cons 0 0))))) (if directory (let ((toplevel (magit-toplevel directory))) (setq directory (file-name-as-directory (expand-file-name directory))) (if (and toplevel (file-equal-p directory toplevel)) (magit-status-internal directory) (if (y-or-n-p (if toplevel (format "%s is a repository.  Create another in %s? " toplevel directory) (format "Create repository in %s? " directory))) (progn (setq magit--refresh-cache nil) (magit-init directory))))) (magit-status-internal default-directory)))
  magit-status(nil ((18 . 15) (("/Users/Nasy/Project/nacf/" "rev-parse" "--is-bare-repository") . "false\n") (("/Users/Nasy/Project/nacf/" magit-git-dir "BISECT_LOG") . "/Users/Nasy/Project/nacf/.git/BISECT_LOG") (("/Users/Nasy/Project/nacf/" magit-git-dir "REVERT_HEAD") . "/Users/Nasy/Project/nacf/.git/REVERT_HEAD") (("/Users/Nasy/Project/nacf/" magit-git-dir "CHERRY_PICK_HEAD") . "/Users/Nasy/Project/nacf/.git/CHERRY_PICK_HEAD") (("/Users/Nasy/Project/nacf/" magit-git-dir "rebase-apply/applying") . "/Users/Nasy/Project/nacf/.git/rebase-apply/applyin...") (("/Users/Nasy/Project/nacf/" magit-git-dir "rebase-apply/onto") . "/Users/Nasy/Project/nacf/.git/rebase-apply/onto") (("/Users/Nasy/Project/nacf/" magit-git-dir "rebase-merge") . "/Users/Nasy/Project/nacf/.git/rebase-merge") (("/Users/Nasy/Project/nacf/" magit-git-dir "MERGE_HEAD") . "/Users/Nasy/Project/nacf/.git/MERGE_HEAD") (("/Users/Nasy/Project/nacf/" "rev-parse" "--git-dir") . ".git") (("/Users/Nasy/Project/nacf/" "rev-parse" "--verify" "HEAD")) (("/Users/Nasy/Project/nacf/" . config) . #<hash-table equal 28/65 0x463f8e71>) (("/Users/Nasy/Project/nacf/" forge-get-repository full)) (("/Users/Nasy/Project/nacf/" . magit-toplevel) . "/Users/Nasy/Project/nacf/") (("/Users/Nasy/Project/nacf/" "rev-parse" "--show-cdup") . "") (("/Users/Nasy/Project/nacf/" "rev-parse" "--show-toplevel") . "/Users/Nasy/Project/nacf")))
  funcall-interactively(magit-status nil ((18 . 15) (("/Users/Nasy/Project/nacf/" "rev-parse" "--is-bare-repository") . "false\n") (("/Users/Nasy/Project/nacf/" magit-git-dir "BISECT_LOG") . "/Users/Nasy/Project/nacf/.git/BISECT_LOG") (("/Users/Nasy/Project/nacf/" magit-git-dir "REVERT_HEAD") . "/Users/Nasy/Project/nacf/.git/REVERT_HEAD") (("/Users/Nasy/Project/nacf/" magit-git-dir "CHERRY_PICK_HEAD") . "/Users/Nasy/Project/nacf/.git/CHERRY_PICK_HEAD") (("/Users/Nasy/Project/nacf/" magit-git-dir "rebase-apply/applying") . "/Users/Nasy/Project/nacf/.git/rebase-apply/applyin...") (("/Users/Nasy/Project/nacf/" magit-git-dir "rebase-apply/onto") . "/Users/Nasy/Project/nacf/.git/rebase-apply/onto") (("/Users/Nasy/Project/nacf/" magit-git-dir "rebase-merge") . "/Users/Nasy/Project/nacf/.git/rebase-merge") (("/Users/Nasy/Project/nacf/" magit-git-dir "MERGE_HEAD") . "/Users/Nasy/Project/nacf/.git/MERGE_HEAD") (("/Users/Nasy/Project/nacf/" "rev-parse" "--git-dir") . ".git") (("/Users/Nasy/Project/nacf/" "rev-parse" "--verify" "HEAD")) (("/Users/Nasy/Project/nacf/" . config) . #<hash-table equal 28/65 0x463f8e71>) (("/Users/Nasy/Project/nacf/" forge-get-repository full)) (("/Users/Nasy/Project/nacf/" . magit-toplevel) . "/Users/Nasy/Project/nacf/") (("/Users/Nasy/Project/nacf/" "rev-parse" "--show-cdup") . "") (("/Users/Nasy/Project/nacf/" "rev-parse" "--show-toplevel") . "/Users/Nasy/Project/nacf")))
  call-interactively(magit-status nil nil)
  command-execute(magit-status)
danielma commented 5 years ago

:wave: hi @nasyxx, sorry to hear you're having an issue.

It looks like it's happening because the [] in your * TODO header is some kind of special org-mode syntax. I don't currently have time to dig deeper and fix this, but I'm hoping a little explanation might be helpful to you

nasyxx commented 5 years ago

Thank you very much for the explanation. It is enough.

On Wed, Jan 2, 2019 at 11:54 PM Daniel Ma notifications@github.com wrote:

👋 hi @nasyxx https://github.com/nasyxx, sorry to hear you're having an issue.

It looks like it's happening because the [] in your * TODO header is some kind of special org-mode syntax. I don't currently have time to dig deeper and fix this, but I'm hoping a little explanation might be helpful to you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danielma/magit-org-todos.el/issues/9#issuecomment-450900738, or mute the thread https://github.com/notifications/unsubscribe-auth/AExo_ZOrgbX7IgidtW2q1GIqfFrsjcoQks5u_NY3gaJpZM4Zf2Oa .