all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jasen <xx@yy.zz>
Subject: Re: find a file and put it in a window
Date: Sun, 25 Jul 2004 22:34:40 -0700	[thread overview]
Message-ID: <kK0Nc.15293$%p4.5381@okepread04> (raw)
In-Reply-To: <mailman.1472.1090814571.1960.help-gnu-emacs@gnu.org>



Eli Zaretskii wrote:

>>From: Jasen <xx@yy.zz>
>>Newsgroups: gnu.emacs.help
>>Date: Sun, 25 Jul 2004 19:28:38 -0700
>>
>>I would like to find a file in a directory through a shell command:
>>
>>;; Get the newest version of file
>>   (setq file (string (shell command "ls -tc 
>>C:\\dir1\\dir2\\dir3/file*.txt | head -1")))
>>
>>;; Put the file is a windows
>>   (find-file-other-window file)
>>
>>The problem is that either Emacs or Windows can't interpret the full
>>file name along with directory path correctly and I don't know how to
>>fix it?
> 
> 
> I think the problem is that the string you get includes a newline
> after the name of the file.  You need to remove that before you use
> the string as a file name.
> 
> (You can see what string Emacs gets by using shell-command-to-string.)
> 
> 

Ok, I'm almost there but Emacs gets me an empty new file rather than the 
  existing file?  Could this be the problem of space in the directory 
path because I'm using Windows XP and there are spaces in the path? 
c:/Documents and Settings/austin/Local Settings/Temp

Thanks,
Austin

  parent reply	other threads:[~2004-07-26  5:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-26  2:28 find a file and put it in a window Jasen
2004-07-26  4:57 ` Eli Zaretskii
     [not found] ` <mailman.1472.1090814571.1960.help-gnu-emacs@gnu.org>
2004-07-26  5:34   ` Jasen [this message]
2004-07-26 18:26     ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2004-07-26  2:28 Jasen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='kK0Nc.15293$%p4.5381@okepread04' \
    --to=xx@yy.zz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.