From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: returning propertized strings Date: Sun, 21 May 2017 17:21:11 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c19309474c64205500f553c" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCYHq-0002FI-QV for emacs-orgmode@gnu.org; Sun, 21 May 2017 17:21:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCYHp-0003sF-Ez for emacs-orgmode@gnu.org; Sun, 21 May 2017 17:21:14 -0400 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:36409) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dCYHp-0003s9-3y for emacs-orgmode@gnu.org; Sun, 21 May 2017 17:21:13 -0400 Received: by mail-wm0-x232.google.com with SMTP id 7so43699541wmo.1 for ; Sun, 21 May 2017 14:21:13 -0700 (PDT) In-Reply-To: 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: "Charles C. Berry" Cc: "emacs-orgmode@gnu.org" --94eb2c19309474c64205500f553c Content-Type: text/plain; charset="UTF-8" I figured out the properties are getting lost in org-babel-format-result, in the beginning with (setq result (org-no-properties result)). I can see a reason this is desirable is that the properties would not be persistent on saving/closing. On the other hand, it could be really useful in some scenarios where temporary properties would be useful. Are there other reasons having properties on strings in the output are not desirable? John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Sun, May 21, 2017 at 9:04 AM, John Kitchin wrote: > > > On Sat, May 20, 2017 at 9:46 PM, Charles C. Berry > wrote: > >> On Sat, 20 May 2017, John Kitchin wrote: >> >> If I run this block I get test as a result, but all its properties have >>> been stripped. >>> >>> #+BEGIN_SRC emacs-lisp :results drawer >>> (propertize "test" 'font-lock-face '(:foreground "red") 'help-echo >>> "tooltip") >>> #+END_SRC >>> >>> #+RESULTS: >>> :RESULTS: >>> test >>> :END: >>> >>> Does anyone know where this happens and if it can be avoided? >>> >> >> Where? >> >> Not sure, but late enough that `:results pp' will print them or `:post >> ...' will receive them in `*this*'. >> >> #+BEGIN_SRC emacs-lisp :results drawer pp >> (propertize "test" 'font-lock-face '(:foreground "red") 'help-echo >> "tooltip") >> #+END_SRC >> >> #+RESULTS: >> : #("test" 0 4 >> : (help-echo "tooltip" font-lock-face >> : (:foreground "red"))) >> > > I get this too, but I really want test to actually be red, and have a > tooltip in the results, and neither of these two methods seem to achieve > that. > > >> >> also `*this*' will contain the propertized version if you use the :post >> header arg. >> >> HTH, >> >> Chuck >> >> > --94eb2c19309474c64205500f553c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I figured out the properties are getting lost in org-babel= -format-result, in the beginning with=C2=A0(setq result (org-no-properties = result)).=C2=A0

I can see a reason this is desirable is = that the properties would not be persistent on saving/closing. On the other= hand, it could be really useful in some scenarios where temporary properti= es would be useful.=C2=A0

Are there other reasons = having properties on strings in the output are not desirable? =C2=A0
<= /div>

John

-----------------------------------
Professor John= Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical Engineering<= br>Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
=

On Sun, May 21, 2017 at 9:04 AM, John Kitchi= n <jkitchin@andrew.cmu.edu> wrote:


On Sat, May 20, 2017 at 9:4= 6 PM, Charles C. Berry <ccberry@ucsd.edu> wrote:
On Sat, 20 May 2017, John Kitchin wrote:

If I run this block I get test as a result, but all its properties have
been stripped.

#+BEGIN_SRC emacs-lisp :results drawer
(propertize "test" 'font-lock-face '(:foreground "re= d") 'help-echo
"tooltip")
#+END_SRC

#+RESULTS:
:RESULTS:
test
:END:

Does anyone know where this happens and if it can be avoided?

Where?

Not sure, but late enough that `:results pp' will print them or `:post = ...' will receive them in `*this*'.

#+BEGIN_SRC emacs-lisp :results drawer pp
(propertize "test" 'font-lock-face '(:foreground "re= d") 'help-echo "tooltip")
#+END_SRC

#+RESULTS:
: #("test" 0 4
:=C2=A0 =C2=A0(help-echo "tooltip" font-lock-face
:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (:foreground "red")))<= br>

I get this too, but =C2=A0I real= ly want test to actually be red, and have a tooltip in the results, and nei= ther of these two methods seem to achieve that.
= =C2=A0

also `*this*' will contain the propertized version if you use the :post= header arg.

HTH,

Chuck



--94eb2c19309474c64205500f553c--