Re: [BUG] HTML export of buffer with fringe indicators

2022-05-21 Thread Ihor Radchenko
Daniel Fleischer  writes:

> Ihor Radchenko [2022-05-20 Fri 16:36]  wrote:
>
>> I am unable to reproduce your problem on my side using the following
>> steps.
>
> Ok, thanks anyway. BTW, even the steps you took are useful for me for future 
> debugging. 

It is exactly the reason I listed the steps. So that you can also try on
your side.

If you cannot reproduce using my steps, there is a chance that the
problem is also caused by some other part of your config. In which case,
you can use https://github.com/Malabarba/elisp-bug-hunter to hunt down
the cause. Also, see
https://open.tube/videos/watch/4d819114-43bf-42df-af94-f94fc53dd0d9

Best,
Ihor



Re: [BUG] HTML export of buffer with fringe indicators

2022-05-21 Thread Daniel Fleischer
Ihor Radchenko [2022-05-20 Fri 16:36]  wrote:

> I am unable to reproduce your problem on my side using the following
> steps.

Ok, thanks anyway. BTW, even the steps you took are useful for me for future 
debugging. 

Best,

Daniel Fleischer


Re: [BUG] HTML export of buffer with fringe indicators

2022-05-20 Thread Ihor Radchenko
Daniel Fleischer  writes:

> Ihor Radchenko [2022-05-19 Thu 21:43] wrote:
>
>> What if you try to run M-: (htmlize-buffer) 
>> on your file?
>
> It works, creating an HTML buffer that can be opened and looks good. 

Then I have no more ideas.

I am unable to reproduce your problem on my side using the following
steps:

1. Install https://github.com/alphapapa/with-emacs.sh
2. Create /tmp/bug.org with the following contents
#+begin_src python
def hi():
pass
#+end_src
3. cd /tmp/
4. git clone git://git.sv.gnu.org/emacs/org-mode.git
5. cd org-mode
6. make clean; make autoloads; with-emacs.sh -e emacs -O -i elpy -- -Q
-L ./lisp/ -l org -l org-inlinetask --eval "(setq 
elpy-folding-fringe-indicators t)" --eval "(elpy-enable)" /tmp/bug.org

7. C-c ' and install the dependencies
8. C-e h o to export html

Best,
Ihor



Re: [BUG] HTML export of buffer with fringe indicators

2022-05-19 Thread Daniel Fleischer
Ihor Radchenko [2022-05-19 Thu 21:43] wrote:

> What if you try to run M-: (htmlize-buffer) 
> on your file?

It works, creating an HTML buffer that can be opened and looks good. 

-- 

Daniel Fleischer



Re: [BUG] HTML export of buffer with fringe indicators

2022-05-19 Thread Ihor Radchenko
Daniel Fleischer  writes:

> Ihor Radchenko [2022-05-18 Wed 20:54] wrote:
>
>> Can you set debug-on-error to t and share the full backtrace?
>
> Attached.
> ...
>   htmlize-buffer-1()

What if you try to run M-: (htmlize-buffer) 
on your file?

Best,
Ihor



Re: [BUG] HTML export of buffer with fringe indicators

2022-05-18 Thread Daniel Fleischer
Ihor Radchenko [2022-05-18 Wed 20:54] wrote:

> Can you set debug-on-error to t and share the full backtrace?

Attached.

