From: Ihor Radchenko <yantar92@posteo.net>
To: Max Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] ob-shell: internal representation of cmdline arguments the same
Date: Wed, 01 May 2024 14:02:06 +0000 [thread overview]
Message-ID: <87edalsk9t.fsf@localhost> (raw)
In-Reply-To: <v0tbhi$lvg$1@ciao.gmane.io>
Max Nikulin <manikulin@gmail.com> writes:
> I consider it as a kind of pitfall inconsistent with DWIM concept. An
> idea of a kludge is below.
>
> #+begin_src sh :cmdline "1 2 3" :results verbatim
> printf '%s\n' "$@"
> #+end_src
> ...
> - (read cell))
> + (propertize (read cell) 'org-babel-value 'quoted-string))
> (t (org-no-properties cell))))
Well. See
https://list.orgmode.org/orgmode/87wmyc1sud.fsf@localhost/
>> Org cannot distinguish between
>>
>> #+begin_src lang :foo value with spaces
>> and
>> #+begin_src lang :foo "value with spaces"
>>
>> What we can do it make `org-babel-read' assign a text property to the
>> resulting string when it is a string with quotes:
>>
>> (org-babel-read "my file with quotes") ; => "my file with quotes"
>> (org-babel-read "\"my file with quotes\"") ; => #("my file with quotes" 0 19 (org-babel-quote t))
>>
>> Then, we can later use this information in `org-babel-merge-params'.
>> We will not call `split-string', when 'org-babel-quote text property is
>> present.
>> Also, `split-string' won't work when we have something like
>>
>> "yes \"my file with quotes\""
>>
>> Instead, we should use
>> (mapcar #'org-babel-read (org-babel-balanced-split "yes \"my file with quotes\"" ?\s))
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
prev parent reply other threads:[~2024-05-01 14:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-28 13:27 [BUG] ob-shell: internal representation of cmdline arguments the same Matt
2024-04-29 12:22 ` Ihor Radchenko
2024-05-01 12:11 ` Max Nikulin
2024-05-01 14:02 ` Ihor Radchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87edalsk9t.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=manikulin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.