[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Importing "quoted" strings in `org-babel-import-elisp-from-file'
|
From: |
Ihor Radchenko |
|
Subject: |
Re: Importing "quoted" strings in `org-babel-import-elisp-from-file' |
|
Date: |
Sat, 04 May 2024 08:03:27 +0000 |
Max Nikulin <manikulin@gmail.com> writes:
>>> (org-babel-read "\"1\\\\\" 2 \\\\\"3\"" t)
>>> "1\\"
>>
>> Fixed, on main.
>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2028bb15c
>
> I have no idea if "other\n\"string\"\nlines" may be passed
> `org-babel-read', but it is not discarded by the current regexp:
>
> "^[[:space:]]*\"\\(.*\\)\"[[:space:]]*$"
I do not see why we should limit things to single-line strings.
> Is there a reason why it is necessary to call `read' twice on the same
> content? From my point of view, result of first call may be returned.
Yes, it can.
> Does `read' have other role than unescaping backslash-protected
> characters? Likely it can be done by `replace-regexp-in-string', see the
> attachment. ...
> +(defconst org-babel--quoted-string-regexp
> ...
1. read is faster
2. read is less maintenance - we can rely upon robust implementation
provided by Emacs itself instead of doing something custom, with
potential bugs.
--
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>
- Re: [BUG] ob-shell: results missing leading quotes, Max Nikulin, 2024/05/01
- Importing "quoted" strings in `org-babel-import-elisp-from-file' (was: [BUG] ob-shell: results missing leading quotes), Ihor Radchenko, 2024/05/01
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Max Nikulin, 2024/05/02
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Ihor Radchenko, 2024/05/03
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Max Nikulin, 2024/05/04
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file',
Ihor Radchenko <=
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Max Nikulin, 2024/05/04
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Ihor Radchenko, 2024/05/04
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Max Nikulin, 2024/05/04
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Ihor Radchenko, 2024/05/04
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Max Nikulin, 2024/05/04
- Re: Importing "quoted" strings in `org-babel-import-elisp-from-file', Ihor Radchenko, 2024/05/04