From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: Org source block header argument :var does not support space separated string Date: Mon, 22 Oct 2018 08:48:00 +0800 Message-ID: <87r2giiz7j.fsf@gmail.com> References: <87sh11htsy.fsf@gmail.com> <878t2sgypl.fsf@nicolasgoaziou.fr> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEOO6-0003Mq-Qq for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 20:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gEOO2-0004vs-RZ for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 20:48:06 -0400 Received: from [61.175.244.13] (port=48428 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gEOO2-0004v9-Gb for emacs-orgmode@gnu.org; Sun, 21 Oct 2018 20:48:02 -0400 In-reply-to: <878t2sgypl.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: org-mode Nicolas Goaziou writes: > Anyway, I tried the following block: > > #+begin_src emacs-lisp :var encrypted="base64 encrypt text" > encrypted > #+end_src > > and the output is > > #+results: > : base64 encrypt text > > which means there doesn't seem to be a problem with strings within > quotes. > > Regards, Oops, I misunderstand the :var variable="literal quoted string". I want to reference the named source's result in variable. Like: **** encrypt text -- ~<<< [TEXT]~ #+NAME: base64 encrypt text #+begin_src sh base64 <<< "stardiviner " #+end_src #+RESULTS: base64 encrypt text : c3RhcmRpdmluZXIgPG51bWJjaGlsZEBnbWFpbC5jb20+Cg== **** decrypt text -- ~-d~ #+begin_src sh :var encrypted= # base64 -d <<< c3RhcmRpdmluZXIgPG51bWJjaGlsZEBnbWFpbC5jb20+Cg== # base64 -d <<< $encrypted echo $encrypted #+end_src #+RESULTS[<2018-10-20 16:46:10> 6e5d3875d0928eb95ec1356661f965bdf4882244]: I can use #+NAME: base64-encrypt-text for first source block, and :var encrypted=base64-encrypt-text for second source block. So it can work. But is it possible to allow space in source block name and make it still can be referenced? Like quote it with <> around the name as my upper example? -- [ stardiviner ] don't need to convince with trends. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3