Re: [O] Regression in Org triggered from helm

2015-10-31 Thread Kyle Meyer
Kyle Meyer  writes:

> Simon Thum  writes:
>
>> I was a bit early; I am getting this error now:
>>
>> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>>   replace-regexp-in-string("[]+\\'" "" nil)
>>   (lambda (s) (replace-regexp-in-string "[   ]+\\'" "" s))(nil)
>>   mapconcat((lambda (s) (replace-regexp-in-string "[ ]+\\'" "" s))
>> (#("Aktionen" 0 8 (face org-level-1)) #("Stellensuche" 0 12 (face
>> org-level-2)) #("Kandidaten" 0 10 (face org-level-3)) nil) "/")
>>
>>
>> I bet it's my habit of putting slashes into headlines which breaks the
>> logic. However it worked before.
>
> I can reproduce this with a buffer containing an empty heading.
> (Slashes should work fine.)
>
> org-format-outline-path takes a list of strings for path elements.  It
> handles an empty list fine, but helm-get-org-candidates-in-file is
> passing it (nil).  I'll update org-format-outline-path to discard nil
> path elements, but I should also probably submit a patch to helm to make
> it ignore empty headers rather than passing a non-string list.

This error should be fixed as of 59d7062.

--
Kyle



Re: [O] Regression in Org triggered from helm

2015-10-30 Thread Simon Thum

Thank you, works like a charm!

On 10/28/15 13:34, Nicolas Goaziou wrote:

Hello,

Kyle Meyer  writes:


Fixed with 1c74002.  Thanks for reporting the issue.


Thank you for the patch, and the tests.


Regards,





Re: [O] Regression in Org triggered from helm

2015-10-30 Thread Simon Thum

I was a bit early; I am getting this error now:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("[  ]+\\'" "" nil)
  (lambda (s) (replace-regexp-in-string "[ ]+\\'" "" s))(nil)
  mapconcat((lambda (s) (replace-regexp-in-string "[ 	]+\\'" "" s)) 
(#("Aktionen" 0 8 (face org-level-1)) #("Stellensuche" 0 12 (face 
org-level-2)) #("Kandidaten" 0 10 (face org-level-3)) nil) "/")



I bet it's my habit of putting slashes into headlines which breaks the 
logic. However it worked before.


Cheers,

Simon

On 10/28/15 13:34, Nicolas Goaziou wrote:

Hello,

Kyle Meyer  writes:


Fixed with 1c74002.  Thanks for reporting the issue.


Thank you for the patch, and the tests.


Regards,





Re: [O] Regression in Org triggered from helm

2015-10-30 Thread Kyle Meyer
Simon Thum  writes:

> I was a bit early; I am getting this error now:
>
> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>   replace-regexp-in-string("[ ]+\\'" "" nil)
>   (lambda (s) (replace-regexp-in-string "[]+\\'" "" s))(nil)
>   mapconcat((lambda (s) (replace-regexp-in-string "[  ]+\\'" "" s))
> (#("Aktionen" 0 8 (face org-level-1)) #("Stellensuche" 0 12 (face
> org-level-2)) #("Kandidaten" 0 10 (face org-level-3)) nil) "/")
>
>
> I bet it's my habit of putting slashes into headlines which breaks the
> logic. However it worked before.

I can reproduce this with a buffer containing an empty heading.
(Slashes should work fine.)

org-format-outline-path takes a list of strings for path elements.  It
handles an empty list fine, but helm-get-org-candidates-in-file is
passing it (nil).  I'll update org-format-outline-path to discard nil
path elements, but I should also probably submit a patch to helm to make
it ignore empty headers rather than passing a non-string list.

Thanks.

--
Kyle



Re: [O] Regression in Org triggered from helm

2015-10-28 Thread Nicolas Goaziou
Hello,

Kyle Meyer  writes:

> Fixed with 1c74002.  Thanks for reporting the issue.

Thank you for the patch, and the tests.


Regards,

-- 
Nicolas Goaziou



Re: [O] Regression in Org triggered from helm

2015-10-28 Thread Kyle Meyer
Kyle Meyer  writes:

> Simon Thum  writes:
>
> [...]
>
>> Arrgh - you're on the spot. That explains a lot, including my
>> difficulties with reproducing.
>>
>> It sends window-width. Increase to window(-width) and I'm done.
>>
>> But that means it's arguably Org which should be more graceful than it
>> is.
>
> I agree.  At some point, if window-width is returning a small enough
> value or if PREFIX is too long, the results of org-format-outline-path
> will be truncated to the point of being useless, but
> org-format-outline-path shouldn't choke.
>
> I'll fix it up and add some tests.

Fixed with 1c74002.  Thanks for reporting the issue.

-- 
Kyle



Re: [O] Regression in Org triggered from helm

2015-10-26 Thread Kyle Meyer
Simon Thum  writes:

[...]

> Arrgh - you're on the spot. That explains a lot, including my
> difficulties with reproducing.
>
> It sends window-width. Increase to window(-width) and I'm done.
>
> But that means it's arguably Org which should be more graceful than it
> is.

