From owner-ntemacs-users@june  Mon Oct 28 03:19:00 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" "28" "October" "1996" "11:38:18" "+0100" "Frederic Corne" "frederic.corne@erli.fr" nil "24" "Pb of crlf with Samba and untranslate" "^From:" nil nil "10" 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.6/7.2ju) with SMTP id DAA24308 for <voelker@june.cs.washington.edu>; Mon, 28 Oct 1996 03:19:00 -0800
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 DAA24432 for <voelker@joker.cs.washington.edu>; Mon, 28 Oct 1996 03:18:59 -0800
Received: from polaris.gsi.fr (polaris.gsi.fr [150.175.128.2]) by june.cs.washington.edu (8.7.6/7.2ju) with ESMTP id CAA22938 for <ntemacs-users@cs.washington.edu>; Mon, 28 Oct 1996 02:39:37 -0800
Received: from erli.fr ([150.175.65.76]) by polaris.gsi.fr (8.7.3/8.6.12) with SMTP id LAA00381 for <ntemacs-users@cs.washington.edu>; Mon, 28 Oct 1996 11:40:26 +0100 (MET)
Received: from orme.sunserv by erli.fr (4.1/SMI-4.1) 	id AA05437; Mon, 28 Oct 96 11:38:20 +0100
Received: by orme.sunserv (5.x/SMI-SVR4) 	id AA06096; Mon, 28 Oct 1996 11:38:18 +0100
Message-Id: <9610281038.AA06096@orme.sunserv>
Reply-To: frederic.corne@erli.fr
From: Frederic Corne <frederic.corne@erli.fr>
To: ntemacs-users@cs.washington.edu
Subject: Pb of crlf with Samba and untranslate
Date: Mon, 28 Oct 1996 11:38:18 +0100


I have installed Samba 1.9.16p7 on my unix box and I use 
untranslate.el with emacs19.31.1 on my NT machine.

(load "untranslate")
(add-untranslated-filesystem "E:")

at the top of my .emacs file

When I read and write a simple file ( for ex a README file)
all are OK. No crlf before and after.

But when the file is of a particular mode (c, c++, text, ...) the read is
correct ( no crlf) but when I save the file after modification, crlf is added.


Any idea ?


FC

-- 

****  Frederic CORNE   GSI-ERLI  frederic.corne@erli.fr ****

From owner-ntemacs-users@june  Mon Jul  8 18:15:24 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" " 9" "July" "1996" "10:32:24" "+1000" "Adrian Tulloch" "adrian@mpce.mq.edu.au" nil "42" "Dealing with Unix file systems" "^From:" nil nil "7" 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 SAA04946 for <voelker@june.cs.washington.edu>; Mon, 8 Jul 1996 18:15:23 -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 SAA25727 for <voelker@joker.cs.washington.edu>; Mon, 8 Jul 1996 18:15:21 -0700
Received: from krakatoa.mpce.mq.edu.au (krakatoa.mpce.mq.edu.au [137.111.240.12]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id RAA01738 for <ntemacs-users@cs.washington.edu>; Mon, 8 Jul 1996 17:36:38 -0700
Received: from adrian.mpce.mq.edu.au (adrian.mpce.mq.edu.au [137.111.245.25]) by krakatoa.mpce.mq.edu.au (8.6.12/8.6.12) with SMTP id KAA23244 for <ntemacs-users@cs.washington.edu>; Tue, 9 Jul 1996 10:36:36 +1000
Received: by adrian.mpce.mq.edu.au with Microsoft Mail 	id <01BB6D81.EBE6F090@adrian.mpce.mq.edu.au>; Tue, 9 Jul 1996 10:32:25 +1000
Message-ID: <01BB6D81.EBE6F090@adrian.mpce.mq.edu.au>
Encoding: 42 TEXT
From: Adrian Tulloch <adrian@mpce.mq.edu.au>
To: "'NT Emacs Users'" <ntemacs-users@cs.washington.edu>
Subject: Dealing with Unix file systems
Date: Tue, 9 Jul 1996 10:32:24 +1000

I guess that we're all familiar with the problems caused by different 
line-end conventions in the Dos and Unix worlds: Dos uses CR-LF to mark the 
end of a line, and Unix uses just LF.

NT Emacs currently takes an "all or nothing" approach to this problem.  You 
can say that  *all* your file systems are unix, with 
(using-unix-filesystems t), otherwise they're *all* assumed to be dos-like 
systems.  This is something that I guess many people would like to see 
fixed, however, it's likely that different people will want this fixed in 
different ways.

To start the ball rolling I'll tell you how I've fixed the problem for 
myself.  If you see a better way, let me know, and I'll implement, 
otherwise I'll submit my code to Andrew and Geoff for Emacs 19.32.

There's a useful API in Win32 called GetVolumeInformation().  This, amongst 
other things, returns a string representing the type of the file system. 
 I've  put a wrapper around this function, and made it a Lisp primitive:
	(win32-get-volume-type "c:\\")
returns "NTFS",  for a NTFS file system, "FAT" for a FAT file system, and, 
more importantly, "Samba" if the drive is mapped to a Unix share via Samba. 
 After this lisp function is available, it's easy to add a write-file hook 
which looks at the destination we're saving the file in, and saves it as a 
Dos or unix text file, depending on the type of the file system.  There's 
no need for the user to maintain a table of drive-letter file system 
correspondences; Emacs can work out the type of file system for itself.

Does anyone see any problems with this approach?  Personally, I only see 
one problem.  It's possible that GetVolumeInformation() doesn't return 
useful results for non-Samba unix file systems, such as systems mounted 
with an NFS client for NT.  If the API doesn't return a unique string for 
these file systems, Emacs won't be able to work out that these disks are 
unix disks.  However, I don't' have access to any of these more exotic file 
systems, so I can't test this.  If anybody out there is using this sort of 
configuration, I'd appreciate it if you could send me a reply, so we can 
work out how to test this.

As I said earlier, if you can see a better way to deal with this problem, 
let me know, and I'll change my code.  Otherwise I'll send my current fix 
to Geoff and Andrew.

Adrian

From eric@globalnet.co.uk  Wed Nov 20 03:38:28 1996
X-VM-v5-Data: ([nil nil nil nil t nil nil nil nil]
	[nil "Wed" "20" "November" "1996" "11:40:09" "GMT" "Eric Barton" "eric@globalnet.co.uk" "<199611201140.LAA29622@gollum.globalnet.co.uk>" "29" "Binary/Text files" "^From:" nil nil "11" nil nil nil nil]
	nil)
Received: from gollum.globalnet.co.uk (gollum.globalnet.co.uk [194.126.80.109]) by june.cs.washington.edu (8.8.3/7.2ju) with ESMTP id DAA13784 for <voelker@cs.washington.edu>; Wed, 20 Nov 1996 03:38:27 -0800
Received: from EBPC (client8536.globalnet.co.uk [194.126.85.54]) by gollum.globalnet.co.uk (8.7.6/8.6.9) with SMTP id LAA29622; Wed, 20 Nov 1996 11:40:09 GMT
Message-Id: <199611201140.LAA29622@gollum.globalnet.co.uk>
From: Eric Barton <eric@globalnet.co.uk>
To: voelker@cs.washington.edu
cc: eric@globalnet.co.uk
Subject: Binary/Text files
Date: Wed, 20 Nov 1996 11:40:09 GMT


First let me congratulate you on providing an *EXCELLENT* service.  Emacs
on NT is a real life saver for people moving over from UNIX.  Thank you,
thank you, thank you, thank you:)

