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

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

Re: woman doesn't work if current buffer's directory doesn't exist


From: Chris Moore
Subject: Re: woman doesn't work if current buffer's directory doesn't exist
Date: Wed, 24 Jan 2007 22:58:37 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

Kevin Rodgers <address@hidden> writes:

> It should signal an error, that the directory doesn't exist.  How
> does one create a buffer whose default-directory doesn't exist?

One finds a file or creates a buffer which isn't associated with a
file, but has default-directory set anyway, and then has someone else:

  rename the directory containing the file
or
  rename one of the directories higher up the tree
or
  umount the filesystem holding the file
or
  ...

I don't see why I shouldn't be allowed to pipe the contents of a
buffer through 'wc -w' for example to count the words in the buffer
just because the buffer's default-directory doesn't exist.

In the case where I first saw this bug, the buffer in question wasn't
associated with a file at all.  I had simply typed "C-x b tmp RET" to
create a temporary buffer.  I was in a '*shell*' buffer at the time,
which was in the "~/tmp/foo" directory.  The 'tmp' buffer which I
created therefore had a default-directory of "~/tmp/foo" - a directory
which I then deleted before attempting to run a shell command on the
contents of the tmp buffer.

Note that when checking for the existance of default-directory, we
need to take the filename handlers into account.  /ssh:address@hidden:/tmp
might look like a bad pathname, but it makes sense to Tramp.




reply via email to

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