I agree.  At some point, if window-width is returning a small enough
value or if PREFIX is too long, the results of org-format-outline-path
will be truncated to the point of being useless, but
org-format-outline-path shouldn't choke.

I'll fix it up and add some tests.

--
Kyle



[O] Regression in Org triggered from helm

2015-10-26 Thread Simon Thum

Hi,

after updating helm I came across a possible regression on Org. I 
Already filed a helm bug, but Thierry thinks it's Org's fault.


https://github.com/emacs-helm/helm/issues/1246

In short, M-x helm-org-agenda-files-headings breaks.

I had some success working around it, but for reasons beyond me that 
doesn't work any more. I'll try to work out a MCE but for the time in 
between, maybe someone has an idea what's wrong, and where (org or helm)?


Here is the complete stacktrace (the -my function is textually 
equivalent to its non-my counterpart in helm-org):



Debugger entered--Lisp error: (args-out-of-range "LoD" 0 -3)
  substring("LoD" 0 -6)
  (setq h (substring h 0 (- maxwidth 2)) total (+ total maxwidth 1))
  (if (< (length h) maxwidth) (progn (setq total (+ total (length h) 
1)) h) (setq h (substring h 0 (- maxwidth 2)) total (+ total maxwidth 
1)) (if (string-match "[ 	]+\\'" h) (setq h (substring h 0 
(match-beginning 0 (setq h (concat h "..")))
  (lambda (h) (setq n (1+ n)) (if (and (= n nsteps) (< maxwidth 1)) 
(setq maxwidth (- total-width total))) (if (< (length h) maxwidth) 
(progn (setq total (+ total (length h) 1)) h) (setq h (substring h 0 (- 
maxwidth 2)) total (+ total maxwidth 1)) (if (string-match "[ 	]+\\'" h) 
(setq h (substring h 0 (match-beginning 0 (setq h (concat h ".."))) 
(org-add-props h nil (quote face) (nth (% (1- n) org-n-level-faces) 
org-level-faces)) h)("LoD")
  mapconcat((lambda (h) (setq n (1+ n)) (if (and (= n nsteps) (< 
maxwidth 1)) (setq maxwidth (- total-width total))) (if (< (length 
h) maxwidth) (progn (setq total (+ total (length h) 1)) h) (setq h 
(substring h 0 (- maxwidth 2)) total (+ total maxwidth 1)) (if 
(string-match "[ 	]+\\'" h) (setq h (substring h 0 (match-beginning 
0 (setq h (concat h ".."))) (org-add-props h nil (quote face) (nth 
(% (1- n) org-n-level-faces) org-level-faces)) h) (#("CityServer3D" 0 12 
(face org-level-1)) #("Archive" 0 7 (face org-level-2)) #("Portrayal" 0 
9 (face org-level-3)) #("Konzeption" 0 10 (face org-level-4)) 
#("Symbolizer" 0 10 (face org-level-5)) "Einsatzgebiete" "LoD") "/")
  (concat prefix (if prefix (or separator "/")) (mapconcat (function 
(lambda (h) (setq n (1+ n)) (if (and (= n nsteps) (< maxwidth 1)) 
(setq maxwidth (- total-width total))) (if (< (length h) maxwidth) 
(progn (setq total (+ total ... 1)) h) (setq h (substring h 0 (- 
maxwidth 2)) total (+ total maxwidth 1)) (if (string-match "[ 	]+\\'" h) 
(setq h (substring h 0 ...))) (setq h (concat h ".."))) (org-add-props h 
nil (quote face) (nth (% (1- n) org-n-level-faces) org-level-faces)) h)) 
path (or separator "/")))
  (let* ((nsteps (length path)) (total-width (+ nsteps (apply (quote +) 
(mapcar (quote length) path (maxwidth (if (<= total-width width) 
1 (/ (- width nsteps) nsteps))) (org-odd-levels-only nil) (n 0) 
(total (1+ (length prefix (setq maxwidth (max maxwidth 10)) (concat 
prefix (if prefix (or separator "/")) (mapconcat (function (lambda (h) 
(setq n (1+ n)) (if (and (= n nsteps) (< maxwidth 1)) (setq maxwidth 
(- total-width total))) (if (< (length h) maxwidth) (progn (setq total 
...) h) (setq h (substring h 0 ...) total (+ total maxwidth 1)) (if 
(string-match "[ 	]+\\'" h) (setq h ...)) (setq h (concat h ".."))) 
(org-add-props h nil (quote face) (nth (% ... org-n-level-faces) 
org-level-faces)) h)) path (or separator "/"
  (if (not path) (or prefix "") (let* ((nsteps (length path)) 
(total-width (+ nsteps (apply (quote +) (mapcar (quote length) path 
(maxwidth (if (<= total-width width) 1 (/ (- width nsteps) nsteps))) 
(org-odd-levels-only nil) (n 0) (total (1+ (length prefix (setq 
maxwidth (max maxwidth 10)) (concat prefix (if prefix (or separator 
"/")) (mapconcat (function (lambda (h) (setq n (1+ n)) (if (and ... ...) 
(setq maxwidth ...)) (if (< ... maxwidth) (progn ... h) (setq h ... 
total ...) (if ... ...) (setq h ...)) (org-add-props h nil (quote face) 
(nth ... org-level-faces)) h)) path (or separator "/")
  org-format-outline-path((#("CityServer3D" 0 12 (face org-level-1)) 
#("Archive" 0 7 (face org-level-2)) #("Portrayal" 0 9 (face 
org-level-3)) #("Konzeption" 0 10 (face org-level-4)) #("Symbolizer" 0 
10 (face org-level-5)) "Einsatzgebiete" "LoD") 80 "projects.org:")


helm-get-org-candidates-in-file("/home/simon/org/fraunhofer/projects.org" 1 
8 nil nil)
  #[257 "\304\300\301\n%\207" [1 8 helm-org-headings-fontify 
helm-org-headings--nofilename helm-get-org-candidates-in-file] 7 
"\n\n(fn FILENAME)"]("/home/simon/org/fraunhofer/projects.org")
  mapcar(#[257 "\304\300\301\n%\207" [1 8 helm-org-headings-fontify 
helm-org-headings--nofilename helm-get-org-candidates-in-file] 7 
"\n\n(fn FILENAME)"] ("/home/simon/org/org"))

  helm-org-get-candidates(("/home/simon/org/org") 1 8)
  helm-source-org-headings-for-files(("/home/simon/org/org"))
  helm-org-agenda-files-headings()
  call-interactively(helm-org-agenda-files-headings record nil)
  

Re: [O] Regression in Org triggered from helm

2015-10-26 Thread Simon Thum


On 10/26/15 20:58, Kyle Meyer wrote:

Hello,

Simon Thum  writes:


Hi,

after updating helm I came across a possible regression on Org. I
Already filed a helm bug, but Thierry thinks it's Org's fault.


What version of Org are you using?


Org-mode 8.3.2 - I just upgraded from 8.3 beta hoping to fix this.




https://github.com/emacs-helm/helm/issues/1246

In short, M-x helm-org-agenda-files-headings breaks.

I had some success working around it, but for reasons beyond me that
doesn't work any more. I'll try to work out a MCE but for the time in
between, maybe someone has an idea what's wrong, and where (org or
helm)?


I haven't had any luck reproducing this.  Isolating the error with a
minimal configuration and minimal Org file would be very helpful.


I know, but ATM my time is limited. I tried to debug but only got as far as

Edebug: edebug-anon74105
edebug-signal: Symbol's value as variable is void: Debugger

At which point I figured reporting the bug might be sensible enough.





Here is the complete stacktrace (the -my function is textually
equivalent to its non-my counterpart in helm-org):


Debugger entered--Lisp error: (args-out-of-range "LoD" 0 -3)
   substring("LoD" 0 -6)
   (setq h (substring h 0 (- maxwidth 2)) total (+ total maxwidth 1))


At some point, maxwidth is being set very low (-4 here).  Try to see
where this happens.  For example, what value for width does
helm-get-org-candidates-in-file send into org-format-outline-path?  If
that seems to be appropriate, debug org-format-outline-path and see when
it's getting set to the low value.


Arrgh - you're on the spot. That explains a lot, including my 
difficulties with reproducing.


It sends window-width. Increase to window(-width) and I'm done.

But that means it's arguably Org which should be more graceful than it 
is. Bastien, I cc'ed you as the maintainer, I guess you know who's best 
qualified to fix this.


Thanks for your input Kyle!

Cheers,

Simon   



Re: [O] Regression in Org triggered from helm

2015-10-26 Thread Kyle Meyer
Hello,

Simon Thum  writes:

> Hi,
>
> after updating helm I came across a possible regression on Org. I
> Already filed a helm bug, but Thierry thinks it's Org's fault.

What version of Org are you using?

> https://github.com/emacs-helm/helm/issues/1246
>
> In short, M-x helm-org-agenda-files-headings breaks.
>
> I had some success working around it, but for reasons beyond me that
> doesn't work any more. I'll try to work out a MCE but for the time in
> between, maybe someone has an idea what's wrong, and where (org or
> helm)?

I haven't had any luck reproducing this.  Isolating the error with a
minimal configuration and minimal Org file would be very helpful.

>
> Here is the complete stacktrace (the -my function is textually
> equivalent to its non-my counterpart in helm-org):
>
>
> Debugger entered--Lisp error: (args-out-of-range "LoD" 0 -3)
>   substring("LoD" 0 -6)
>   (setq h (substring h 0 (- maxwidth 2)) total (+ total maxwidth 1))

At some point, maxwidth is being set very low (-4 here).  Try to see
where this happens.  For example, what value for width does
helm-get-org-candidates-in-file send into org-format-outline-path?  If
that seems to be appropriate, debug org-format-outline-path and see when
it's getting set to the low value.

--
Kyle