* Code blocks in lists?
@ 2012-05-18 8:39 Sebastien Vauban
2012-05-18 9:02 ` Nicolas Goaziou
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Sebastien Vauban @ 2012-05-18 8:39 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hello,
As demonstrated by the following ECM, it seems that I can't put code blocks
inside lists:
--8<---------------cut here---------------start------------->8---
* Installation
1. Download and install color-theme.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+end_src
2. Download and install color-theme-leuven.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+end_src
3. Restart Emacs.
--8<---------------cut here---------------end--------------->8---
exports to the following HTML page:
--8<---------------cut here---------------start------------->8---
* Installation
1. Download and install color-theme.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+end_src
1. Download and install color-theme-leuven.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+end_src
1. Restart Emacs.
--8<---------------cut here---------------end--------------->8---
I guess this is the same root cause as the problem I tried to described at
http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
Here, the fact that it is an enumerated list makes the problem stand out.
Any advice?
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
2012-05-18 8:39 Code blocks in lists? Sebastien Vauban
@ 2012-05-18 9:02 ` Nicolas Goaziou
[not found] ` <87obpl3lre.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[not found] ` <1337342641.WXHGMQZGWMUF@spammotel.com>
2012-05-18 12:09 ` Eric Schulte
2012-05-18 14:40 ` Sebastien Vauban
2 siblings, 2 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2012-05-18 9:02 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ
Hello,
"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
> Hello,
>
> As demonstrated by the following ECM, it seems that I can't put code blocks
> inside lists:
>
> * Installation
>
> 1. Download and install color-theme.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+end_src
>
> 2. Download and install color-theme-leuven.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+end_src
>
> 3. Restart Emacs.
>
> I guess this is the same root cause as the problem I tried to described at
> http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
>
> Here, the fact that it is an enumerated list makes the problem stand
> out.
I still cannot reproduce it.
> Any advice?
What happens if you eval:
(let ((org-current-export-file (current-buffer)))
(org-export-blocks-preprocess))
in your buffer?
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: **: Re: Code blocks in lists?
[not found] ` <87obpl3lre.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-05-18 11:50 ` Sebastien Vauban
2012-05-18 11:50 ` Sebastien Vauban
1 sibling, 0 replies; 12+ messages in thread
From: Sebastien Vauban @ 2012-05-18 11:50 UTC (permalink / raw)
To: re.ITWSQOTHJVN9M-geNee64TY+gS+FvcfC7Uqw
Cc: public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg,
Sebastien Vauban
Hi Nicolas,
Nicolas Goaziou wrote:
> "Sebastien Vauban" writes:
>> As demonstrated by the following ECM, it seems that I can't put code blocks
>> inside lists.
>>
>> I guess this is the same root cause as the problem I tried to described at
>> http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
>>
>> Here, the fact that it is an enumerated list makes the problem stand
>> out.
>
> I still cannot reproduce it.
>
> What happens if you eval:
>
> (let ((org-current-export-file (current-buffer)))
> (org-export-blocks-preprocess))
>
> in your buffer?
* Before command
--8<---------------cut here---------------start------------->8---
1. Download and install color-theme.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+end_src
2. Download and install color-theme-leuven.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+end_src
3. Restart Emacs.
--8<---------------cut here---------------end--------------->8---
* Command to execute
--8<---------------cut here---------------start------------->8---
(let ((org-current-export-file (current-buffer)))
(org-export-blocks-preprocess))
--8<---------------cut here---------------end--------------->8---
* After command
--8<---------------cut here---------------start------------->8---
1. Download and install color-theme.
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+END_SRC
2. Download and install color-theme-leuven.
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+END_SRC
3. Restart Emacs.
--8<---------------cut here---------------end--------------->8---
* Summary of the changes
The code blocks "meta data":
- is indented in column 0
- becomes uppercased
- gets a trailing space added
* Note
If I go at the end of (or just below) the text "3. Restart Emacs", and press
C-RET, I get:
--8<---------------cut here---------------start------------->8---
3. Restart Emacs.
4.
--8<---------------cut here---------------end--------------->8---
in the "Before command" section, while I get:
--8<---------------cut here---------------start------------->8---
1. Restart Emacs.
2.
--8<---------------cut here---------------end--------------->8---
in the "After command" section.
Hence, they do not share the same view on identifying the current list.
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: **: Re: Code blocks in lists?
[not found] ` <87obpl3lre.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-18 11:50 ` **: " Sebastien Vauban
@ 2012-05-18 11:50 ` Sebastien Vauban
1 sibling, 0 replies; 12+ messages in thread
From: Sebastien Vauban @ 2012-05-18 11:50 UTC (permalink / raw)
To: re.ITWSQOTHJVN9M-geNee64TY+gS+FvcfC7Uqw
Cc: public-emacs-orgmode-mXXj517/zsQ-wOFGN7rlS/M9smdsby/KFg,
Sebastien Vauban
Hi Nicolas,
Nicolas Goaziou wrote:
> "Sebastien Vauban" writes:
>> As demonstrated by the following ECM, it seems that I can't put code blocks
>> inside lists.
>>
>> I guess this is the same root cause as the problem I tried to described at
>> http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
>>
>> Here, the fact that it is an enumerated list makes the problem stand
>> out.
>
> I still cannot reproduce it.
>
> What happens if you eval:
>
> (let ((org-current-export-file (current-buffer)))
> (org-export-blocks-preprocess))
>
> in your buffer?
* Before command
--8<---------------cut here---------------start------------->8---
1. Download and install color-theme.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+end_src
2. Download and install color-theme-leuven.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+end_src
3. Restart Emacs.
--8<---------------cut here---------------end--------------->8---
* Command to execute
--8<---------------cut here---------------start------------->8---
(let ((org-current-export-file (current-buffer)))
(org-export-blocks-preprocess))
--8<---------------cut here---------------end--------------->8---
* After command
--8<---------------cut here---------------start------------->8---
1. Download and install color-theme.
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+END_SRC
2. Download and install color-theme-leuven.
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+END_SRC
3. Restart Emacs.
--8<---------------cut here---------------end--------------->8---
* Summary of the changes
The code blocks "meta data":
- is indented in column 0
- becomes uppercased
- gets a trailing space added
* Note
If I go at the end of (or just below) the text "3. Restart Emacs", and press
C-RET, I get:
--8<---------------cut here---------------start------------->8---
3. Restart Emacs.
4.
--8<---------------cut here---------------end--------------->8---
in the "Before command" section, while I get:
--8<---------------cut here---------------start------------->8---
1. Restart Emacs.
2.
--8<---------------cut here---------------end--------------->8---
in the "After command" section.
Hence, they do not share the same view on identifying the current list.
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
2012-05-18 8:39 Code blocks in lists? Sebastien Vauban
2012-05-18 9:02 ` Nicolas Goaziou
@ 2012-05-18 12:09 ` Eric Schulte
2012-05-18 14:40 ` Sebastien Vauban
2 siblings, 0 replies; 12+ messages in thread
From: Eric Schulte @ 2012-05-18 12:09 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
> Hello,
>
> As demonstrated by the following ECM, it seems that I can't put code blocks
> inside lists:
>
> --8<---------------cut here---------------start------------->8---
> * Installation
>
> 1. Download and install color-theme.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+end_src
>
> 2. Download and install color-theme-leuven.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+end_src
>
> 3. Restart Emacs.
> --8<---------------cut here---------------end--------------->8---
>
> exports to the following HTML page:
>
> --8<---------------cut here---------------start------------->8---
> * Installation
>
> 1. Download and install color-theme.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+end_src
>
> 1. Download and install color-theme-leuven.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+end_src
>
> 1. Restart Emacs.
> --8<---------------cut here---------------end--------------->8---
>
> I guess this is the same root cause as the problem I tried to described at
> http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
>
> Here, the fact that it is an enumerated list makes the problem stand out.
>
> Any advice?
>
Hi Seb,
Your example works as expected on my system (both with my config loaded
and without my personal config loaded). Could you try to reproduce the
problem using Emacs -Q to see if the issue lies somewhere in your
configuration?
Thanks,
>
> Best regards,
> Seb
--
Eric Schulte
http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
2012-05-18 14:40 ` Sebastien Vauban
@ 2012-05-18 13:08 ` Eric Schulte
2012-05-18 18:55 ` Sebastien Vauban
0 siblings, 1 reply; 12+ messages in thread
From: Eric Schulte @ 2012-05-18 13:08 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
> Hi Nicolas,
>
> Nicolas Goaziou wrote:
>> "Sebastien Vauban" writes:
>>> As demonstrated by the following ECM, it seems that I can't put code blocks
>>> inside lists.
>>>
>>> I guess this is the same root cause as the problem I tried to described at
>>> http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
>>>
>>> Here, the fact that it is an enumerated list makes the problem stand
>>> out.
>>
>> I still cannot reproduce it.
>>
>> What happens if you eval:
>>
>> (let ((org-current-export-file (current-buffer)))
>> (org-export-blocks-preprocess))
>>
>> in your buffer?
>
> * Before command
>
> --8<---------------cut here---------------start------------->8---
> 1. Download and install color-theme.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+end_src
>
> 2. Download and install color-theme-leuven.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+end_src
>
> 3. Restart Emacs.
> --8<---------------cut here---------------end--------------->8---
>
> * Command to execute
>
> --8<---------------cut here---------------start------------->8---
> (let ((org-current-export-file (current-buffer)))
> (org-export-blocks-preprocess))
> --8<---------------cut here---------------end--------------->8---
>
> * After command
>
> --8<---------------cut here---------------start------------->8---
> 1. Download and install color-theme.
>
> #+BEGIN_SRC emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+END_SRC
>
> 2. Download and install color-theme-leuven.
>
> #+BEGIN_SRC emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+END_SRC
>
> 3. Restart Emacs.
> --8<---------------cut here---------------end--------------->8---
>
> * Summary of the changes
>
> The code blocks "meta data":
> - is indented in column 0
> - becomes uppercased
> - gets a trailing space added
>
> * Note
>
> If I go at the end of (or just below) the text "3. Restart Emacs", and press
> C-RET, I get:
>
> --8<---------------cut here---------------start------------->8---
> 3. Restart Emacs.
>
> 4.
> --8<---------------cut here---------------end--------------->8---
>
> in the "Before command" section, while I get:
>
> --8<---------------cut here---------------start------------->8---
> 1. Restart Emacs.
> 2.
> --8<---------------cut here---------------end--------------->8---
>
> in the "After command" section.
>
> Hence, they do not share the same view on identifying the current list.
>
> Best regards,
> Seb
Hi Seb,
Sorry I missed the bit about `org-src-preserve-indentation', indeed
there was a bug in the block indentation during export. I've just
pushed up a fix, please let me know if you continue to have problems.
Thanks,
--
Eric Schulte
http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
[not found] ` <1337342641.WXHGMQZGWMUF@spammotel.com>
@ 2012-05-18 13:44 ` Nicolas Goaziou
0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2012-05-18 13:44 UTC (permalink / raw)
To: WXHGMQZGWMUF
Cc: public-emacs-orgmode-mXXj517/zsQ, Eric Schulte, Sebastien Vauban
Hello,
WXHGMQZGWMUF@spammotel.com writes:
> * Before command
>
> 1. Download and install color-theme.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+end_src
>
> 2. Download and install color-theme-leuven.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+end_src
>
> 3. Restart Emacs.
>
> * Command to execute
>
> (let ((org-current-export-file (current-buffer)))
> (org-export-blocks-preprocess))
>
> * After command
>
> 1. Download and install color-theme.
>
> #+BEGIN_SRC emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+END_SRC
>
> 2. Download and install color-theme-leuven.
>
> #+BEGIN_SRC emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+END_SRC
>
> 3. Restart Emacs.
>
> * Summary of the changes
>
> The code blocks "meta data":
> - is indented in column 0
`org-export-blocks-preprocess' shouldn't do that. I assume you want to
preserve indentation in your blocks, but block boundaries shouldn't be
moved in any case.
Eric Schulte may have an opinion about this. I CC him. There's nothing
to do as far as lists are concerned, unfortunately.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
2012-05-18 8:39 Code blocks in lists? Sebastien Vauban
2012-05-18 9:02 ` Nicolas Goaziou
2012-05-18 12:09 ` Eric Schulte
@ 2012-05-18 14:40 ` Sebastien Vauban
2012-05-18 13:08 ` Eric Schulte
2 siblings, 1 reply; 12+ messages in thread
From: Sebastien Vauban @ 2012-05-18 14:40 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Nicolas,
Nicolas Goaziou wrote:
> "Sebastien Vauban" writes:
>> As demonstrated by the following ECM, it seems that I can't put code blocks
>> inside lists.
>>
>> I guess this is the same root cause as the problem I tried to described at
>> http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
>>
>> Here, the fact that it is an enumerated list makes the problem stand
>> out.
>
> I still cannot reproduce it.
>
> What happens if you eval:
>
> (let ((org-current-export-file (current-buffer)))
> (org-export-blocks-preprocess))
>
> in your buffer?
* Before command
--8<---------------cut here---------------start------------->8---
1. Download and install color-theme.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+end_src
2. Download and install color-theme-leuven.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+end_src
3. Restart Emacs.
--8<---------------cut here---------------end--------------->8---
* Command to execute
--8<---------------cut here---------------start------------->8---
(let ((org-current-export-file (current-buffer)))
(org-export-blocks-preprocess))
--8<---------------cut here---------------end--------------->8---
* After command
--8<---------------cut here---------------start------------->8---
1. Download and install color-theme.
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+END_SRC
2. Download and install color-theme-leuven.
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+END_SRC
3. Restart Emacs.
--8<---------------cut here---------------end--------------->8---
* Summary of the changes
The code blocks "meta data":
- is indented in column 0
- becomes uppercased
- gets a trailing space added
* Note
If I go at the end of (or just below) the text "3. Restart Emacs", and press
C-RET, I get:
--8<---------------cut here---------------start------------->8---
3. Restart Emacs.
4.
--8<---------------cut here---------------end--------------->8---
in the "Before command" section, while I get:
--8<---------------cut here---------------start------------->8---
1. Restart Emacs.
2.
--8<---------------cut here---------------end--------------->8---
in the "After command" section.
Hence, they do not share the same view on identifying the current list.
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
2012-05-18 18:55 ` Sebastien Vauban
@ 2012-05-18 17:11 ` Eric Schulte
2012-05-18 20:38 ` Sebastien Vauban
0 siblings, 1 reply; 12+ messages in thread
From: Eric Schulte @ 2012-05-18 17:11 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
> Hi Nicolas and Eric,
>
> Eric Schulte wrote:
>> "Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
>>> Nicolas Goaziou wrote:
>>>> "Sebastien Vauban" writes:
>>>>> As demonstrated by the following ECM, it seems that I can't put code blocks
>>>>> inside lists.
>>>>>
>>>>> I guess this is the same root cause as the problem I tried to described at
>>>>> http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
>>>>>
>>>>> Here, the fact that it is an enumerated list makes the problem stand
>>>>> out.
>>>>
>>>> I still cannot reproduce it.
>>>>
>>>> What happens if you eval:
>>>>
>>>> (let ((org-current-export-file (current-buffer)))
>>>> (org-export-blocks-preprocess))
>>>>
>>>> in your buffer?
>>>
>>> * Before command
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> 1. Download and install color-theme.
>>>
>>> #+begin_src emacs-lisp
>>> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
>>> (require 'color-theme)
>>> #+end_src
>>>
>>> 2. Download and install color-theme-leuven.
>>>
>>> #+begin_src emacs-lisp
>>> (add-to-list 'load-path "/path/to/color-theme-leuven")
>>> (require 'color-theme-leuven)
>>> #+end_src
>>>
>>> 3. Restart Emacs.
>>> --8<---------------cut here---------------end--------------->8---
>>
>> Sorry I missed the bit about `org-src-preserve-indentation', indeed there
>> was a bug in the block indentation during export. I've just pushed up a fix,
>> please let me know if you continue to have problems.
>
> With your fix, the above gets correctly exported. Thanks a lot to Nicolas for
> finding out the problem, and to you for the fix.
>
> However, if I change my list to something like this:
>
> 1. Download and install color-theme.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+end_src
>
> 1. Download and install color-theme-leuven.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+end_src
>
> 1. Restart Emacs.
>
> #+begin_src emacs-lisp
> (restart)
> #+end_src
>
> The export (see HTML), while being semantically correct in the sense that code
> blocks do belong to the items, seems wrong wrt the indentation, something like
> this:
>
> 1. Download and install color-theme.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
> (require 'color-theme)
> #+end_src
>
> 1. Download and install color-theme-leuven.
>
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/path/to/color-theme-leuven")
> (require 'color-theme-leuven)
> #+end_src
>
> 1. Restart Emacs.
>
> #+begin_src emacs-lisp
> (restart)
> #+end_src
>
> A bit like if the indentation was "doubled" each time. What do you think of
> that?
>
Hi Seb,
This indentation is an HTML/CSS issue, as far as I can tell Org-mode is
generating the correct HTML.
>
> Should I not use `org-src-preserve-indentation', maybe?[1]
>
The `org-src-preserve-indentation' variable only effects the indentation
of code *inside* of code blocks, it shouldn't have any effect on this
issue.
>
> Best regards,
> Seb
>
> [1] BTW, GitHub seems to use that setting, as they show the same problem as I
> had initially, when exporting README.org to HTML.
Github uses a ruby library named "org-ruby" to export, it is an entirely
separate export implementation.
Best,
--
Eric Schulte
http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
2012-05-18 13:08 ` Eric Schulte
@ 2012-05-18 18:55 ` Sebastien Vauban
2012-05-18 17:11 ` Eric Schulte
0 siblings, 1 reply; 12+ messages in thread
From: Sebastien Vauban @ 2012-05-18 18:55 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Nicolas and Eric,
Eric Schulte wrote:
> "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> Nicolas Goaziou wrote:
>>> "Sebastien Vauban" writes:
>>>> As demonstrated by the following ECM, it seems that I can't put code blocks
>>>> inside lists.
>>>>
>>>> I guess this is the same root cause as the problem I tried to described at
>>>> http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00247.html.
>>>>
>>>> Here, the fact that it is an enumerated list makes the problem stand
>>>> out.
>>>
>>> I still cannot reproduce it.
>>>
>>> What happens if you eval:
>>>
>>> (let ((org-current-export-file (current-buffer)))
>>> (org-export-blocks-preprocess))
>>>
>>> in your buffer?
>>
>> * Before command
>>
>> --8<---------------cut here---------------start------------->8---
>> 1. Download and install color-theme.
>>
>> #+begin_src emacs-lisp
>> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
>> (require 'color-theme)
>> #+end_src
>>
>> 2. Download and install color-theme-leuven.
>>
>> #+begin_src emacs-lisp
>> (add-to-list 'load-path "/path/to/color-theme-leuven")
>> (require 'color-theme-leuven)
>> #+end_src
>>
>> 3. Restart Emacs.
>> --8<---------------cut here---------------end--------------->8---
>
> Sorry I missed the bit about `org-src-preserve-indentation', indeed there
> was a bug in the block indentation during export. I've just pushed up a fix,
> please let me know if you continue to have problems.
With your fix, the above gets correctly exported. Thanks a lot to Nicolas for
finding out the problem, and to you for the fix.
However, if I change my list to something like this:
1. Download and install color-theme.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+end_src
1. Download and install color-theme-leuven.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+end_src
1. Restart Emacs.
#+begin_src emacs-lisp
(restart)
#+end_src
The export (see HTML), while being semantically correct in the sense that code
blocks do belong to the items, seems wrong wrt the indentation, something like
this:
1. Download and install color-theme.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+end_src
1. Download and install color-theme-leuven.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+end_src
1. Restart Emacs.
#+begin_src emacs-lisp
(restart)
#+end_src
A bit like if the indentation was "doubled" each time. What do you think of
that?
Should I not use `org-src-preserve-indentation', maybe?[1]
Best regards,
Seb
[1] BTW, GitHub seems to use that setting, as they show the same problem as I
had initially, when exporting README.org to HTML.
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
2012-05-18 17:11 ` Eric Schulte
@ 2012-05-18 20:38 ` Sebastien Vauban
2012-05-19 22:48 ` Eric Schulte
0 siblings, 1 reply; 12+ messages in thread
From: Sebastien Vauban @ 2012-05-18 20:38 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Eric,
Eric Schulte wrote:
> "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>> If I change my list to something like this:
>>
>> 1. Download and install color-theme.
>>
>> #+begin_src emacs-lisp
>> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
>> (require 'color-theme)
>> #+end_src
>>
>> 1. Download and install color-theme-leuven.
>>
>> #+begin_src emacs-lisp
>> (add-to-list 'load-path "/path/to/color-theme-leuven")
>> (require 'color-theme-leuven)
>> #+end_src
>>
>> 1. Restart Emacs.
>>
>> #+begin_src emacs-lisp
>> (restart)
>> #+end_src
>>
>> The export (see HTML), while being semantically correct in the sense that code
>> blocks do belong to the items, seems wrong wrt the indentation, something like
>> this:
>>
>> 1. Download and install color-theme.
>>
>> #+begin_src emacs-lisp
>> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
>> (require 'color-theme)
>> #+end_src
>>
>> 1. Download and install color-theme-leuven.
>>
>> #+begin_src emacs-lisp
>> (add-to-list 'load-path "/path/to/color-theme-leuven")
>> (require 'color-theme-leuven)
>> #+end_src
>>
>> 1. Restart Emacs.
>>
>> #+begin_src emacs-lisp
>> (restart)
>> #+end_src
>>
>> A bit like if the indentation was "doubled" each time. What do you think of
>> that?
>
> This indentation is an HTML/CSS issue, as far as I can tell Org-mode is
> generating the correct HTML.
I don't think it's a HTML/CSS issue: if you look at the produced HTML, you see
respectively 3 whitespaces (or 6 or 9) in front of every line of the code
block.
That is: the "indentation" whitespaces in your Org buffer are copied over to
HTML. And, as the code blocks are now correctly indented under their parent
item, the leading whitespaces are further indenting the code blocks.
So, for me, there should be no extra whitespace added to the code block in the
PRE tags.
>> [1] BTW, GitHub seems to use that setting, as they show the same problem as I
>> had initially, when exporting README.org to HTML.
>
> Github uses a ruby library named "org-ruby" to export, it is an entirely
> separate export implementation.
OK.
Best regards,
Seb
--
Sebastien Vauban
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Code blocks in lists?
2012-05-18 20:38 ` Sebastien Vauban
@ 2012-05-19 22:48 ` Eric Schulte
0 siblings, 0 replies; 12+ messages in thread
From: Eric Schulte @ 2012-05-19 22:48 UTC (permalink / raw)
To: Sebastien Vauban; +Cc: emacs-orgmode
>>> The export (see HTML), while being semantically correct in the sense that code
>>> blocks do belong to the items, seems wrong wrt the indentation, something like
>>> this:
>>>
>>> 1. Download and install color-theme.
>>>
>>> #+begin_src emacs-lisp
>>> (add-to-list 'load-path "/path/to/color-theme-6.6.0")
>>> (require 'color-theme)
>>> #+end_src
>>>
>>> 1. Download and install color-theme-leuven.
>>>
>>> #+begin_src emacs-lisp
>>> (add-to-list 'load-path "/path/to/color-theme-leuven")
>>> (require 'color-theme-leuven)
>>> #+end_src
>>>
>>> 1. Restart Emacs.
>>>
>>> #+begin_src emacs-lisp
>>> (restart)
>>> #+end_src
>>>
>>> A bit like if the indentation was "doubled" each time. What do you think of
>>> that?
>>
>> This indentation is an HTML/CSS issue, as far as I can tell Org-mode is
>> generating the correct HTML.
>
> I don't think it's a HTML/CSS issue: if you look at the produced HTML, you see
> respectively 3 whitespaces (or 6 or 9) in front of every line of the code
> block.
>
> That is: the "indentation" whitespaces in your Org buffer are copied over to
> HTML. And, as the code blocks are now correctly indented under their parent
> item, the leading whitespaces are further indenting the code blocks.
>
> So, for me, there should be no extra whitespace added to the code block in the
> PRE tags.
>
My fault, I thought you were talking about the indentation of the code
block as a whole, not the code *within* the code block.
Currently when the `org-src-preserve-indentation' variable is set it
preserves the indentation between the beginning of the line and the
beginning of the code, not the indentation between the beginning of the
code block and the beginning of the code, so for example the following
un-intuitive option would control the indentation within the code
blocks.
1. Download and install color-theme.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-6.6.0")
(require 'color-theme)
#+end_src
1. Download and install color-theme-leuven.
#+begin_src emacs-lisp
(add-to-list 'load-path "/path/to/color-theme-leuven")
(require 'color-theme-leuven)
#+end_src
1. Restart Emacs.
#+begin_src emacs-lisp
(restart)
#+end_src
I think this is a feature of `org-src-preserve-indentation' which should
probably be changed to make using it with indented code blocks more
natural. In this case, unless you need to preserve indentation within a
code block a simpler solution is to set `org-src-preserve-indentation'
to nil.
Hope this helps,
>
>>> [1] BTW, GitHub seems to use that setting, as they show the same problem as I
>>> had initially, when exporting README.org to HTML.
>>
>> Github uses a ruby library named "org-ruby" to export, it is an entirely
>> separate export implementation.
>
> OK.
>
> Best regards,
> Seb
--
Eric Schulte
http://cs.unm.edu/~eschulte
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2012-05-20 0:49 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-18 8:39 Code blocks in lists? Sebastien Vauban
2012-05-18 9:02 ` Nicolas Goaziou
[not found] ` <87obpl3lre.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-18 11:50 ` **: " Sebastien Vauban
2012-05-18 11:50 ` Sebastien Vauban
[not found] ` <1337342641.WXHGMQZGWMUF@spammotel.com>
2012-05-18 13:44 ` Nicolas Goaziou
2012-05-18 12:09 ` Eric Schulte
2012-05-18 14:40 ` Sebastien Vauban
2012-05-18 13:08 ` Eric Schulte
2012-05-18 18:55 ` Sebastien Vauban
2012-05-18 17:11 ` Eric Schulte
2012-05-18 20:38 ` Sebastien Vauban
2012-05-19 22:48 ` Eric Schulte
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).