emacs-devel
[Top][All Lists]
Advanced

[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: 2014年7月29日 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."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]

AltStyle によって変換されたページ (->オリジナル) /