emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Feature request: lists with letters


From: Nicolas Goaziou
Subject: Re: [O] Feature request: lists with letters
Date: Mon, 13 Feb 2017 21:39:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hello,

Rasmus <address@hidden> writes:

> Here's a quick attempt.  Do you want me to push it?

Thank you. Some minor comments below. Feel free to push whenever you
think this is good enough.

> +(defconst org-html-plain-list-type
> +  '(ordered "ol" unordered "ul" descriptive "dl")
> +  "Plist of Org and html list types.")

I think this is not needed.  We should merge `org-html-begin-plain-list'
and `org-html-end-plain-list' into `org-html-plain-list'. There is no
reason to split it.

As a consequence, we can compute "ol", "ul" or "dl" at the beginning of
`org-html-plain-list' and be done with it.

> +  (let* ((html-type (plist-get org-html-plain-list-type type))
> +      (html-class (format "org-%s" html-type)))
> +    (format "<%s %s>"
> +         html-type
> +         (org-html--make-attribute-string
> +          (plist-put attributes :class
> +                     (org-trim
> +                      (mapconcat 'identity

#'identity

> +                                 (list html-class (plist-get attributes 
> :class))
> +                                 " ")))))))
>  
>  (defun org-html-end-plain-list (type)
>    "Insert the end of the HTML list depending on TYPE."
> -  (pcase type
> -    (`ordered "</ol>")
> -    (`unordered "</ul>")
> -    (`descriptive "</dl>")))
> +  (format "</%s>" (plist-get org-html-plain-list-type type)))

See. There is no need to make this one-liner a separate function, IMO.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]