emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] contrib/lisp/ox-confluence.el: Export checkboxes; fix ti


From: Nicolas Goaziou
Subject: Re: [O] [PATCH] contrib/lisp/ox-confluence.el: Export checkboxes; fix timestamps in headlines
Date: Tue, 02 May 2017 08:54:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hello,

Marc Ihm <address@hidden> writes:

> the attached patch changes ox-confluence.el:
>
> - Export checkboxes in lists to appear in the resulting
>   confluence-markup (with some minor refactoring of
>   org-confluence-item).
> - Fix spurious closing braces following timestamps in headlines.
>
>
> Please review and let me know, if you have any comments or questions.

Thank you.

> +     (cl-case (org-element-property :checkbox item)
> +       ('on "*{{(X)}}* ") 
> +       ('off "*{{( )}}* ")
> +       ('trans "*{{(\\-)}}* "))

This is a common mistake. Symbols in `cl-case' shouldn't be quoted. 'on
is really (quote on), so you actually wrote

  (cl-case (org-element-property :checkbox item)
    ((quote on) "*{{(X)}}* ")
    ((quote off) "*{{( )}}* ")
    ((quote trans) "*{{(\\-)}}* "))

which is not what you want:

  (cl-case 'quote ('a 1) ('quote 2) (t 3))    => 1

This is why I prefer `pcase' over `cl-case'.

> +     (when (eq list-type 'descriptive)
> +       (concat "*" (org-export-data (org-element-property :tag item) info) 
> "* - "))
> +     (org-trim contents))))
>  
>  (defun org-confluence-fixed-width (fixed-width contents info)
>    (org-confluence--block
> @@ -117,7 +120,7 @@
>                           (string= todo ""))
>                       ""
>                     (format "*{{%s}}* " todo))))
> -    ;; Else: Standard headline.
> +

Mind the spurious blank lines.

>      (format "h%s. %s%s\n%s" level todo-text text
>              (if (org-string-nw-p contents) contents ""))))
>  
> @@ -181,7 +184,7 @@ a communication channel."
>  (defun org-confluence-timestamp (timestamp _contents _info)
>    "Transcode a TIMESTAMP object from Org to Confluence.
>  CONTENTS and INFO are ignored."
> -  (let ((translated (org-timestamp-translate timestamp)))
> +  (let ((translated (org-trim (org-timestamp-translate timestamp))))

I'm not sure what this is supposed to fix. Does
`org-timestamp-translate' return a string with leading or trailing
blanks?

Anyway, I applied the patch in master branch, with the fix suggested
above.

Regards,

-- 
Nicolas Goaziou



reply via email to

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