From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Code blocks in lists? Date: Fri, 18 May 2012 13:11:22 -0400 Message-ID: <87havdifd1.fsf@gmx.com> References: <80bollkhmu.fsf@somewhere.org> <80obplmu1l.fsf@somewhere.org> <87k409k560.fsf@gmx.com> <808vgpqpy6.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVSaO-0004YO-72 for emacs-orgmode@gnu.org; Fri, 18 May 2012 15:11:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVSaL-0005UA-SR for emacs-orgmode@gnu.org; Fri, 18 May 2012 15:11:35 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:44545 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SVSaL-0005Tp-Lz for emacs-orgmode@gnu.org; Fri, 18 May 2012 15:11:33 -0400 In-Reply-To: <808vgpqpy6.fsf@somewhere.org> (Sebastien Vauban's message of "Fri, 18 May 2012 20:55:29 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: emacs-orgmode@gnu.org "Sebastien Vauban" writes: > Hi Nicolas and Eric, > > Eric Schulte wrote: >> "Sebastien Vauban" 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