Re: [O] [PATCH] org.el: fix org--get-outline-path-1

2016-02-29 Thread Tobias Getzner
Nicolas Goaziou  writes:

> Tobias Getzner  writes:
>
>> Headline titles may be empty, in which case the respective match group
>> will be nil. This would throw an error when trying to regexp-replace
>> checkbox cookies.
>
> Indeed. Thank you for the report. I applied a slightly different fix,
> tho.

Thanks for fixing!

>> TODO: Depending on preference, a place-holder string might be a better
>> choice (for user-display) rather than leaving the outline-path element
>> empty.
>
> This makes sense. Maybe something like "[Empty]". WDYT?

[Empty] seems good to me.

Regards,
Tobias



Re: [O] [PATCH] org.el: fix org--get-outline-path-1

2016-02-29 Thread Nicolas Goaziou
Hello,

Tobias Getzner  writes:

> Headline titles may be empty, in which case the respective match group
> will be nil. This would throw an error when trying to regexp-replace
> checkbox cookies.

Indeed. Thank you for the report. I applied a slightly different fix,
tho.

> TODO: Depending on preference, a place-holder string might be a better
> choice (for user-display) rather than leaving the outline-path element
> empty.

This makes sense. Maybe something like "[Empty]". WDYT?


Regards,

-- 
Nicolas Goaziou



[O] [PATCH] org.el: fix org--get-outline-path-1

2016-02-29 Thread Tobias Getzner
Headline titles may be empty, in which case the respective match group
will be nil. This would throw an error when trying to regexp-replace
checkbox cookies.

TODO: Depending on preference, a place-holder string might be a better
choice (for user-display) rather than leaving the outline-path element empty.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 3e2f1c1..f45b9fc 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11611,7 +11611,7 @@ (defun org--get-outline-path-1 ( use-cache)
 ;; Remove statistical/checkboxes cookies.
 (replace-regexp-in-string
  "\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" ""
- (org-match-string-no-properties 4))
+ (or (org-match-string-no-properties 4) ""))
(if (org-up-heading-safe)
(let ((path (cons heading (org--get-outline-path-1 use-cache
  (when use-cache
-- 
2.7.2