I've come across a "feature" that causes binary files to become cluttered
with ^M when an NT text file is included.  I'm using untranslate.el for
files on my UNIX server, but when I include an NT text file, the whole file
gets treated like an NT text file.  I guess the problem comes down to
'insert-file-contents modifying the attributes of the whole file (buffer?),
when it reads something in; I would have thought it should just affect the
processing of the included region.  Maybe the text/binary processing should
be decided both as the file is read (to maybe strip ^M) and saved (to maybe
add ^M).

In GNU Emacs 19.34.1 (i386-*-nt4.0) of Thu Aug 29 1996 on BANANA-FISH
configured using `configure NT'

-- 
                Cheers,
                        Eric

---------------------------------------------------
|Eric Barton          Barton Software             |
|9 York Gardens                                   |
|Clifton              Tel   : +44 117 974 2587    |
|Bristol BS8 4LL      Fax   : +44 117 974 2587    |
|United Kingdom       E-Mail: eric@globalnet.co.uk|
---------------------------------------------------

From eric@globalnet.co.uk  Thu Nov 21 07:00:21 1996
X-VM-v5-Data: ([nil nil nil nil t nil nil nil nil]
	[nil "Thu" "21" "November" "1996" "14:58:33" "GMT" "Eric Barton" "eric@globalnet.co.uk" "<199611211502.PAA07129@gollum.globalnet.co.uk>" "26" "Re: Binary/Text files" "^From:" nil nil "11" nil nil nil nil]
	nil)
Received: from gollum.globalnet.co.uk (gollum.globalnet.co.uk [194.126.80.109]) by june.cs.washington.edu (8.8.3/7.2ju) with ESMTP id HAA02316 for <voelker@cs.washington.edu>; Thu, 21 Nov 1996 07:00:19 -0800
Received: from stegeosaurus (client8463.globalnet.co.uk [194.126.84.99]) by gollum.globalnet.co.uk (8.7.6/8.6.9) with SMTP id PAA07129 for <voelker@cs.washington.edu>; Thu, 21 Nov 1996 15:02:45 GMT
Message-Id: <199611211502.PAA07129@gollum.globalnet.co.uk>
Received: by stegeosaurus (5.x) id AA01456; Thu, 21 Nov 1996 14:58:33 GMT
In-Reply-To: <199611210732.XAA29015@joker.cs.washington.edu> (message from 	Geoff Voelker on Wed, 20 Nov 1996 23:25:10 -0800 (PST))
From: Eric Barton <eric@globalnet.co.uk>
To: voelker@cs.washington.edu
Subject: Re: Binary/Text files
Date: Thu, 21 Nov 1996 14:58:33 GMT


Geoff,

Just an additional note...

1/ Do find-file on an NT text file
2/ Save it onto a UNIX file system (with untranslate.el loaded)
3/ Do revert-buffer (lots of ^M-s appear)

(2) should not have added the ^M-s on the way out?

Isn't the file on the O/S the only thing that has a type?  All the
stripping/adding ^M is surely meant to convert from typed file to generic
buffer.

-- 
         Respectfully,
                        Eric

---------------------------------------------------
|Eric Barton          Barton Software             |
|9 York Gardens                                   |
|Clifton              Tel   : +44 117 974 2587    |
|Bristol BS8 4LL      Fax   : +44 117 974 2587    |
|United Kingdom       E-Mail: eric@globalnet.co.uk|
---------------------------------------------------

