From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: unattractive list spacing in ox-html export Date: Mon, 23 Jun 2014 20:09:55 -0400 Message-ID: <877g47f9rg.fsf@gmail.com> References: <87tx7bgzdy.fsf@gmail.com> <87tx7b74ki.fsf@nicolasgoaziou.fr> <87ionrfgcb.fsf@gmail.com> <87ionr6ywo.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzEJs-0004Ru-Bq for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 20:10:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzEJn-0000SN-Sh for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 20:10:40 -0400 Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]:55923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzEJn-0000SG-Fq for emacs-orgmode@gnu.org; Mon, 23 Jun 2014 20:10:35 -0400 Received: by mail-qg0-f46.google.com with SMTP id q107so6426782qgd.5 for ; Mon, 23 Jun 2014 17:10:35 -0700 (PDT) Received: from bagel (pool-74-111-105-28.pitbpa.fios.verizon.net. [74.111.105.28]) by mx.google.com with ESMTPSA id 22sm12536173qgs.23.2014.06.23.17.10.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jun 2014 17:10:34 -0700 (PDT) In-Reply-To: <87ionr6ywo.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 24 Jun 2014 00:31:35 +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: Org Mode Mailing List Nicolas Goaziou writes: > 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. > Applied with your changes. Thanks for initial pointer and the code review. Best, Eric > > > Regards, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D (see https://u.fsf.org/yw)