[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Raw string literals in Emacs lisp.
From: |
Andreas Schwab |
Subject: |
Re: Raw string literals in Emacs lisp. |
Date: |
Tue, 29 Jul 2014 09:40:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
William Xu <address@hidden> writes:
> Here is one of my recent use case: "quote bashslash in a shell command".
This is not about shell command syntax, but about Lisp syntax.
> http://permalink.gmane.org/gmane.emacs.help/98550
>
> The shell command is:
> echo foo.bar | sed -e 's/\..*//'
>
> which will produce "foo" on bash.
>
> If i try to pass it to shell-command-to-string:
> (shell-command-to-string "echo foo.bar | sed -e 's/\..*//'")
> => "\n"
>
> Then i find i need to quote the backslash in emacs once more:
> (shell-command-to-string "echo foo.bar | sed -e 's/\\..*//'")
> => "foo\n"
>
> Is there a function or other way that can handle this kind of backslash
> quoting automatically?
Since this is part of the Lisp syntax, so there is no way to solve that
programmatically.
Andreas.
--
Andreas Schwab, SUSE Labs, address@hidden
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
- Re: Raw string literals in Emacs lisp., (continued)
- Re: Raw string literals in Emacs lisp., Matthew Plant, 2014/07/27
- Re: Raw string literals in Emacs lisp., Richard Stallman, 2014/07/28
- Re: Raw string literals in Emacs lisp., Matthew Plant, 2014/07/28
- Re: Raw string literals in Emacs lisp., Richard Stallman, 2014/07/29
- Re: Raw string literals in Emacs lisp., Matthew Plant, 2014/07/29
- Re: Raw string literals in Emacs lisp., Stephen J. Turnbull, 2014/07/27
- Re: Raw string literals in Emacs lisp., Andreas Schwab, 2014/07/28
- Re: Raw string literals in Emacs lisp., Stephen J. Turnbull, 2014/07/27
Re: Raw string literals in Emacs lisp., Thorsten Jolitz, 2014/07/26
Re: Raw string literals in Emacs lisp., William Xu, 2014/07/29
- Re: Raw string literals in Emacs lisp.,
Andreas Schwab <=