unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* non-interactive shell
@ 2008-03-23  1:27 B. T. Raven
  2008-03-23  4:20 ` Eli Zaretskii
       [not found] ` <mailman.9354.1206246069.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: B. T. Raven @ 2008-03-23  1:27 UTC (permalink / raw)
  To: help-gnu-emacs

Apparently it's not possible to make a new directory with:

  (shell-command (concat "md " path))

where path is some string like

"\\a\\b\\c"

Is it possible at all to make a directory under the default-directory 
with elisp and using a variable rather than a literal string. Of course 
M-! works fine but that requires manual intervention. If this is not 
possible on the w32 port, can it be done in Emacs under Gnu/Linux?


Thanks for any help,

Ed


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

* Re: non-interactive shell
  2008-03-23  1:27 non-interactive shell B. T. Raven
@ 2008-03-23  4:20 ` Eli Zaretskii
       [not found] ` <mailman.9354.1206246069.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2008-03-23  4:20 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 22 Mar 2008 19:27:04 -0600
> From: "B. T. Raven" <nihil@nihilo.net>
> 
> Apparently it's not possible to make a new directory with:
> 
>   (shell-command (concat "md " path))
> 
> where path is some string like
> 
> "\\a\\b\\c"

It works for me.  What happened on your machine, and which version of
Emacs did you use?

> Is it possible at all to make a directory under the default-directory 
> with elisp and using a variable rather than a literal string.

Of course, it is.  But I'd suggest to use Emacs primitives instead of
an external command:

  (make-directory path t)




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

* Re: non-interactive shell
       [not found] ` <mailman.9354.1206246069.18990.help-gnu-emacs@gnu.org>
@ 2008-03-23 18:34   ` B. T. Raven
  2008-03-23 19:59     ` Drew Adams
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: B. T. Raven @ 2008-03-23 18:34 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:
>> Date: Sat, 22 Mar 2008 19:27:04 -0600
>> From: "B. T. Raven" <nihil@nihilo.net>
>>
>> Apparently it's not possible to make a new directory with:
>>
>>   (shell-command (concat "md " path))
>>
>> where path is some string like
>>
>> "\\a\\b\\c"
> 
> It works for me.  What happened on your machine, and which version of
> Emacs did you use?

w32 22.1 but I was having trouble with knowing when Emacs would 
translate / into \ when needed. After studying directory-file-name and 
file-directory-name and some other functions new to me, I did get it to 
work.

> 
>> Is it possible at all to make a directory under the default-directory 
>> with elisp and using a variable rather than a literal string.
> 
> Of course, it is.  But I'd suggest to use Emacs primitives instead of
> an external command:
> 
>   (make-directory path t)
> 
> 

That one is new to me too. I'll use it but if I add parents arg I will 
have to learn how to handle the "Cancel" error. I could have found it 
with C-h a but I didn't think the function I needed would be among the 
commands. Is there a way to do apropos with C-h f ?
Anyway since I have cygwin df on this w2000 machine and I recently 
learned here about file-system-info on the "Dired hd drives list" thread 
I was trying to write a quick and dirty "Sneakernet" and backup program, 
polysave ["Save current buffer to other filesystems (i.e. flash drives, 
cd's, dvds, floppy) if they are mounted and with same relative path."]

Thanks, Eli; it (sort of) works now, for what it's worth.




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

* RE: non-interactive shell
  2008-03-23 18:34   ` B. T. Raven
@ 2008-03-23 19:59     ` Drew Adams
  2008-03-23 20:38     ` Eli Zaretskii
       [not found]     ` <mailman.9361.1206304747.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2008-03-23 19:59 UTC (permalink / raw)
  To: 'B. T. Raven', help-gnu-emacs

> I could have found it with C-h a but I didn't think the
> function I needed would be among the 
> commands. Is there a way to do apropos with C-h f ?

Yes. In Icicles, `C-h f some-regexp S-TAB' shows you all functions whose names
match `some-regexp'. And you can change the regexp on the fly.

And whenever you use a command that expects a function or variable name as
input, you can see the complete help for selected completion candidates that
match your input, using `C-M-RET'.

Icicles also enhances the regular Emacs apropos commands in various ways.

http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Help_on_Candidates





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

* Re: non-interactive shell
  2008-03-23 18:34   ` B. T. Raven
  2008-03-23 19:59     ` Drew Adams
@ 2008-03-23 20:38     ` Eli Zaretskii
       [not found]     ` <mailman.9361.1206304747.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2008-03-23 20:38 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 23 Mar 2008 12:34:25 -0600
> From: "B. T. Raven" <nihil@nihilo.net>
> 
> >   (make-directory path t)
> > 
> > 
> 
> That one is new to me too. I'll use it but if I add parents arg I will 
> have to learn how to handle the "Cancel" error. I could have found it 
> with C-h a but I didn't think the function I needed would be among the 
> commands. Is there a way to do apropos with C-h f ?

You mean, "M-x apropos-command RET"?




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

* Re: non-interactive shell
       [not found]     ` <mailman.9361.1206304747.18990.help-gnu-emacs@gnu.org>
@ 2008-03-24 22:16       ` B. T. Raven
  0 siblings, 0 replies; 6+ messages in thread
From: B. T. Raven @ 2008-03-24 22:16 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:
>> Date: Sun, 23 Mar 2008 12:34:25 -0600
>> From: "B. T. Raven" <nihil@nihilo.net>
>>
>>>   (make-directory path t)
>>>
>>>
>> That one is new to me too. I'll use it but if I add parents arg I will 
>> have to learn how to handle the "Cancel" error. I could have found it 
>> with C-h a but I didn't think the function I needed would be among the 
>> commands. Is there a way to do apropos with C-h f ?
> 
> You mean, "M-x apropos-command RET"?
> 
> 
  Both give me the same prompt anyway:

Apropos command (word list or regexp):

So I think it's ok to refer to the default key bindings for the sake of 
brevity. Anyway, what I wrote about "Cancel" error should refer to 
(write-file filespec confirm) since that needs error handling more often 
than make-directory (and parents).



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

end of thread, other threads:[~2008-03-24 22:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-23  1:27 non-interactive shell B. T. Raven
2008-03-23  4:20 ` Eli Zaretskii
     [not found] ` <mailman.9354.1206246069.18990.help-gnu-emacs@gnu.org>
2008-03-23 18:34   ` B. T. Raven
2008-03-23 19:59     ` Drew Adams
2008-03-23 20:38     ` Eli Zaretskii
     [not found]     ` <mailman.9361.1206304747.18990.help-gnu-emacs@gnu.org>
2008-03-24 22:16       ` B. T. Raven

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).