From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] contrib/lisp/ox-confluence.el: Export checkboxes; fix timestamps in headlines Date: Tue, 02 May 2017 08:54:19 +0200 Message-ID: <87d1brycis.fsf@nicolasgoaziou.fr> References: <86r3087fys.fsf@ihm.name> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5RhZ-0002V6-UC for emacs-orgmode@gnu.org; Tue, 02 May 2017 02:54:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5RhW-0001Ix-Ku for emacs-orgmode@gnu.org; Tue, 02 May 2017 02:54:26 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:34287) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d5RhW-0001IX-Em for emacs-orgmode@gnu.org; Tue, 02 May 2017 02:54:22 -0400 In-Reply-To: <86r3087fys.fsf@ihm.name> (Marc Ihm's message of "Mon, 01 May 2017 17:29:47 +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" To: Marc Ihm Cc: emacs-orgmode@gnu.org Hello, Marc Ihm 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