From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: unattractive list spacing in ox-html export Date: Tue, 24 Jun 2014 00:31:35 +0200 Message-ID: <87ionr6ywo.fsf@nicolasgoaziou.fr> References: <87tx7bgzdy.fsf@gmail.com> <87tx7b74ki.fsf@nicolasgoaziou.fr> <87ionrfgcb.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzClY-0002Bx-5q for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 18:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzClO-0007ZO-0R for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 18:31:08 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:37137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzClN-0007ZK-QU for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 18:30:57 -0400 In-Reply-To: <87ionrfgcb.fsf@gmail.com> (Eric Schulte's message of "Mon, 23 Jun 2014 17:36:29 -0400") 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: Eric Schulte Cc: Org Mode Mailing List Eric Schulte writes: > + ;; every subsequent list element is a single element long You need to start with a capital and a final period. Also, it could be merged with the comment below. E.g., "Paragraphs have no tag when any item in current list is either empty or consist of a single paragraph." > + (let ((gp (org-export-get-parent parent)) Since you only use it once, you don't need to bind it. Just use it in `org-element-map': (org-element-map (org-export-get-parent parent) 'item ...) > + (all-singles t)) > + (org-element-map gp 'item > + (lambda (object) > + (let ((num-children (length (org-element-contents object)))) > + (unless (= 1 num-children) > + (setq all-singles nil)))) > + info nil 'item) This is not sufficient, as an item could contain a single center block with many paragraphs within. IOW you also need to check the type of the single element. We also need to accept empty items. Moreover, the item could contain another element not exported (i.e. a comment), but I guess that would go a bit too far. Also, note that `org-element-map' has a mechanism to exit early (argument FIRST-MATCH), so you can avoid mapping over all items if you already know that one of them doesn't contain a single paragraph. I think the following should do the job: (not (org-element-map (org-export-get-parent parent) 'item (lambda (item) (let ((contents (org-element-contents item))) (and contents (or (cdr contents) (not (eq (org-element-type (car contents)) 'paragraph)))))) info 'first-match 'item)) > ;; Leading paragraph in a list item have no tags. See above. Regards, -- Nicolas Goaziou