Debugger entered--Lisp error: (args-out-of-range " " 0 -3)
  substring(" " 0 -3)
  (cons (substring text strpos addpos) textlist)
  (setq textlist (cons (substring text strpos addpos) textlist))
  (let ((addpos (car add)) (addtext (cdr add))) (setq textlist (cons (substring 
text strpos addpos) textlist)) (setq textlist (cons addtext textlist)) (setq 
strpos addpos))
  (let ((add (car --dolist-tail--))) (let ((addpos (car add)) (addtext (cdr 
add))) (setq textlist (cons (substring text strpos addpos) textlist)) (setq 
textlist (cons addtext textlist)) (setq strpos addpos)) (setq --dolist-tail-- 
(cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((add (car --dolist-tail--))) (let ((addpos (car 
add)) (addtext (cdr add))) (setq textlist (cons (substring text strpos addpos) 
textlist)) (setq textlist (cons addtext textlist)) (setq strpos addpos)) (setq 
--dolist-tail-- (cdr --dolist-tail--
  (let ((--dolist-tail-- (cl-stable-sort additions #'< :key #'car))) (while 
--dolist-tail-- (let ((add (car --dolist-tail--))) (let ((addpos (car add)) 
(addtext (cdr add))) (setq textlist (cons (substring text strpos addpos) 
textlist)) (setq textlist (cons addtext textlist)) (setq strpos addpos)) (setq 
--dolist-tail-- (cdr --dolist-tail--)
  (let ((textlist nil) (strpos 0)) (let ((--dolist-tail-- (cl-stable-sort 
additions #'< :key #'car))) (while --dolist-tail-- (let ((add (car 
--dolist-tail--))) (let ((addpos (car add)) (addtext (cdr add))) (setq textlist 
(cons (substring text strpos addpos) textlist)) (setq textlist (cons addtext 
textlist)) (setq strpos addpos)) (setq --dolist-tail-- (cdr 
--dolist-tail--) (setq textlist (cons (substring text strpos) textlist)) 
(apply #'concat (nreverse textlist)))
  (if additions (let ((textlist nil) (strpos 0)) (let ((--dolist-tail-- 
(cl-stable-sort additions #'< :key #'car))) (while --dolist-tail-- (let ((add 
(car --dolist-tail--))) (let ((addpos ...) (addtext ...)) (setq textlist (cons 
... textlist)) (setq textlist (cons addtext textlist)) (setq strpos addpos)) 
(setq --dolist-tail-- (cdr --dolist-tail--) (setq textlist (cons (substring 
text strpos) textlist)) (apply #'concat (nreverse textlist))) text)
  (let (additions) (let ((--dolist-tail-- (overlays-in beg end))) (while 
--dolist-tail-- (let ((overlay (car --dolist-tail--))) (let ((before 
(overlay-get overlay ...)) (after (overlay-get overlay ...))) (if after (progn 
(setq additions ...))) (if before (progn (setq additions ... (setq 
--dolist-tail-- (cdr --dolist-tail--) (if additions (let ((textlist nil) 
(strpos 0)) (let ((--dolist-tail-- (cl-stable-sort additions #'< :key #'car))) 
(while --dolist-tail-- (let ((add ...)) (let (... ...) (setq textlist ...) 
(setq textlist ...) (setq strpos addpos)) (setq --dolist-tail-- (cdr 
--dolist-tail--) (setq textlist (cons (substring text strpos) textlist)) 
(apply #'concat (nreverse textlist))) text))
  htmlize-add-before-after-strings(4 5 " ")
  (setq text (htmlize-add-before-after-strings beg end text))
  (let ((text (buffer-substring-no-properties beg end))) (htmlize-copy-prop 
'display beg end text) (htmlize-copy-prop 'htmlize-link beg end text) (setq 
text (htmlize-add-before-after-strings beg end text)) text)
  htmlize-get-text-with-display(4 5)
  (cons (htmlize-get-text-with-display pos next-change) visible-list)
  (setq visible-list (cons (htmlize-get-text-with-display pos next-change) 
visible-list))
  (cond ((eq show t) (setq visible-list (cons (htmlize-get-text-with-display 
pos next-change) visible-list))) ((and (eq show 'ellipsis) (not (eq last-show 
'ellipsis)) (setq visible-list (cons htmlize-ellipsis visible-list)
  (while (< pos end) (setq invisible (get-char-property pos 'invisible) 
next-change (htmlize-next-change pos 'invisible end) show 
(htmlize-decode-invisibility-spec invisible)) (cond ((eq show t) (setq 
visible-list (cons (htmlize-get-text-with-display pos next-change) 
visible-list))) ((and (eq show 'ellipsis) (not (eq last-show 'ellipsis)) (setq 
visible-list (cons htmlize-ellipsis visible-list) (setq pos next-change 
last-show show))
  (let ((pos beg) visible-list invisible show last-show next-change) (while (< 
pos end) (setq invisible (get-char-property pos 'invisible) next-change 
(htmlize-next-change pos 'invisible end) show (htmlize-decode-invisibility-spec 
invisible)) (cond ((eq show t) (setq visible-list (cons 
(htmlize-get-text-with-display pos next-change) visible-list))) ((and (eq show 
'ellipsis) (not (eq last-show 'ellipsis)) (setq visible-list (cons 
htmlize-ellipsis visible-list) (setq pos next-change last-show show)) 
(htmlize-concat (nreverse visible-list)))
  htmlize-buffer-substring-no-invisible(4 5)
  (let ((text (htmlize-buffer-substring-no-invisible beg end))) (if 
trailing-ellipsis (progn (setq text (htmlize-trim-ellipsis text (if (> 
(length text) 0) 

Re: [BUG] HTML export of buffer with fringe indicators

2022-05-18 Thread Ihor Radchenko
Daniel Fleischer  writes:

> Have `elpy' installed with enabled fringe markers (have
> `elpy-folding-fringe-indicators' non-nil). Then try to export, say to
> HTML. I get the error
>
> cons: Args out of range: " ", 0, -3

Can you set debug-on-error to t and share the full backtrace?

Best,
Ihor



[BUG] HTML export of buffer with fringe indicators

2022-05-17 Thread Daniel Fleischer
The case I have in mind is some code with folding indicators in the
fringe. E.g. have this python block:

#+begin_src python
def hi():
pass
#+end_src

Have `elpy' installed with enabled fringe markers (have
`elpy-folding-fringe-indicators' non-nil). Then try to export, say to
HTML. I get the error

cons: Args out of range: " ", 0, -3

Org cdbb1c9633.
Emacs eaa198cd75.

Thanks,

-- 

Daniel Fleischer