From mboxrd@z Thu Jan 1 00:00:00 1970 From: Willem Rein Oudshoorn Subject: Re: Table formula and text properties Date: Thu, 08 Jan 2015 19:52:09 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9IDF-0000WA-IO for emacs-orgmode@gnu.org; Thu, 08 Jan 2015 13:53:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9IDC-0004CR-QE for emacs-orgmode@gnu.org; Thu, 08 Jan 2015 13:53:41 -0500 Received: from plane.gmane.org ([80.91.229.3]:49284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9IDC-0004An-JZ for emacs-orgmode@gnu.org; Thu, 08 Jan 2015 13:53:38 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Y9ICX-0005tz-73 for emacs-orgmode@gnu.org; Thu, 08 Jan 2015 19:52:57 +0100 Received: from ironhead.xs4all.nl ([80.101.115.122]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Jan 2015 19:52:57 +0100 Received: from woudshoo by ironhead.xs4all.nl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Jan 2015 19:52:57 +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 Michael Brand writes: > Hi Wim > > On Wed, Jan 7, 2015 at 6:11 PM, Willem Rein Oudshoorn > wrote: >> ... >> However org mode table formula code seems to strip the display property >> from the string returned by the formula. So this trick will not work. > > I think this is by design. If someone wants to change current behavior > then there are other issues to be considered: An 80 by 8 pixel image > that is inserted with > > (insert-image > (sparkline-make-sparkline 80 8 '(1 20 12 13 141 13 24 90)) > "SPARKLINE") > > with point in a table is first visible as an image but will change to > the text "SPARKLINE" after e. g. table realignment. And determining > column width around an image for table realignment would not be > trivial. Thank you for your thoughtful answer. You mention two issues here 1. After realignment the image will be replaced by text 2. The difficulty of determining the width of an image The first item should in theory not be a problem, text properties come witht the string, so as long as org mode does not remove the text properties the image should stay with the string, even after realigment. (However this is spoken as someone with no experience with the org code, so take this with some bucket loads of salt.) The second problem is indeed much harder. One way I can see this working is if org mode would use the 'space :align-to specification to align the table, and trust the underlying string to ensure enough space is reserved for the image. This would indeed be tricky. Another potential hack is by querying the font width and use that in the calculation of the width for the image when generating. However, it seems not be possible at the moment, and I do not know how much work changing org-mode is to deal with text properties. If it is not too hard, it might be worth it anyway, formulas could attach a face to the result and this might be useful. > It would be nice if in your package someone could support one of > > (sparkline-make-sparkline nil nil > '(1 20 12 13 141 13 24 90)) => "▁▁▁▁█▁▂▅" > (sparkline-make-unicode 1 20 12 13 141 13 24 90) => "▁▁▁▁█▁▂▅" > That would not be too hard. But I am not sure I am too interested. At the moment I have a CSV mode that uses sparkline to generate graphs of series with 100's of data points and I fear that the ASCII art version will not give nearly the same information as the graphical version. Unfortunately I do not have much time now, so looking into this might not happen :-(. > For completeness I would like to mention Thierry Banel's > orgtbl-ascii-plot which has been added to Org core meanwhile: > http://orgmode.org/worg/org-contrib/orgtbl-ascii-plot.html A that looks nice too, thank you for mentioning this. Kind regards, Wim Oudshoorn.