From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ethan Ligon Subject: [PATCH] worg/org-contrib list items are missing Date: Wed, 4 May 2011 19:52:56 -0700 Message-ID: References: <87tydai1ic.fsf@riotblast.dunsmor.com> <87oc3it3m0.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHoiQ-0004JJ-VC for Emacs-orgmode@gnu.org; Wed, 04 May 2011 22:54:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHoiP-0004K1-Fk for Emacs-orgmode@gnu.org; Wed, 04 May 2011 22:54:58 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:53889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHoiP-0004Jo-6t for Emacs-orgmode@gnu.org; Wed, 04 May 2011 22:54:57 -0400 Received: by fxm18 with SMTP id 18so1550431fxm.0 for ; Wed, 04 May 2011 19:54:55 -0700 (PDT) In-Reply-To: <87oc3it3m0.fsf@fastmail.fm> 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: Matt Lundin Cc: Jason Dunsmore , "Emacs-orgmode@gnu.org" Okay. I deny that 49e6bc899758114d6d29e69a8f9e40798d26782b broke html export. Before that patch there were *two* bugs related to description lists. After that there was one. See below for an explanation and patch. This also fixes an analogous bug in latex export. On Wed, May 4, 2011 at 5:04 PM, Matt Lundin wrote: > Jason Dunsmore writes: > >> "Sullivan, Gregory (US SSA)" writes: >> >>> Something is broken exporting worg source to lists: >>> >>> http://orgmode.org/worg/org-contrib/ >>> >>> is missing the list item headers. >> >> I see it's missing the left part of the description list items. =A0I ran= a >> git-bisect and found the commit that introduced the problem: > > FWIW, the worg page can be fixed by adding an extra space after the "::" > in the first description item. I'm applying this fix to Worg for the > sake of readability, but am documenting my actions here, since it is > related to the patch below. > > Best, > Matt > >> >> 49e6bc899758114d6d29e69a8f9e40798d26782b is the first bad commit >> commit 49e6bc899758114d6d29e69a8f9e40798d26782b >> Author: Ethan Ligon >> Date: =A0 Sat Apr 9 18:39:35 2011 +0200 >> >> =A0 =A0 Fix for html & docbook export of description list items >> >> =A0 =A0 The problem is illustrated by the following example: >> >> =A0 =A0 * Illustration of bug in html export >> =A0 =A0 =A0 - This has a space after the colons :: so will work in latex= and html >> =A0 =A0 =A0 - This doesn't have a space after the colons ::so is an inva= lid >> =A0 =A0 =A0 =A0 description item according to the org manual. =A0Won't w= ork in html >> =A0 =A0 =A0 =A0 or docbook. =A0Will nevertheless work in latex, provided= /first/ >> =A0 =A0 =A0 =A0 description item is valid. >> =A0 =A0 =A0 - Has a terminating space :: >> =A0 =A0 =A0 =A0 - So it works in both html and latex export! >> =A0 =A0 =A0 =A0 - Even though it's difficult to distinguish from the nex= t example. >> =A0 =A0 =A0 - Lacks a terminating space :: >> =A0 =A0 =A0 =A0 - At present, *doesn't* work in html or docbook export, = does in >> =A0 =A0 =A0 =A0 =A0 latex. =A0This is the case that the following patch = fixes. >> >> :040000 040000 feb2527d8b3294e9d9a118f4752a414b8431d706 4bdeed49ce735a32= 1ddbb3053c22282dd9909677 M =A0 =A0 =A0 lisp >> >> Ethan, can you investigate? > The first bug was that when org-html.el or org-docbook.el tried to process a description list, if the first item in a list looked like - /org-annotate-file.el/ -- annotate a file with org syntax :: without a trailing space or tab, then the entire list would be treated as a bullet list, not a description list. The second bug was that if the list was identified by org-list.el as being a description list, but a *subsequent* item looked like the example above, then the description would get swallowed, and replaced by a ??? in html export. The commit mentioned above fixed the second problem. But that uncovered the first bug, trigged by a description list in Worg/org-contrib/index.org. * Illustration of bug in org-list identification of description lists - This doesn't have a space after the colons :: Previously, export would break, and description wouldn't be prin= ted. - Even worse :: All other subsequent description items in the same list would also not work---they'd be exported as bullet lists, with the description stripped out (in html export). - Prior to commit 49e6bc899758114d6d29e69a8f9e40798d26782b :: this list would have been interpreted as a list of bullets, with the list item content including the description. - After commit 49e6bc899758114d6d29e69a8f9e40798d26782b :: this list would still have been interpreted as a list of bullets, but code in org-html.el (or org-docbook.el) would have stripped out the description part. - After fixing the regex in org-list.el :: Every description item in this list is exported correctly in both html and latex export. Here's a patch that fixes the regex in org-list.el: diff --git a/lisp/org-list.el b/lisp/org-list.el index 9c178e1..83d6828 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -369,7 +369,7 @@ It depends on `org-empty-line-terminates-plain-lists'."= ) (concat "^[ \t]*\\(\\(?:[-+*]\\|\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\)[ \t]*\\= )" "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\]\\)?" "\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?" - "\\(?:\\(.*\\)[ \t]+::[ \t]+\\)?") + "\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?") "Matches a list item and puts everything into groups: group 1: bullet group 2: counter --=20 Ethan Ligon, Associate Professor Agricultural & Resource Economics University of California, Berkeley