From owner-ntemacs-users@june  Mon Sep 23 01:48:57 1996
X-VM-v5-Data: ([nil nil nil nil nil nil t nil nil]
	[nil "Mon" "23" "September" "1996" "08:51:13" "+0000" "Ronan Waide" "waider@autodealing.com" nil "29" "Re: File-name completion in CMD.EXE!" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id BAA13616 for <voelker@june.cs.washington.edu>; Mon, 23 Sep 1996 01:48:56 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id BAA30613 for <voelker@joker.cs.washington.edu>; Mon, 23 Sep 1996 01:48:55 -0700
Received: from mail (gate.autodealing.com [194.125.131.131]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id AAA12516 for <ntemacs-users@cs.washington.edu>; Mon, 23 Sep 1996 00:50:59 -0700
Received: from Waider.autodealing.com(really [194.9.15.139]) by mail 	via sendmail with smtp 	id <m0v56jR-000AznC@mail> 	for <ntemacs-users@cs.washington.edu>; Mon, 23 Sep 96 08:51:13 +0000 (GMT) 	(Smail-3.1.93 1996-May-30 #2 built 1996-Jun-28)
Message-Id: <m0v56jR-000AznC@mail>
In-Reply-To: <19960920202413631.AAA241@developer16>
References: <19960920202413631.AAA241@developer16>
Organization: AutoDealing Software, Ltd.
From: Ronan Waide <waider@autodealing.com>
To: mstrock@sequeltech.com (Mike Strock)
Cc: ntemacs-users@cs.washington.edu
Subject: Re: File-name completion in CMD.EXE!
Date: Mon, 23 Sep 96 08:51:13 +0000 (GMT)

Some time in September, Mike Strock said:
> I set mine (in NT 4.0 Workstation) to 9 Hex. Works great.
> 
> Hope that helps.
> 
> Mike Strock
> mstrock@sequeltech.com
> http://www.sequeltech.com/
> Disclaimer: I speak  only for myself, not SeQuel Technology.
> 
> ----------
> > From: Peter Breton <pbreton@volte-2.i-kinetics.com>
[snip]
> > 
> > There was no key "HKEY_CURRENT_USER\Software\Microsoft\Command
> Processor",
> > so I created one, created a CompletionChar key and set its value to 
> > type REG_DWORD, value 9 decimal.

heheh.

0x9 (hex) is the same as 9 decimal. Really. Things don't diverge until
after 9.

Waider. Thanks for a free grin on Monday morning :)
-- 
waider@autodealing.com / AutoDealing Software Ltd / +353-1-6766455

"These are indeed harsh times for the dim." - jott@snugbug.cts.com

From rms@gnu.ai.mit.edu  Sun Sep  8 09:02:42 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Sun" " 8" "September" "1996" "12:02:24" "-0400" "Richard Stallman" "rms@gnu.ai.mit.edu" nil "28" "[raymondp@stack.urc.tue.nl: CON file name]" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from psilocin.gnu.ai.mit.edu (psilocin.gnu.ai.mit.edu [128.52.46.62]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id JAA00310 for <voelker@cs.washington.edu>; Sun, 8 Sep 1996 09:02:41 -0700
Received: by psilocin.gnu.ai.mit.edu (8.6.12/8.6.12GNU) id MAA01546; Sun, 8 Sep 1996 12:02:24 -0400
Message-Id: <199609081602.MAA01546@psilocin.gnu.ai.mit.edu>
Reply-to: rms@gnu.ai.mit.edu
From: Richard Stallman <rms@gnu.ai.mit.edu>
To: voelker@cs.washington.edu, andrewi@harlequin.co.uk
Subject: [raymondp@stack.urc.tue.nl: CON file name]
Date: Sun, 8 Sep 1996 12:02:24 -0400

Could one of you please look at this?  19.32 is not very different
from the latest release.

------- Start of forwarded message -------
To: bug-gnu-emacs@prep.ai.mit.edu
Subject: CON file name
From: Raymond Penners <raymondp@stack.urc.tue.nl>
Date: 07 Sep 1996 19:47:38 +0200
Lines: 18

In GNU Emacs 19.32.1 (i386-*-win954.0) of Sat Aug 10 1996 on SPHINX
configured using `configure NT'

In short, Emacs (well, Win 95 actually :) crashes when one tries to
find a file called "con.c".

For example: I have "complete.el" loaded, and when I try to find a
file "console.c" I mostly type:

	C-x C-f con.c M-ret

After that "complete.el" should complete "con.c" to "console.c", but
it first checks if "con.c" exists and crashes. The result is a total
system lockup.

- -- 
Raymond Penners <raymondp@stack.urc.tue.nl>
------- End of forwarded message -------

From andrewi@harlequin.co.uk  Mon Sep  9 09:15:27 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" " 9" "September" "1996" "17:13:53" "+0100" "Andrew Innes" "andrewi@harlequin.co.uk" nil "73" "Re: [raymondp@stack.urc.tue.nl: CON file name]" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from holly.cam.harlequin.co.uk (holly.cam.harlequin.co.uk [193.128.4.58]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id JAA04455 for <voelker@cs.washington.edu>; Mon, 9 Sep 1996 09:15:24 -0700
Received: from propos.long.harlequin.co.uk by holly.cam.harlequin.co.uk; Mon, 9 Sep 1996 17:15:22 +0100
Received: from elan.long.harlequin.co.uk (elan [193.128.93.78]) by propos.long.harlequin.co.uk (8.6.12/8.6.12) with SMTP id RAA02343; Mon, 9 Sep 1996 17:13:53 +0100
Message-Id: <199609091613.RAA02343@propos.long.harlequin.co.uk>
In-Reply-To: <199609081602.MAA01546@psilocin.gnu.ai.mit.edu> (message from 	Richard Stallman on Sun, 8 Sep 1996 12:02:24 -0400)
From: Andrew Innes <andrewi@harlequin.co.uk>
To: rms@gnu.ai.mit.edu
Cc: voelker@cs.washington.edu
Subject: Re: [raymondp@stack.urc.tue.nl: CON file name]
Date: Mon, 9 Sep 1996 17:13:53 +0100

On Sun, 8 Sep 1996 12:02:24 -0400, Richard Stallman <rms@gnu.ai.mit.edu> said:
>Could one of you please look at this?  19.32 is not very different
>from the latest release.

I know what the problem is, but I'm not sure how best to avoid it.  (To
some extent, the problem applies to all DOS and NT versions of Emacs.)

The problem is that DOS and NT define several "reserved" file names to
refer to specific devices.  So "CON" (and several variants such as
"CON:" and "CON.xxx") refer the the console handle (equivalent of
/dev/tty on Unix).  Likewise "PRN", "LPT1", "LPT2", ... (and variants as
for CON) refer to various parallel (Centronics) printer ports, and
"AUX", "COM1", "COM2", ... refer to serial ports.  Case doesn't matter;
neither does any directory prefix.

Because of this special handling by the OS, you cannot have a file whose
base name (without extension) is any of these reserved names.  If you
attempt to read or write such a file, it is directed to the specific
device, with all the consequences that implies.  If you try to rename a
file to one containing a reserved name, the operation fails, and so on.

The only way I can think of at the moment to detect these problem names
is by textual examination and comparison with a list of known names that
are reserved.

I guess the only reasonable thing we can do is check for these "illegal"
file names in our shadowing of the open and fopen calls, and force those
calls to fail (see below).  Possibly there is an error code that could
be used or invented to indicate why the open fails.

Does this sound like a reasonable approach?

AndrewI

BTW, the exact problem being hit below is that when Emacs tries to load
con.c, it actually starts reading from the console input handle.  

In 19.30, Emacs on Windows did not have a console handle, so the open
call would simply fail and Emacs would not appear to hang.

In 19.31 and later, Emacs on Windows does have a valid console handle,
so the read blocks waiting for the user to type input - unfortunately
the console window is normally hidden to avoid screen clutter, but even
if it is not hidden the user would probably not think to type ^Z to
terminate the read (there is no indication in the console window that
Emacs is trying to read from it).


>------- Start of forwarded message -------
>To: bug-gnu-emacs@prep.ai.mit.edu
>Subject: CON file name
>From: Raymond Penners <raymondp@stack.urc.tue.nl>
>Date: 07 Sep 1996 19:47:38 +0200
>Lines: 18
>
>In GNU Emacs 19.32.1 (i386-*-win954.0) of Sat Aug 10 1996 on SPHINX
>configured using `configure NT'
>
>In short, Emacs (well, Win 95 actually :) crashes when one tries to
>find a file called "con.c".
>
>For example: I have "complete.el" loaded, and when I try to find a
>file "console.c" I mostly type:
>
>	C-x C-f con.c M-ret
>
>After that "complete.el" should complete "con.c" to "console.c", but
>it first checks if "con.c" exists and crashes. The result is a total
>system lockup.
>
>- -- 
>Raymond Penners <raymondp@stack.urc.tue.nl>
>------- End of forwarded message -------

From owner-ntemacs-users@june  Mon Sep  9 10:44:40 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" " 9" "September" "1996" "09:54:28" "-0700" "Mark D. Grosen" "mdgrosen@spectron.com" nil "22" "comint-completion-addsuffix and shell-mode hook" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id KAA13759 for <voelker@june.cs.washington.edu>; Mon, 9 Sep 1996 10:44:40 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id KAA15586 for <voelker@joker.cs.washington.edu>; Mon, 9 Sep 1996 10:44:32 -0700
Received: from nic.cerf.net (nic.cerf.net [192.102.249.3]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id JAA08054 for <ntemacs-users@cs.washington.edu>; Mon, 9 Sep 1996 09:54:03 -0700
Received: from spectron.COM ([146.152.131.1]) by nic.cerf.net (8.7.5/8.6.9) with SMTP id JAA24615 for <ntemacs-users@cs.washington.edu>; Mon, 9 Sep 1996 09:53:59 -0700 (PDT)
Received: from tsmbeta.spectron.com by spectron.COM (4.1/SMI-4.1) 	id AA11008; Mon, 9 Sep 96 09:53:55 PDT
Message-Id: <2.2.32.19960909165428.00878c24@spox>
X-Sender: mg@spox
X-Mailer: Windows Eudora Pro Version 2.2 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: "Mark D. Grosen" <mdgrosen@spectron.COM>
To: ntemacs-users@cs.washington.edu
Subject: comint-completion-addsuffix and shell-mode hook
Date: Mon, 09 Sep 1996 09:54:28 -0700

I use the MKS Toolkit and its Korn shell under emacs. This shell uses "/"
as the path separator. As a result, I would like to have
comint-completion-addsuffix use the Unix style "/" and " " as the dir and
file suffixes when doing completion.

The winnt.el file adds a hook for shell-mode that sets this var to ("\" . " ").
It appears that the standard binaries are dumped using this setting, so
this hook is built in. I added my own hook, but since hooks are executed in 
LIFO order, it does not do any good. I don't see how I can automatically
overcome this NT-specific default setting.

This is sort of a generic emacs question: How do you undo built in hooks?
The FAQ warns about depending about the ordering of hooks, but does not
suggest any workarounds.

Mark

Mark D. Grosen     mdgrosen@spectron.com      
Spectron Microsystems / A Dialogic Company
315 Bollay Drive
Goleta, CA 93117
805 968-5100       805 968-9770 (FAX)

From owner-ntemacs-users@june  Mon Sep  9 12:19:17 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" " 9" "September" "1996" "14:20:35" "-0400" "David Biesack" "sasdjb@unx.sas.com" nil "16" "> comint-completion-addsuffix and shell-mode hook" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id MAA24271 for <voelker@june.cs.washington.edu>; Mon, 9 Sep 1996 12:19:16 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id MAA15365 for <voelker@joker.cs.washington.edu>; Mon, 9 Sep 1996 12:19:13 -0700
Received: from lamb.sas.com (lamb.sas.com [192.35.83.8]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id LAA17724 for <ntemacs-users@cs.washington.edu>; Mon, 9 Sep 1996 11:20:41 -0700
Received: from mozart by lamb.sas.com (5.65c/SAS/Gateway/01-23-95) 	id AA27016; Mon, 9 Sep 1996 14:20:39 -0400
Received: from lambda.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90) 	id AA10521; Mon, 9 Sep 1996 14:20:35 -0400
Received: by lambda.unx.sas.com (5.65c/SAS/Generic 9.01/3-26-93) 	id AA26322; Mon, 9 Sep 1996 14:20:35 -0400
Message-Id: <199609091820.AA26322@lambda.unx.sas.com>
In-Reply-To: <2.2.32.19960909165428.00878c24@spox> (mdgrosen@spectron.com)
From: David Biesack <sasdjb@unx.sas.com>
To: ntemacs-users@cs.washington.edu
Subject: > comint-completion-addsuffix and shell-mode hook
Date: Mon, 9 Sep 1996 14:20:35 -0400


> The winnt.el file adds a hook for shell-mode that sets this var to ("\" . " ").
> It appears that the standard binaries are dumped using this setting, so
> this hook is built in. I added my own hook, but since hooks are executed in 
> LIFO order, it does not do any good. I don't see how I can automatically
> overcome this NT-specific default setting.
> 
> This is sort of a generic emacs question: How do you undo built in hooks?

check out advice.el ; you should be able to attach after advice
to the builtin hook.

-- 
David J. Biesack                                    sasdjb@unx.sas.com
Object Programming Technology                  (919) 677-8000 ext 7771
SAS Institute Inc. SAS Campus Drive Cary, NC 27513  http://www.sas.com

From owner-ntemacs-users@june  Mon Sep  9 15:38:18 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "10" "September" "1996" "09:30:46" "+1200" "Ulrich Roxburgh" "umr@clearfield.co.nz" nil "43" "Re: comint-completion-addsuffix and shell-mode hook" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id PAA17725 for <voelker@june.cs.washington.edu>; Mon, 9 Sep 1996 15:38:18 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id PAA19266 for <voelker@joker.cs.washington.edu>; Mon, 9 Sep 1996 15:38:10 -0700
Received: from Zeus.clearfield.co.nz (zeus.clearfield.co.nz [202.49.62.232]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id OAA10969 for <ntemacs-users@cs.washington.edu>; Mon, 9 Sep 1996 14:42:16 -0700
Received: from atlas ([202.49.62.193]) by Zeus.clearfield.co.nz (8.6.11/8.6.9) with ESMTP id KAA20695; Tue, 10 Sep 1996 10:50:53 +1200
Message-Id: <199609092250.KAA20695@Zeus.clearfield.co.nz>
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
From: "Ulrich Roxburgh" <umr@clearfield.co.nz>
To: "NT Emacs Mail List" <ntemacs-users@cs.washington.edu>,         "Mark D. Grosen" <mdgrosen@spectron.COM>
Subject: Re: comint-completion-addsuffix and shell-mode hook
Date: Tue, 10 Sep 1996 09:30:46 +1200

I also use the MKS toolkit (and highly recommend it). I don't know where I
got the following lines in my .emacs from, so I can't credit the
appropriate person, but it was someone on this list. Add the lines

;; Fix for filename completion
(add-hook 'shell-mode-hook '(lambda () (setq comint-file-name-quote-list
nil)))
(setq comint-completion-addsuffix '("/" . ""))
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)

to your .emacs. This seems to fully integrate the "/" and "\" features, and
remove trailing ^M as well. 

----------
> From: Mark D. Grosen <mdgrosen@spectron.COM>
> To: ntemacs-users@cs.washington.edu
> Subject: comint-completion-addsuffix and shell-mode hook
> Date: Tuesday, September 10, 1996 4:54 AM
> 
> I use the MKS Toolkit and its Korn shell under emacs. This shell uses "/"
> as the path separator. As a result, I would like to have
> comint-completion-addsuffix use the Unix style "/" and " " as the dir and
> file suffixes when doing completion.
> 
> The winnt.el file adds a hook for shell-mode that sets this var to ("\" .
" ").
> It appears that the standard binaries are dumped using this setting, so
> this hook is built in. I added my own hook, but since hooks are executed
in 
> LIFO order, it does not do any good. I don't see how I can automatically
> overcome this NT-specific default setting.
> 
> This is sort of a generic emacs question: How do you undo built in hooks?
> The FAQ warns about depending about the ordering of hooks, but does not
> suggest any workarounds.
> 
> Mark
> 
> Mark D. Grosen     mdgrosen@spectron.com      
> Spectron Microsystems / A Dialogic Company
> 315 Bollay Drive
> Goleta, CA 93117
> 805 968-5100       805 968-9770 (FAX)

From rms@gnu.ai.mit.edu  Tue Sep 10 13:10:11 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "10" "September" "1996" "16:10:11" "-0400" "Richard Stallman" "rms@gnu.ai.mit.edu" nil "11" "Re: [raymondp@stack.urc.tue.nl: CON file name]" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from ethanol.gnu.ai.mit.edu (ethanol.gnu.ai.mit.edu [128.52.46.64]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id NAA08955 for <voelker@cs.washington.edu>; Tue, 10 Sep 1996 13:10:11 -0700
Received: by ethanol.gnu.ai.mit.edu (8.6.12/8.6.12GNU) id QAA16753; Tue, 10 Sep 1996 16:10:11 -0400
Message-Id: <199609102010.QAA16753@ethanol.gnu.ai.mit.edu>
In-reply-to: <199609091613.RAA02343@propos.long.harlequin.co.uk> (message from 	Andrew Innes on Mon, 9 Sep 1996 17:13:53 +0100)
From: Richard Stallman <rms@gnu.ai.mit.edu>
To: andrewi@harlequin.co.uk
CC: voelker@cs.washington.edu
Subject: Re: [raymondp@stack.urc.tue.nl: CON file name]
Date: Tue, 10 Sep 1996 16:10:11 -0400

    I guess the only reasonable thing we can do is check for these "illegal"
    file names in our shadowing of the open and fopen calls, and force those
    calls to fail (see below).  Possibly there is an error code that could
    be used or invented to indicate why the open fails.

I am not sure we want to reject these file names for all purposes.
For example, I don't see any harm in write-region to a serial
port or a printer (and I believe that may be used currently).

So I think some of these names should be rejected only for certain uses,
not at the level of `open'.

