From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?R=C3=A9mi_Vanicat?= Subject: [PATCH] Re: orgtbl-to-generic with lfmt (wrong usage or bug) Date: Fri, 22 Mar 2013 09:26:58 +0100 Message-ID: <87obebhmb1.dlv@debian.org> References: <514B2BDE.6030307@googlemail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIxJn-0008NU-7E for emacs-orgmode@gnu.org; Fri, 22 Mar 2013 04:27:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIxJl-0005c2-54 for emacs-orgmode@gnu.org; Fri, 22 Mar 2013 04:27:19 -0400 Received: from plane.gmane.org ([80.91.229.3]:45054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIxJk-0005bq-UR for emacs-orgmode@gnu.org; Fri, 22 Mar 2013 04:27:17 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UIxK6-0007kJ-2A for emacs-orgmode@gnu.org; Fri, 22 Mar 2013 09:27:38 +0100 Received: from 185.109.22.109.rev.sfr.net ([109.22.109.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Mar 2013 09:27:38 +0100 Received: from vanicat by 185.109.22.109.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Mar 2013 09:27:38 +0100 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: emacs-orgmode@gnu.org Cc: Gerhard --=-=-= Content-Type: text/plain Gerhard writes: > Hi, > > I was happy to find out about the possibility to convert a table into > something else, but I struggle with obtaining a particular result. I > have addresses in a table and want them to be formatted for printing. > This is where I am so far. > > #+ORGTBL: SEND sofar orgtbl-to-generic :lfmt "%s" Reading the documentation, this should be #+ORGTBL: SEND sofar orgtbl-to-generic :lfmt "%s %s\n%s\n%s %s\n" to have your expected formatting. But it seem there is a bug in orgtbl that make this to fail. This very simple patch seem to do the trick solve this. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Correctly-format-orgtbl-line-when-there-is-a-lfmt-ar.patch >From 248ee115ffaa86e7284a111bffc750174997faf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Vanicat?= Date: Fri, 22 Mar 2013 09:22:51 +0100 Subject: [PATCH] Correctly format orgtbl line when there is a :lfmt argument. orgtbl-apply-fmt need its arguments not in a line but as direct argument, we need to call apply --- lisp/org-table.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 8da57b2..dec16c0 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -4595,7 +4595,7 @@ First element has index 0, or I0 if given." f))) line))) (push (if *orgtbl-lfmt* - (orgtbl-apply-fmt *orgtbl-lfmt* line) + (apply #'orgtbl-apply-fmt *orgtbl-lfmt* line) (concat (orgtbl-eval-str *orgtbl-lstart*) (mapconcat 'identity line *orgtbl-sep*) (orgtbl-eval-str *orgtbl-lend*))) -- 1.7.10.4 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit -- RĂ©mi Vanicat --=-=-=--