public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: where was mention of what creates NUL files?
Date: Thu, 27 Jun 2013 19:00:00 -0000	[thread overview]
Message-ID: <51CC8B0C.9070809@cornell.edu> (raw)
In-Reply-To: <loom.20130626T202645-269@post.gmane.org>

On 6/26/2013 2:53 PM, g wrote:
>
>
>
> Daniel Barclay <daniel <at> fgm.com> writes:
>
>>
>> Does anyone recall a mention of what in CygWin (or possibly Emacs) creates
>> files with a simple name of "NUL"?
>>
>> Thanks,
>> Daniel
>>
>>
>
>
> This has been driving me nuts for years. Finally tracked it down.
> These are created by emacs' man.el code when you get a man page.
> Reproduce:
> In emacs, do:
>      M-x man <ret>
>      <enter anything, valid ('ls') or not>
> Now, you'll see a NUL file in the directory.

I can't reproduce this with Cygwin emacs.  You must be using native 
Windows emacs.

> Root cause:
> construction of the 'man' command that is passed to the shell includes:
> (concat " %s 2>" null-device)
>
> The variable `null-device' is platform specific and defaults to a pure-copy
> of "/dev/null" which, apparently, becomes "NUL" on windows.
>
> It is a defvar in files.el and 'set' again in dos-w32.el.
>
> Resolution:
> In your .emacs file, do:
>
>     (require 'dos-w32) ;; load this first to avoid it undo'ing the next line
>     (setq null-device "c:/tmp/emacs-dev-null.txt") ;; set to anything

Just to be clear, users of Cygwin emacs should *not* do this.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2013-06-27 18:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17 18:01 Daniel Barclay
2010-09-17 18:02 ` Eric Blake
2010-09-17 22:46   ` Corinna Vinschen
2010-09-18  3:37     ` Daniel Barclay
2010-09-20 10:22 ` Oleksandr Gavenko
2013-06-27 18:35 ` g
2013-06-27 19:00   ` Ken Brown [this message]
2013-06-27 22:32     ` wynfield

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=51CC8B0C.9070809@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    /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.
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).