emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [RFC] ox-ascii.el: fixing variable width character handling


From: Nicolas Goaziou
Subject: Re: [O] [RFC] ox-ascii.el: fixing variable width character handling
Date: Fri, 03 Jan 2014 10:34:08 +0100

Hello,

Yasushi SHOJI <address@hidden> writes:

> Ok here is new one.  I've been using for a while.  Hope it works for
> others.

Thank you. It looks mostly good, but I cannot apply it on top of master
branch. Could you rebase and send an updated version?

> * lisp/ox-ascii.el (org-ascii--current-text-width): Convert `length'
>   to `string-width'.
>   (org-ascii--build-title): Likewise.
>   (org-ascii--build-toc): Likewise.
>   (org-ascii--list-listings): Likewise.
>   (org-ascii--list-tables): Likewise.
>   (org-ascii-template--document-title): Likewise.
>   (org-ascii-inner-template): Likewise.
>   (org-ascii-format-inlinetask-default): Likewise.
>   (org-ascii-format-inlinetask-default):Likewise.
>   (org-ascii-item): Likewise.
>   (org-ascii--table-cell-width): Likewise.
>   (org-ascii-table-cell): Likewise.
>   (org-ascii--current-text-width): Likewise.

The usual format is

  (org-ascii--build-title, org-ascii--build-toc, ...): Likewise.

IOW, you don't need a new line for each function.

> -              (let ((struct (org-element-property :structure parent-item))
> -                    (beg-item (org-element-property :begin parent-item)))
> +              (let* ((struct (org-element-property :structure parent-item))
> +                     (beg-item (org-element-property :begin parent-item))
> +                     (tag (org-list-get-tag beg-item struct))
> +                     (bullet (org-list-get-bullet beg-item struct)))

Since you don't use these variables below, you can skip both tag and
bullet binding.

>                  (+ (- (org-list-get-ind beg-item struct)
>                        (org-list-get-ind
>                         (org-list-get-top-point struct) struct))
> -                   (length (org-ascii--checkbox parent-item info))
> -                   (length
> +                   (string-width (or (org-ascii--checkbox parent-item info) 
> ""))
> +                   (string-width
>                      (or (org-list-get-tag beg-item struct)
> -                        (org-list-get-bullet beg-item struct)))))))))))))
> +                        (org-list-get-bullet beg-item struct)
> +                        ""))))))))))))


Regards,

-- 
Nicolas Goaziou



reply via email to

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