emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug] TODO [/] cookie not updating if list has inline task
@ 2015-05-17 11:22 Eric S Fraga
  2015-05-17 13:08 ` Eric S Fraga
  2015-05-17 13:51 ` Rasmus
  0 siblings, 2 replies; 17+ messages in thread
From: Eric S Fraga @ 2015-05-17 11:22 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello,

I often use checkbox lists for particular tasks.  If any of the list
items has an inline task (whether a task or not), the updating of the
[/] cookie in the headline does not work.  Attached is an example.

Backtrace is also attached.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1147-g0e5069

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: examplebug.org --]
[-- Type: text/x-org, Size: 231 bytes --]

#+TITLE:     examplebug.org
#+AUTHOR:    Eric S Fraga
#+options: tex:dvipng
* TODO [0/2] to do cookies not updating
- [ ] the first task
  
*************** This is something to note
*************** END

- [ ] another list of tasks

[-- Attachment #3: backtrace.txt --]
[-- Type: text/plain, Size: 29091 bytes --]

Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
  re-search-forward("^[ 	]*\\([-+*]\\|\\([0-9]+\\|[A-Za-z]\\)[.)]\\)[ 	]+\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ 	]*\\)?\\(\\[[- X]\\]\\)" 141 move)
  funcall(re-search-forward "^[ 	]*\\([-+*]\\|\\([0-9]+\\|[A-Za-z]\\)[.)]\\)[ 	]+\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ 	]*\\)?\\(\\[[- X]\\]\\)" 141 move)
  (if (funcall search re bound noerr) nil (throw (quote exit) (and (goto-char (if (memq noerr (quote (t nil))) origin bound)) nil)))
  (while t (if (funcall search re bound noerr) nil (throw (quote exit) (and (goto-char (if (memq noerr (quote ...)) origin bound)) nil))) (if (org-list-in-valid-context-p) (progn (throw (quote exit) (point)))))
  (let ((origin (point))) (while t (if (funcall search re bound noerr) nil (throw (quote exit) (and (goto-char (if (memq noerr ...) origin bound)) nil))) (if (org-list-in-valid-context-p) (progn (throw (quote exit) (point))))))
  (catch (quote exit) (let ((origin (point))) (while t (if (funcall search re bound noerr) nil (throw (quote exit) (and (goto-char (if ... origin bound)) nil))) (if (org-list-in-valid-context-p) (progn (throw (quote exit) (point)))))))
  org-list-search-generic(re-search-forward "^[ 	]*\\([-+*]\\|\\([0-9]+\\|[A-Za-z]\\)[.)]\\)[ 	]+\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ 	]*\\)?\\(\\[[- X]\\]\\)" 141 move)
  org-list-search-forward("^[ 	]*\\([-+*]\\|\\([0-9]+\\|[A-Za-z]\\)[.)]\\)[ 	]+\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ 	]*\\)?\\(\\[[- X]\\]\\)" 141 move)
  (while (org-list-search-forward box-re backup-end (quote move)) (let* ((struct (org-list-struct)) (bottom (org-list-get-bottom-point struct))) (setq structs-bak (cons struct structs-bak)) (goto-char bottom)))
  (cond ((and (org-at-heading-p) (string-match "\\<todo\\>" (downcase (or (org-entry-get nil "COOKIE_DATA") "")))) (throw (quote skip) nil)) ((and (org-at-heading-p) (<= (save-excursion (outline-next-heading) (point)) backup-end)) (funcall count-boxes nil structs-bak recursivep)) ((org-at-heading-p) (setq backup-end (save-excursion (outline-next-heading) (point)) structs-bak nil) (while (org-list-search-forward box-re backup-end (quote move)) (let* ((struct (org-list-struct)) (bottom (org-list-get-bottom-point struct))) (setq structs-bak (cons struct structs-bak)) (goto-char bottom))) (funcall count-boxes nil structs-bak recursivep)) ((and (org-at-item-p) (< (point-at-bol) backup-end) (not (nth 2 (org-list-context)))) (funcall count-boxes (point-at-bol) structs-bak recursivep)) ((org-at-item-p) (let ((struct (org-list-struct))) (setq backup-end (org-list-get-bottom-point struct) structs-bak (list struct))) (funcall count-boxes (point-at-bol) structs-bak recursivep)) (t (throw (quote skip) nil)))
  (list (match-beginning 1) (match-end 1) (match-string 2) (cond ((and (org-at-heading-p) (string-match "\\<todo\\>" (downcase (or (org-entry-get nil "COOKIE_DATA") "")))) (throw (quote skip) nil)) ((and (org-at-heading-p) (<= (save-excursion (outline-next-heading) (point)) backup-end)) (funcall count-boxes nil structs-bak recursivep)) ((org-at-heading-p) (setq backup-end (save-excursion (outline-next-heading) (point)) structs-bak nil) (while (org-list-search-forward box-re backup-end (quote move)) (let* ((struct (org-list-struct)) (bottom (org-list-get-bottom-point struct))) (setq structs-bak (cons struct structs-bak)) (goto-char bottom))) (funcall count-boxes nil structs-bak recursivep)) ((and (org-at-item-p) (< (point-at-bol) backup-end) (not (nth 2 (org-list-context)))) (funcall count-boxes (point-at-bol) structs-bak recursivep)) ((org-at-item-p) (let ((struct (org-list-struct))) (setq backup-end (org-list-get-bottom-point struct) structs-bak (list struct))) (funcall count-boxes (point-at-bol) structs-bak recursivep)) (t (throw (quote skip) nil))))
  (cons (list (match-beginning 1) (match-end 1) (match-string 2) (cond ((and (org-at-heading-p) (string-match "\\<todo\\>" (downcase (or ... "")))) (throw (quote skip) nil)) ((and (org-at-heading-p) (<= (save-excursion (outline-next-heading) (point)) backup-end)) (funcall count-boxes nil structs-bak recursivep)) ((org-at-heading-p) (setq backup-end (save-excursion (outline-next-heading) (point)) structs-bak nil) (while (org-list-search-forward box-re backup-end (quote move)) (let* ((struct ...) (bottom ...)) (setq structs-bak (cons struct structs-bak)) (goto-char bottom))) (funcall count-boxes nil structs-bak recursivep)) ((and (org-at-item-p) (< (point-at-bol) backup-end) (not (nth 2 (org-list-context)))) (funcall count-boxes (point-at-bol) structs-bak recursivep)) ((org-at-item-p) (let ((struct (org-list-struct))) (setq backup-end (org-list-get-bottom-point struct) structs-bak (list struct))) (funcall count-boxes (point-at-bol) structs-bak recursivep)) (t (throw (quote skip) nil)))) cookies-list)
  (setq cookies-list (cons (list (match-beginning 1) (match-end 1) (match-string 2) (cond ((and (org-at-heading-p) (string-match "\\<todo\\>" (downcase ...))) (throw (quote skip) nil)) ((and (org-at-heading-p) (<= (save-excursion ... ...) backup-end)) (funcall count-boxes nil structs-bak recursivep)) ((org-at-heading-p) (setq backup-end (save-excursion (outline-next-heading) (point)) structs-bak nil) (while (org-list-search-forward box-re backup-end (quote move)) (let* (... ...) (setq structs-bak ...) (goto-char bottom))) (funcall count-boxes nil structs-bak recursivep)) ((and (org-at-item-p) (< (point-at-bol) backup-end) (not (nth 2 ...))) (funcall count-boxes (point-at-bol) structs-bak recursivep)) ((org-at-item-p) (let ((struct ...)) (setq backup-end (org-list-get-bottom-point struct) structs-bak (list struct))) (funcall count-boxes (point-at-bol) structs-bak recursivep)) (t (throw (quote skip) nil)))) cookies-list))
  (save-excursion (setq cookies-list (cons (list (match-beginning 1) (match-end 1) (match-string 2) (cond ((and (org-at-heading-p) (string-match "\\<todo\\>" ...)) (throw (quote skip) nil)) ((and (org-at-heading-p) (<= ... backup-end)) (funcall count-boxes nil structs-bak recursivep)) ((org-at-heading-p) (setq backup-end (save-excursion ... ...) structs-bak nil) (while (org-list-search-forward box-re backup-end ...) (let* ... ... ...)) (funcall count-boxes nil structs-bak recursivep)) ((and (org-at-item-p) (< ... backup-end) (not ...)) (funcall count-boxes (point-at-bol) structs-bak recursivep)) ((org-at-item-p) (let (...) (setq backup-end ... structs-bak ...)) (funcall count-boxes (point-at-bol) structs-bak recursivep)) (t (throw (quote skip) nil)))) cookies-list)))
  (catch (quote skip) (save-excursion (setq cookies-list (cons (list (match-beginning 1) (match-end 1) (match-string 2) (cond ((and ... ...) (throw ... nil)) ((and ... ...) (funcall count-boxes nil structs-bak recursivep)) ((org-at-heading-p) (setq backup-end ... structs-bak nil) (while ... ...) (funcall count-boxes nil structs-bak recursivep)) ((and ... ... ...) (funcall count-boxes ... structs-bak recursivep)) ((org-at-item-p) (let ... ...) (funcall count-boxes ... structs-bak recursivep)) (t (throw ... nil)))) cookies-list))))
  (while (re-search-forward cookie-re (cdr bounds) t) (catch (quote skip) (save-excursion (setq cookies-list (cons (list (match-beginning 1) (match-end 1) (match-string 2) (cond (... ...) (... ...) (... ... ... ...) (... ...) (... ... ...) (t ...))) cookies-list)))))
  (let ((cookie-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)") (box-re "^[ 	]*\\([-+*]\\|\\([0-9]+\\|[A-Za-z]\\)[.)]\\)[ 	]+\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ 	]*\\)?\\(\\[[- X]\\]\\)") (recursivep (or (not org-checkbox-hierarchical-statistics) (string-match "\\<recursive\\>" (or (org-entry-get nil "COOKIE_DATA") "")))) (bounds (if all (cons (point-min) (point-max)) (cons (or (condition-case nil (progn ... ...) (error nil)) (point-min)) (save-excursion (outline-next-heading) (point))))) (count-boxes (function (lambda (item structs recursivep) (let ((c-on 0) (c-all 0)) (mapc (function ...) structs) (cons c-on c-all))))) (backup-end 1) cookies-list structs-bak box-num) (goto-char (car bounds)) (while (re-search-forward cookie-re (cdr bounds) t) (catch (quote skip) (save-excursion (setq cookies-list (cons (list (match-beginning 1) (match-end 1) (match-string 2) (cond ... ... ... ... ... ...)) cookies-list))))) (mapc (function (lambda (cookie) (let* ((beg (car cookie)) (end (nth 1 cookie)) (percentp (nth 2 cookie)) (checked (car ...)) (total (cdr ...)) (new (if percentp ... ...))) (goto-char beg) (insert new) (delete-region (point) (+ (point) (- end beg))) (if org-auto-align-tags (progn (org-fix-tags-on-the-fly)))))) cookies-list))
  (save-excursion (let ((cookie-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)") (box-re "^[ 	]*\\([-+*]\\|\\([0-9]+\\|[A-Za-z]\\)[.)]\\)[ 	]+\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ 	]*\\)?\\(\\[[- X]\\]\\)") (recursivep (or (not org-checkbox-hierarchical-statistics) (string-match "\\<recursive\\>" (or (org-entry-get nil "COOKIE_DATA") "")))) (bounds (if all (cons (point-min) (point-max)) (cons (or (condition-case nil ... ...) (point-min)) (save-excursion (outline-next-heading) (point))))) (count-boxes (function (lambda (item structs recursivep) (let (... ...) (mapc ... structs) (cons c-on c-all))))) (backup-end 1) cookies-list structs-bak box-num) (goto-char (car bounds)) (while (re-search-forward cookie-re (cdr bounds) t) (catch (quote skip) (save-excursion (setq cookies-list (cons (list ... ... ... ...) cookies-list))))) (mapc (function (lambda (cookie) (let* ((beg ...) (end ...) (percentp ...) (checked ...) (total ...) (new ...)) (goto-char beg) (insert new) (delete-region (point) (+ ... ...)) (if org-auto-align-tags (progn ...))))) cookies-list)))
  org-update-checkbox-count()
  (if (and (save-excursion (re-search-forward "^[ 	]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t)) (not (save-excursion (re-search-forward ":COOKIE_DATA:.*\\<todo\\>" end t)))) (org-update-checkbox-count) (if (and l2 (> l2 l1)) (progn (goto-char end) (org-update-parent-todo-statistics)) (goto-char pos) (beginning-of-line 1) (while (re-search-forward "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)" (point-at-eol) t) (replace-match (if (match-end 2) "[100%]" "[0/0]") t t))))
  (if (not (org-at-heading-p)) (org-update-checkbox-count) (setq l1 (org-outline-level)) (setq end (save-excursion (outline-next-heading) (if (org-at-heading-p) (setq l2 (org-outline-level))) (point))) (if (and (save-excursion (re-search-forward "^[ 	]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t)) (not (save-excursion (re-search-forward ":COOKIE_DATA:.*\\<todo\\>" end t)))) (org-update-checkbox-count) (if (and l2 (> l2 l1)) (progn (goto-char end) (org-update-parent-todo-statistics)) (goto-char pos) (beginning-of-line 1) (while (re-search-forward "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)" (point-at-eol) t) (replace-match (if (match-end 2) "[100%]" "[0/0]") t t)))))
  (let ((pos (point-marker)) end l1 l2) (condition-case nil (progn (org-back-to-heading t)) (error nil)) (if (not (org-at-heading-p)) (org-update-checkbox-count) (setq l1 (org-outline-level)) (setq end (save-excursion (outline-next-heading) (if (org-at-heading-p) (setq l2 (org-outline-level))) (point))) (if (and (save-excursion (re-search-forward "^[ 	]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t)) (not (save-excursion (re-search-forward ":COOKIE_DATA:.*\\<todo\\>" end t)))) (org-update-checkbox-count) (if (and l2 (> l2 l1)) (progn (goto-char end) (org-update-parent-todo-statistics)) (goto-char pos) (beginning-of-line 1) (while (re-search-forward "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)" (point-at-eol) t) (replace-match (if (match-end 2) "[100%]" "[0/0]") t t))))) (goto-char pos) (move-marker pos nil))
  (if (not (org-at-heading-p)) (org-update-checkbox-count) (let ((pos (point-marker)) end l1 l2) (condition-case nil (progn (org-back-to-heading t)) (error nil)) (if (not (org-at-heading-p)) (org-update-checkbox-count) (setq l1 (org-outline-level)) (setq end (save-excursion (outline-next-heading) (if (org-at-heading-p) (setq l2 (org-outline-level))) (point))) (if (and (save-excursion (re-search-forward "^[ 	]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t)) (not (save-excursion (re-search-forward ":COOKIE_DATA:.*\\<todo\\>" end t)))) (org-update-checkbox-count) (if (and l2 (> l2 l1)) (progn (goto-char end) (org-update-parent-todo-statistics)) (goto-char pos) (beginning-of-line 1) (while (re-search-forward "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)" (point-at-eol) t) (replace-match (if ... "[100%]" "[0/0]") t t))))) (goto-char pos) (move-marker pos nil)))
  (if all (progn (org-update-checkbox-count (quote all)) (org-map-entries (quote org-update-parent-todo-statistics))) (if (not (org-at-heading-p)) (org-update-checkbox-count) (let ((pos (point-marker)) end l1 l2) (condition-case nil (progn (org-back-to-heading t)) (error nil)) (if (not (org-at-heading-p)) (org-update-checkbox-count) (setq l1 (org-outline-level)) (setq end (save-excursion (outline-next-heading) (if (org-at-heading-p) (setq l2 ...)) (point))) (if (and (save-excursion (re-search-forward "^[ 	]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t)) (not (save-excursion ...))) (org-update-checkbox-count) (if (and l2 (> l2 l1)) (progn (goto-char end) (org-update-parent-todo-statistics)) (goto-char pos) (beginning-of-line 1) (while (re-search-forward "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)" ... t) (replace-match ... t t))))) (goto-char pos) (move-marker pos nil))))
  org-update-statistics-cookies(nil)
  funcall-interactively(org-update-statistics-cookies nil)
  call-interactively(org-update-statistics-cookies)
  (cond ((eql type (quote clock)) (org-clock-update-time-maybe)) ((eql type (quote dynamic-block)) (save-excursion (goto-char (org-element-property :post-affiliated context)) (org-update-dblock))) ((eql type (quote footnote-definition)) (goto-char (org-element-property :post-affiliated context)) (call-interactively (quote org-footnote-action))) ((eql type (quote footnote-reference)) (call-interactively (quote org-footnote-action))) ((memql type (quote (headline inlinetask))) (save-excursion (goto-char (org-element-property :begin context)) (call-interactively (quote org-set-tags)))) ((eql type (quote item)) (let* ((box (org-element-property :checkbox context)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (parents (org-list-parents-alist struct)) (prevs (org-list-prevs-alist struct)) (orderedp (org-not-nil (org-entry-get nil "ORDERED")))) (org-list-set-checkbox (org-element-property :begin context) struct (cond ((equal arg (quote ...)) "[-]") ((and (not box) (equal arg ...)) "[ ]") ((or (not box) (equal arg ...)) nil) ((eq box (quote on)) "[ ]") (t "[X]"))) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ((block-item (org-list-struct-fix-box struct parents prevs orderedp))) (if (and box (equal struct old-struct)) (if (equal arg (quote ...)) (message "Checkboxes already reset") (user-error "Cannot toggle this checkbox: %s" (if ... "all subitems checked" "unchecked subitems"))) (org-list-struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe)) (if block-item (progn (message "Checkboxes were removed due to empty box at line %d" (org-current-line block-item))))))) ((eql type (quote keyword)) (let ((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil)) (if (boundp (quote org-table-coordinate-overlays)) (progn (mapc (quote delete-overlay) org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil))) (let ((--data (org-outline-overlay-data (quote use-markers))) --rtn) (unwind-protect (progn (setq --rtn (progn ...)) (org-set-outline-overlay-data --data)) (if (quote use-markers) (progn (mapc ... --data)))) --rtn)) (message "Local setup has been refreshed")) ((eql type (quote plain-list)) (let* ((begin (org-element-property :contents-begin context)) (beginm (move-marker (make-marker) begin)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (first-box (save-excursion (goto-char begin) (looking-at org-list-full-item-re) (match-string-no-properties 3))) (new-box (cond ((equal arg ...) "[-]") ((equal arg ...) (if first-box nil "[ ]")) ((equal first-box "[X]") "[ ]") (t "[X]")))) (cond (arg (mapc (function (lambda ... ...)) (org-list-get-all-items begin struct (org-list-prevs-alist struct)))) ((and first-box (eq (point) begin)) (org-list-set-checkbox begin struct new-box))) (org-list-write-struct struct (org-list-parents-alist struct) old-struct) (org-update-checkbox-count-maybe) (save-excursion (goto-char beginm) (org-list-send-list (quote maybe))))) ((memql type (quote (property-drawer node-property))) (call-interactively (quote org-property-action))) ((memql type (quote (radio-target target))) (call-interactively (quote org-update-radio-target-regexp))) ((eql type (quote statistics-cookie)) (call-interactively (quote org-update-statistics-cookies))) ((memql type (quote (table table-cell table-row))) (if (eq (org-element-property :type context) (quote table\.el)) (message "Use C-c ' to edit table.el tables") (let ((org-enable-table-editor t)) (if (or (eq type (quote table)) (and (eq type ...) (= ... ...))) (save-excursion (if (org-at-TBLFM-p) (progn ... ...) (goto-char ...) (org-call-with-arg ... ...) (orgtbl-send-table ...))) (org-table-maybe-eval-formula) (cond (arg (call-interactively ...)) ((org-table-maybe-recalculate-line)) (t (org-table-align))))))) ((eql type (quote timestamp)) (org-timestamp-change 0 (quote day))) (t (or (run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-final-hook)) (user-error "C-c C-c can do nothing useful at this location"))))
  (let* ((context (org-element-context)) (type (org-element-type context))) (cond ((eql type (quote link)) (setq context (org-element-property :parent context)) (setq type (org-element-type context))) ((memql type (quote (bold code entity export-snippet inline-babel-call inline-src-block italic latex-fragment line-break macro strike-through subscript superscript underline verbatim))) (setq context (org-element-lineage context (quote (radio-target paragraph verse-block table-cell)))))) (if (eq type (quote paragraph)) (progn (let ((parent (org-element-property :parent context))) (if (and (eq (org-element-type parent) (quote item)) (= (line-beginning-position) (org-element-property :begin parent))) (progn (setq context parent type (quote item))))))) (cond ((eql type (quote clock)) (org-clock-update-time-maybe)) ((eql type (quote dynamic-block)) (save-excursion (goto-char (org-element-property :post-affiliated context)) (org-update-dblock))) ((eql type (quote footnote-definition)) (goto-char (org-element-property :post-affiliated context)) (call-interactively (quote org-footnote-action))) ((eql type (quote footnote-reference)) (call-interactively (quote org-footnote-action))) ((memql type (quote (headline inlinetask))) (save-excursion (goto-char (org-element-property :begin context)) (call-interactively (quote org-set-tags)))) ((eql type (quote item)) (let* ((box (org-element-property :checkbox context)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (parents (org-list-parents-alist struct)) (prevs (org-list-prevs-alist struct)) (orderedp (org-not-nil (org-entry-get nil "ORDERED")))) (org-list-set-checkbox (org-element-property :begin context) struct (cond ((equal arg ...) "[-]") ((and ... ...) "[ ]") ((or ... ...) nil) ((eq box ...) "[ ]") (t "[X]"))) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ((block-item (org-list-struct-fix-box struct parents prevs orderedp))) (if (and box (equal struct old-struct)) (if (equal arg ...) (message "Checkboxes already reset") (user-error "Cannot toggle this checkbox: %s" ...)) (org-list-struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe)) (if block-item (progn (message "Checkboxes were removed due to empty box at line %d" ...)))))) ((eql type (quote keyword)) (let ((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil)) (if (boundp (quote org-table-coordinate-overlays)) (progn (mapc (quote delete-overlay) org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil))) (let ((--data (org-outline-overlay-data ...)) --rtn) (unwind-protect (progn (setq --rtn ...) (org-set-outline-overlay-data --data)) (if (quote use-markers) (progn ...))) --rtn)) (message "Local setup has been refreshed")) ((eql type (quote plain-list)) (let* ((begin (org-element-property :contents-begin context)) (beginm (move-marker (make-marker) begin)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (first-box (save-excursion (goto-char begin) (looking-at org-list-full-item-re) (match-string-no-properties 3))) (new-box (cond (... "[-]") (... ...) (... "[ ]") (t "[X]")))) (cond (arg (mapc (function ...) (org-list-get-all-items begin struct ...))) ((and first-box (eq ... begin)) (org-list-set-checkbox begin struct new-box))) (org-list-write-struct struct (org-list-parents-alist struct) old-struct) (org-update-checkbox-count-maybe) (save-excursion (goto-char beginm) (org-list-send-list (quote maybe))))) ((memql type (quote (property-drawer node-property))) (call-interactively (quote org-property-action))) ((memql type (quote (radio-target target))) (call-interactively (quote org-update-radio-target-regexp))) ((eql type (quote statistics-cookie)) (call-interactively (quote org-update-statistics-cookies))) ((memql type (quote (table table-cell table-row))) (if (eq (org-element-property :type context) (quote table\.el)) (message "Use C-c ' to edit table.el tables") (let ((org-enable-table-editor t)) (if (or (eq type ...) (and ... ...)) (save-excursion (if ... ... ... ... ...)) (org-table-maybe-eval-formula) (cond (arg ...) (...) (t ...)))))) ((eql type (quote timestamp)) (org-timestamp-change 0 (quote day))) (t (or (run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-final-hook)) (user-error "C-c C-c can do nothing useful at this location")))))
  (if (save-excursion (beginning-of-line) (looking-at "[ 	]*$")) (or (run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-final-hook)) (user-error "C-c C-c can do nothing useful at this location")) (let* ((context (org-element-context)) (type (org-element-type context))) (cond ((eql type (quote link)) (setq context (org-element-property :parent context)) (setq type (org-element-type context))) ((memql type (quote (bold code entity export-snippet inline-babel-call inline-src-block italic latex-fragment line-break macro strike-through subscript superscript underline verbatim))) (setq context (org-element-lineage context (quote (radio-target paragraph verse-block table-cell)))))) (if (eq type (quote paragraph)) (progn (let ((parent (org-element-property :parent context))) (if (and (eq ... ...) (= ... ...)) (progn (setq context parent type ...)))))) (cond ((eql type (quote clock)) (org-clock-update-time-maybe)) ((eql type (quote dynamic-block)) (save-excursion (goto-char (org-element-property :post-affiliated context)) (org-update-dblock))) ((eql type (quote footnote-definition)) (goto-char (org-element-property :post-affiliated context)) (call-interactively (quote org-footnote-action))) ((eql type (quote footnote-reference)) (call-interactively (quote org-footnote-action))) ((memql type (quote (headline inlinetask))) (save-excursion (goto-char (org-element-property :begin context)) (call-interactively (quote org-set-tags)))) ((eql type (quote item)) (let* ((box (org-element-property :checkbox context)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (parents (org-list-parents-alist struct)) (prevs (org-list-prevs-alist struct)) (orderedp (org-not-nil ...))) (org-list-set-checkbox (org-element-property :begin context) struct (cond (... "[-]") (... "[ ]") (... nil) (... "[ ]") (t "[X]"))) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ((block-item ...)) (if (and box ...) (if ... ... ...) (org-list-struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe)) (if block-item (progn ...))))) ((eql type (quote keyword)) (let ((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil)) (if (boundp (quote org-table-coordinate-overlays)) (progn (mapc ... org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil))) (let ((--data ...) --rtn) (unwind-protect (progn ... ...) (if ... ...)) --rtn)) (message "Local setup has been refreshed")) ((eql type (quote plain-list)) (let* ((begin (org-element-property :contents-begin context)) (beginm (move-marker ... begin)) (struct (org-element-property :structure context)) (old-struct (copy-tree struct)) (first-box (save-excursion ... ... ...)) (new-box (cond ... ... ... ...))) (cond (arg (mapc ... ...)) ((and first-box ...) (org-list-set-checkbox begin struct new-box))) (org-list-write-struct struct (org-list-parents-alist struct) old-struct) (org-update-checkbox-count-maybe) (save-excursion (goto-char beginm) (org-list-send-list (quote maybe))))) ((memql type (quote (property-drawer node-property))) (call-interactively (quote org-property-action))) ((memql type (quote (radio-target target))) (call-interactively (quote org-update-radio-target-regexp))) ((eql type (quote statistics-cookie)) (call-interactively (quote org-update-statistics-cookies))) ((memql type (quote (table table-cell table-row))) (if (eq (org-element-property :type context) (quote table\.el)) (message "Use C-c ' to edit table.el tables") (let ((org-enable-table-editor t)) (if (or ... ...) (save-excursion ...) (org-table-maybe-eval-formula) (cond ... ... ...))))) ((eql type (quote timestamp)) (org-timestamp-change 0 (quote day))) (t (or (run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-final-hook)) (user-error "C-c C-c can do nothing useful at this location"))))))
  (cond ((or (and (boundp (quote org-clock-overlays)) org-clock-overlays) org-occur-highlights) (and (boundp (quote org-clock-overlays)) (org-clock-remove-overlays)) (org-remove-occur-highlights) (message "Temporary highlights/overlays removed from current buffer")) ((and (local-variable-p (quote org-finish-function) (current-buffer)) (fboundp org-finish-function)) (funcall org-finish-function)) ((run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-hook))) (t (if (save-excursion (beginning-of-line) (looking-at "[ 	]*$")) (or (run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-final-hook)) (user-error "C-c C-c can do nothing useful at this location")) (let* ((context (org-element-context)) (type (org-element-type context))) (cond ((eql type (quote link)) (setq context (org-element-property :parent context)) (setq type (org-element-type context))) ((memql type (quote ...)) (setq context (org-element-lineage context ...)))) (if (eq type (quote paragraph)) (progn (let (...) (if ... ...)))) (cond ((eql type (quote clock)) (org-clock-update-time-maybe)) ((eql type (quote dynamic-block)) (save-excursion (goto-char ...) (org-update-dblock))) ((eql type (quote footnote-definition)) (goto-char (org-element-property :post-affiliated context)) (call-interactively (quote org-footnote-action))) ((eql type (quote footnote-reference)) (call-interactively (quote org-footnote-action))) ((memql type (quote ...)) (save-excursion (goto-char ...) (call-interactively ...))) ((eql type (quote item)) (let* (... ... ... ... ... ...) (org-list-set-checkbox ... struct ...) (org-list-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents) (let ... ... ...))) ((eql type (quote keyword)) (let (... ...) (if ... ...) (let ... ... --rtn)) (message "Local setup has been refreshed")) ((eql type (quote plain-list)) (let* (... ... ... ... ... ...) (cond ... ...) (org-list-write-struct struct ... old-struct) (org-update-checkbox-count-maybe) (save-excursion ... ...))) ((memql type (quote ...)) (call-interactively (quote org-property-action))) ((memql type (quote ...)) (call-interactively (quote org-update-radio-target-regexp))) ((eql type (quote statistics-cookie)) (call-interactively (quote org-update-statistics-cookies))) ((memql type (quote ...)) (if (eq ... ...) (message "Use C-c ' to edit table.el tables") (let ... ...))) ((eql type (quote timestamp)) (org-timestamp-change 0 (quote day))) (t (or (run-hook-with-args-until-success ...) (user-error "C-c C-c can do nothing useful at this location"))))))))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 11:22 [bug] TODO [/] cookie not updating if list has inline task Eric S Fraga
@ 2015-05-17 13:08 ` Eric S Fraga
  2015-05-17 13:23   ` Eric S Fraga
  2015-05-17 13:51 ` Rasmus
  1 sibling, 1 reply; 17+ messages in thread
From: Eric S Fraga @ 2015-05-17 13:08 UTC (permalink / raw)
  To: emacs-orgmode

Please ignore my bug report for the moment.  org works if I don't invoke
any of my customisations.  I have obviously set something that makes the
updating of the cookie fail.  Not sure what, mind you... Any suggestions
welcome, of course.

Sorry for the noise.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1147-g0e5069

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 13:08 ` Eric S Fraga
@ 2015-05-17 13:23   ` Eric S Fraga
  2015-05-17 13:32     ` Rasmus
  0 siblings, 1 reply; 17+ messages in thread
From: Eric S Fraga @ 2015-05-17 13:23 UTC (permalink / raw)
  To: emacs-orgmode

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

Mind you, having played around with emacs -Q and my test file, I have
run into another bug.  If I specify org-indent in the startup options, I
get a very strange indentation.  See attached screenshot.  I wonder if
this is related to my problem?

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1147-g0e5069

[-- Attachment #2: screendump-20150517142117.png --]
[-- Type: image/png, Size: 25344 bytes --]

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 13:23   ` Eric S Fraga
@ 2015-05-17 13:32     ` Rasmus
  0 siblings, 0 replies; 17+ messages in thread
From: Rasmus @ 2015-05-17 13:32 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Mind you, having played around with emacs -Q and my test file, I have
> run into another bug.  If I specify org-indent in the startup options, I
> get a very strange indentation.  See attached screenshot.  I wonder if
> this is related to my problem?

Probably 'cause you havne't loaded org-inlinetask.  Or you toggled
org-indent-mode before.  Perhaps org-inlinetasks should be "intelligently"
loaded if it seems like an inlinetaks is present.

-- 
Sådan en god dansk lagereddike kan man slet ikke bruge mere

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 11:22 [bug] TODO [/] cookie not updating if list has inline task Eric S Fraga
  2015-05-17 13:08 ` Eric S Fraga
@ 2015-05-17 13:51 ` Rasmus
  2015-05-17 18:26   ` Eric S Fraga
                     ` (2 more replies)
  1 sibling, 3 replies; 17+ messages in thread
From: Rasmus @ 2015-05-17 13:51 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi Eric,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I often use checkbox lists for particular tasks.  If any of the list
> items has an inline task (whether a task or not), the updating of the
> [/] cookie in the headline does not work.  Attached is an example.
>
> Backtrace is also attached.

Thanks.

Can you try the attached patch?  It seems to work on my system, but
probably more cleanup should be made wrt the "old" outline-functions.

—Rasmus

-- 
This space is left intentionally blank

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0004-Fix-cookie-counter-bug.patch --]
[-- Type: text/x-diff, Size: 2792 bytes --]

From 965aa17b30fd511fbd2f4415104878c52c245550 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
Date: Sun, 17 May 2015 15:48:40 +0200
Subject: [PATCH 4/4] Fix cookie counter bug

* org.el (org-update-statistics-cookies):
* org-list.el (org-update-checkbox-count): Do not use
  outline-next-heading.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/97594>
---
 lisp/org-list.el | 12 ++++++++----
 lisp/org.el      |  8 ++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/lisp/org-list.el b/lisp/org-list.el
index d18dff1..4950e05 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -2476,7 +2476,9 @@ With optional prefix argument ALL, do this for the whole buffer."
 		      (cons (point-min) (point-max))
 		    (cons (or (ignore-errors (org-back-to-heading t) (point))
 			      (point-min))
-			  (save-excursion (outline-next-heading) (point)))))
+			  (org-with-wide-buffer
+			   (org-next-visible-heading 1)
+			   (point)))))
 	  (count-boxes
 	   (function
 	    ;; Return number of checked boxes and boxes of all types
@@ -2534,15 +2536,17 @@ With optional prefix argument ALL, do this for the whole buffer."
 	       ;; in STRUCTS-BAK.  This should only happen when
 	       ;; heading has more than one cookie on it.
 	       ((and (org-at-heading-p)
-		     (<= (save-excursion (outline-next-heading) (point))
+		     (<= (org-with-wide-buffer (org-next-visible-heading 1)
+					       (point))
 			 backup-end))
 		(funcall count-boxes nil structs-bak recursivep))
 	       ;; Cookie is at a fresh heading.  Grab structure of
 	       ;; every list containing a checkbox between point and
 	       ;; next headline, and save them in STRUCTS-BAK.
 	       ((org-at-heading-p)
-		(setq backup-end (save-excursion
-				   (outline-next-heading) (point))
+		(setq backup-end (org-with-wide-buffer
+				  (org-next-visible-heading 1)
+				  (point))
 		      structs-bak nil)
 		(while (org-list-search-forward box-re backup-end 'move)
 		  (let* ((struct (org-list-struct))
diff --git a/lisp/org.el b/lisp/org.el
index 0c3e61c..996b9d6 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12867,10 +12867,10 @@ This should be called with the cursor in a line with a statistics cookie."
 	(if (not (org-at-heading-p))
 	    (org-update-checkbox-count)
 	  (setq l1 (org-outline-level))
-	  (setq end (save-excursion
-		      (outline-next-heading)
-		      (if (org-at-heading-p) (setq l2 (org-outline-level)))
-		      (point)))
+	  (setq end (org-with-wide-buffer
+		     (org-next-visible-heading 1)
+		     (if (org-at-heading-p) (setq l2 (org-outline-level)))
+		     (point)))
 	  (if (and (save-excursion
 		     (re-search-forward
 		      "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t))
-- 
2.4.1


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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 13:51 ` Rasmus
@ 2015-05-17 18:26   ` Eric S Fraga
  2015-05-17 18:27   ` Eric S Fraga
  2015-05-17 18:51   ` Nicolas Goaziou
  2 siblings, 0 replies; 17+ messages in thread
From: Eric S Fraga @ 2015-05-17 18:26 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

On Sunday, 17 May 2015 at 15:51, Rasmus wrote:
> Hi Eric,

[...]

> Can you try the attached patch?  It seems to work on my system, but
> probably more cleanup should be made wrt the "old" outline-functions.

Hi Rasmus,

your patch eems to work just fine.  I haven't done exhaustive testing
but no error is encountered and the count is updated correctly.

Thanks!

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1147-g0e5069

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 13:51 ` Rasmus
  2015-05-17 18:26   ` Eric S Fraga
@ 2015-05-17 18:27   ` Eric S Fraga
  2015-05-17 18:51   ` Nicolas Goaziou
  2 siblings, 0 replies; 17+ messages in thread
From: Eric S Fraga @ 2015-05-17 18:27 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

"eems" --> "seems"

(must learn to read my emails before I C-c C-c... ;-)
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1147-g0e5069

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 13:51 ` Rasmus
  2015-05-17 18:26   ` Eric S Fraga
  2015-05-17 18:27   ` Eric S Fraga
@ 2015-05-17 18:51   ` Nicolas Goaziou
  2015-05-17 19:02     ` Rasmus
  2015-05-17 19:28     ` Eric S Fraga
  2 siblings, 2 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2015-05-17 18:51 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hello,

Rasmus <rasmus@gmx.us> writes:

> Can you try the attached patch?  It seems to work on my system, but
> probably more cleanup should be made wrt the "old" outline-functions.
> +			  (org-with-wide-buffer
> +			   (org-next-visible-heading 1)
> +			   (point)))))

You shouldn't use `org-next-visible-heading' as statistics cookie
updates shouldn't depend on current visibility. Also, the problem is
more subtle: you have to check if you're within an inlinetask, in which
case you don't want to use `org-with-limited-levels' or not.

Anyway, we could fix it in another way. Eric's example,

  - [ ] the first task
    
  *************** This is something to note
  *************** END

  - [ ] another list of tasks

is misleading because it's really the same list, i.e., inlinetasks are
allowed in items, so "This is something to note" belongs to "the first
task".

So, our option is to simply dis-allow inlinetasks in plain lists. That
would also solve the issue.

WDYT?


Regards,

-- 
Nicolas Goaziou

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 18:51   ` Nicolas Goaziou
@ 2015-05-17 19:02     ` Rasmus
  2015-05-17 21:56       ` Nicolas Goaziou
  2015-05-17 19:28     ` Eric S Fraga
  1 sibling, 1 reply; 17+ messages in thread
From: Rasmus @ 2015-05-17 19:02 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Rasmus <rasmus@gmx.us> writes:
>
>> Can you try the attached patch?  It seems to work on my system, but
>> probably more cleanup should be made wrt the "old" outline-functions.
>> +			  (org-with-wide-buffer
>> +			   (org-next-visible-heading 1)
>> +			   (point)))))
>
> You shouldn't use `org-next-visible-heading' as statistics cookie
> updates shouldn't depend on current visibility.

That's why I used org-with-wide-buffer.  But perhaps a better solution
would be an org-next-heading or whatever, that considered inlinetasks.

> Also, the problem is more subtle: you have to check if you're within an
> inlinetask, in which case you don't want to use
> `org-with-limited-levels' or not.

Is that saying that org-with-wide-buffer is no good here?

> Anyway, we could fix it in another way. Eric's example,
>
>   - [ ] the first task
>     
>   *************** This is something to note
>   *************** END
>
>   - [ ] another list of tasks
>
> is misleading because it's really the same list, i.e., inlinetasks are
> allowed in items, so "This is something to note" belongs to "the first
> task".
>
> So, our option is to simply dis-allow inlinetasks in plain lists. That
> would also solve the issue.

It solves the problem, unless Eric wants inlinetasks in his list.  The
"solution" in my other patch recognized both checkboxes.

> WDYT?

I haven't needed inlinetasks in lists.  So I don't care much.  Better wait
for Eric's opinion.

—Rasmus

-- 
I feel emotional landscapes they puzzle me

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 18:51   ` Nicolas Goaziou
  2015-05-17 19:02     ` Rasmus
@ 2015-05-17 19:28     ` Eric S Fraga
  2015-05-17 19:44       ` Rasmus
  1 sibling, 1 reply; 17+ messages in thread
From: Eric S Fraga @ 2015-05-17 19:28 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

On Sunday, 17 May 2015 at 20:51, Nicolas Goaziou wrote:

[...]

> Anyway, we could fix it in another way. Eric's example,
>
>   - [ ] the first task
>     
>   *************** This is something to note
>   *************** END
>
>   - [ ] another list of tasks
>
> is misleading because it's really the same list, i.e., inlinetasks are
> allowed in items, so "This is something to note" belongs to "the first
> task".

I'm not sure I understand what is misleading about the above?  The note
is indeed intended to belong to the first item on the list.

> So, our option is to simply dis-allow inlinetasks in plain lists. That
> would also solve the issue.

I wouldn't be too keen on this option at the moment.  I use inline tasks
in lists all the time.

However, we are starting to see that inline tasks are indeed a bit of
kludge and impact on org structures significantly so maybe we can remove
this capability once inline annotations, as discussed in another thread,
are implemented?

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-1147-g0e5069

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 19:28     ` Eric S Fraga
@ 2015-05-17 19:44       ` Rasmus
  2015-05-17 22:05         ` Nicolas Goaziou
  2015-05-18  8:16         ` Eric S Fraga
  0 siblings, 2 replies; 17+ messages in thread
From: Rasmus @ 2015-05-17 19:44 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I'm not sure I understand what is misleading about the above?  The note
> is indeed intended to belong to the first item on the list.

The misleading part, IMO, is that it is not obvious whether the
inlinetasks belong to the list item or not.  Normally something that
belong to the item in indented, which is not possible here.

> However, we are starting to see that inline tasks are indeed a bit of
> kludge and impact on org structures significantly so maybe we can remove
> this capability once inline annotations, as discussed in another thread,
> are implemented?

FWIW, I did not like the syntax Nicolas suggested in that thread.  It
reminded me too much of *XML (which is also true with inlinetasks BTW).
[I, did, however, only add a star to the thread rather than replying].

—Rasmus

-- 
I hear there's rumors on the, uh, Internets. . .

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 19:02     ` Rasmus
@ 2015-05-17 21:56       ` Nicolas Goaziou
  2015-05-20  8:26         ` e.fraga
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-05-17 21:56 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

>> You shouldn't use `org-next-visible-heading' as statistics cookie
>> updates shouldn't depend on current visibility.
>
> That's why I used org-with-wide-buffer.

This is orthogonal. `o-w-w-b' is about narrowing. `o-n-v-h' ignores
inlinetasks.

> But perhaps a better solution would be an org-next-heading or
> whatever, that considered inlinetasks.

I'm not sure what you mean. `outline-next-heading'?

>> Also, the problem is more subtle: you have to check if you're within an
>> inlinetask, in which case you don't want to use
>> `org-with-limited-levels' or not.
>
> Is that saying that org-with-wide-buffer is no good here?

I'm saying `org-next-visible-heading', or, more precisely,
`org-with-limited-levels' is no good here. See `org-get-property-block'
for an example.


Regards,

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 19:44       ` Rasmus
@ 2015-05-17 22:05         ` Nicolas Goaziou
  2015-05-18  8:16         ` Eric S Fraga
  1 sibling, 0 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2015-05-17 22:05 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> FWIW, I did not like the syntax Nicolas suggested in that thread.  It
> reminded me too much of *XML (which is also true with inlinetasks
> BTW).

Well, that's sad. It brings interesting features you cannot have with
link-like syntax.


Regards,

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 19:44       ` Rasmus
  2015-05-17 22:05         ` Nicolas Goaziou
@ 2015-05-18  8:16         ` Eric S Fraga
  1 sibling, 0 replies; 17+ messages in thread
From: Eric S Fraga @ 2015-05-18  8:16 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

On Sunday, 17 May 2015 at 21:44, Rasmus wrote:
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> I'm not sure I understand what is misleading about the above?  The note
>> is indeed intended to belong to the first item on the list.
>
> The misleading part, IMO, is that it is not obvious whether the
> inlinetasks belong to the list item or not.  Normally something that
> belong to the item in indented, which is not possible here.

I guess, for me, the "inline" part of the name indicates that this
element is always part of the surrounding element?  Of course, this
doesn't mean the parser treats it as such and it looks like it doesn't.

>> However, we are starting to see that inline tasks are indeed a bit of
>> kludge and impact on org structures significantly so maybe we can remove
>> this capability once inline annotations, as discussed in another thread,
>> are implemented?
>
> FWIW, I did not like the syntax Nicolas suggested in that thread.  It
> reminded me too much of *XML (which is also true with inlinetasks BTW).
> [I, did, however, only add a star to the thread rather than replying].

I'm not too bothered with the syntax.  I can get used to (almost)
anything.  However, as I and others have commented in the inline
annotations thread, there is some worry about the syntax become too
overbearing in the attempt to have it do too much.

Back to inline tasks in lists, for the checkbox use case, I can easily
use special environments instead of inline tasks.  In general, however,
I would still like to be able to use inline tasks within lists.

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-1136-g0e7062

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-17 21:56       ` Nicolas Goaziou
@ 2015-05-20  8:26         ` e.fraga
  2015-06-09 15:09           ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: e.fraga @ 2015-05-20  8:26 UTC (permalink / raw)
  To: emacs-orgmode

Hello again,

coming back to my original problem: is there a consensus on how inline
tasks should be treated within lists?  Inline means to me that they
should not break up a list... but I would like this resolved if
possible.

For the moment, Rasmus's patch works for me...

Thanks,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-790-gb719c1.dirty

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-05-20  8:26         ` e.fraga
@ 2015-06-09 15:09           ` Nicolas Goaziou
  2015-06-11 14:40             ` e.fraga
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-06-09 15:09 UTC (permalink / raw)
  To: emacs-orgmode

<e.fraga@ucl.ac.uk> writes:

> coming back to my original problem: is there a consensus on how inline
> tasks should be treated within lists?  Inline means to me that they
> should not break up a list... but I would like this resolved if
> possible.

Fixed in a4cc9d82d8069741be64c55f35f9d3ad7e2663d5. Thank you.

Regards,

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

* Re: [bug] TODO [/] cookie not updating if list has inline task
  2015-06-09 15:09           ` Nicolas Goaziou
@ 2015-06-11 14:40             ` e.fraga
  0 siblings, 0 replies; 17+ messages in thread
From: e.fraga @ 2015-06-11 14:40 UTC (permalink / raw)
  To: emacs-orgmode

On Tuesday,  9 Jun 2015 at 17:09, Nicolas Goaziou wrote:
> <e.fraga@ucl.ac.uk> writes:
>
>> coming back to my original problem: is there a consensus on how
>> inline
>> tasks should be treated within lists?  Inline means to me that they
>> should not break up a list... but I would like this resolved if
>> possible.
>
> Fixed in a4cc9d82d8069741be64c55f35f9d3ad7e2663d5. Thank you.

and thanks again!
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-802-g7e4228.dirty

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

end of thread, other threads:[~2015-06-11 14:41 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-17 11:22 [bug] TODO [/] cookie not updating if list has inline task Eric S Fraga
2015-05-17 13:08 ` Eric S Fraga
2015-05-17 13:23   ` Eric S Fraga
2015-05-17 13:32     ` Rasmus
2015-05-17 13:51 ` Rasmus
2015-05-17 18:26   ` Eric S Fraga
2015-05-17 18:27   ` Eric S Fraga
2015-05-17 18:51   ` Nicolas Goaziou
2015-05-17 19:02     ` Rasmus
2015-05-17 21:56       ` Nicolas Goaziou
2015-05-20  8:26         ` e.fraga
2015-06-09 15:09           ` Nicolas Goaziou
2015-06-11 14:40             ` e.fraga
2015-05-17 19:28     ` Eric S Fraga
2015-05-17 19:44       ` Rasmus
2015-05-17 22:05         ` Nicolas Goaziou
2015-05-18  8:16         ` Eric S Fraga

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