emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell-command-on-region


From: Stefan Monnier
Subject: Re: shell-command-on-region
Date: 19 Aug 2004 09:52:28 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>> Better use the lower level commands call-process, start-process, and friends
>> when you want to run a command from Lisp.
> Thanks for your reply.  Is this a proposed solution or a workaround?
> I have other ways to work around the problem, but I wanted to know the
> official oppinion on the issue.

I don't think it's an official position, but it is based on the following:
- several Emacs commands are rarely appropriate for use as functions in
  Elisp (`set-mark', `perform-replace', `switch-to-buffer',
  `beginning-of-buffer', ...).  Most of these commands do more than what
  meets the eye.
- shell-command looks like it's in the same class since it does a fair bit
  of extra stuff that is rarely useful when called as an Elisp function
  rather than an Emacs command.  It also has the side effect of passing the
  command to `sh' which is great when that's what you need, but otherwise
  has the severe disadvantage that you have to be extra careful to correctly
  quote all your arguments and you have to be careful with the fact that in
  some systems (think w32) it's not `sh' but some other command language
  with different semantics.


        Stefan




reply via email to

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