unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* shell-unquote-argument: throws error if called outside a shell buffer
@ 2017-03-11 21:01 raman
  2017-03-11 23:10 ` Andreas Politz
  0 siblings, 1 reply; 4+ messages in thread
From: raman @ 2017-03-11 21:01 UTC (permalink / raw)
  To: emacs-devel

Function shell-unquote-argument throws  an  error when called from
lisp if the buffer at the time of the call is not a shell buffer --
bug or feature? The doc string does not imply that the function needs
to be called in a shell buffer.
-- 

-- 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: shell-unquote-argument: throws error if called outside a shell buffer
  2017-03-11 21:01 shell-unquote-argument: throws error if called outside a shell buffer raman
@ 2017-03-11 23:10 ` Andreas Politz
  2017-03-12  2:48   ` raman
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Politz @ 2017-03-11 23:10 UTC (permalink / raw)
  To: raman; +Cc: emacs-devel


I assume this is a problem of name-spaces.  While `shell-quote-argument'
lives in subr.el, where the prefix denotes "functionality related to
shells", its would-be companion function `shell-unquote-argument' is
defined in shell.el and is not supposed to be used outside that
libraries scope (i.e. a *shell* buffer), as is e.g. shell-resync-dirs.

-ap



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: shell-unquote-argument: throws error if called outside a shell buffer
  2017-03-11 23:10 ` Andreas Politz
@ 2017-03-12  2:48   ` raman
  2017-03-12 15:17     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: raman @ 2017-03-12  2:48 UTC (permalink / raw)
  To: Andreas Politz; +Cc: emacs-devel

Andreas Politz <politza@hochschule-trier.de> writes:
Yes, namespacing -- plus incomplete documentation.
shell-unquote-argument is a compiled Lisp function in `shell.el'.

(shell-unquote-argument STRING)

Remove all kinds of shell quoting from STRING.

[back]

> I assume this is a problem of name-spaces.  While `shell-quote-argument'
> lives in subr.el, where the prefix denotes "functionality related to
> shells", its would-be companion function `shell-unquote-argument' is
> defined in shell.el and is not supposed to be used outside that
> libraries scope (i.e. a *shell* buffer), as is e.g. shell-resync-dirs.
>
> -ap

-- 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: shell-unquote-argument: throws error if called outside a shell buffer
  2017-03-12  2:48   ` raman
@ 2017-03-12 15:17     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2017-03-12 15:17 UTC (permalink / raw)
  To: raman; +Cc: politza, emacs-devel

> From: raman <raman@google.com>
> Date: Sat, 11 Mar 2017 18:48:12 -0800
> Cc: emacs-devel@gnu.org
> 
> Andreas Politz <politza@hochschule-trier.de> writes:
> Yes, namespacing -- plus incomplete documentation.
> shell-unquote-argument is a compiled Lisp function in `shell.el'.
> 
> (shell-unquote-argument STRING)
> 
> Remove all kinds of shell quoting from STRING.

I think this is simply a bug: the only reason that function wants a
shell buffer is to access the name of the shell process running in
it.  It could instead fall back on some system-dependent default, and
perhaps also provide a way for Lisp callers to specify the shell.

Patches to that effect are welcome.  (I'm also in favor of moving this
function to subr.el, while at that.)

TIA



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-12 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-11 21:01 shell-unquote-argument: throws error if called outside a shell buffer raman
2017-03-11 23:10 ` Andreas Politz
2017-03-12  2:48   ` raman
2017-03-12 15:17     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).