From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: funkyj Newsgroups: gmane.emacs.help Subject: help: windows emacs is adding CR to my .abbrev_defs files! Date: Sat, 8 Dec 2007 19:20:21 -0800 (PST) Organization: http://groups.google.com Message-ID: <246f9cc2-d13c-4140-b2a8-e5301dbbc785@s8g2000prg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197211332 23916 80.91.229.12 (9 Dec 2007 14:42:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2007 14:42:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 09 15:42:22 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J1NMG-0006i7-SJ for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Dec 2007 15:42:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1NLy-0006d4-6L for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Dec 2007 09:41:58 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s8g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 72 Original-NNTP-Posting-Host: 24.5.147.26 Original-X-Trace: posting.google.com 1197170422 21109 127.0.0.1 (9 Dec 2007 03:20:22 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 9 Dec 2007 03:20:22 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s8g2000prg.googlegroups.com; posting-host=24.5.147.26; posting-account=AuXI9AoAAADdbX1xpHh5izQg75fZiXs4 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:154517 X-Mailman-Approved-At: Sun, 09 Dec 2007 09:40:55 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49957 Archived-At: I'm using GNU Emacs 21.3.1 (i386-mingw-nt5.1.2600) of 2004-03-10 on NYAUMO on Windows XP and I'm having a problem where, when emacs writes an .abbrev_defs file it encodes the file in DOS format (i.e. CR at the end of each line). I have mostly succeeded in getting emacs to stop "helping" me with distinguishing between unix and DOS files by putting: (require 'dos-w32) (setq file-name-buffer-file-type-alist '((".*" . t))) in my .emacs. This tells emacs that ALL files are to be treated as binary so don't "help" me with the CRLF thing. abbrev.el defines this function: (defun write-abbrev-file (file) "Write all abbrev definitions to a file of Lisp code. The file written can be loaded in another session to define the same abbrevs. The argument FILE is the file name to write." (interactive (list (read-file-name "Write abbrev file: " (file-name-directory (expand-file-name abbrev- file-name)) abbrev-file-name))) (or (and file (> (length file) 0)) (setq file abbrev-file-name)) (save-excursion (set-buffer (get-buffer-create " write-abbrev-file")) (erase-buffer) (let ((tables abbrev-table-name-list)) (while tables (insert-abbrev-table-description (car tables) nil) (setq tables (cdr tables)))) (write-region 1 (point-max) file) (erase-buffer))) which does the work of writing my .abbrev_defs file. Looking at the help for 'write-region' It says: This does code conversion according to the value of `coding-system-for-write', `buffer-file-coding-system', or `file-coding-system-alist', and sets the variable `last-coding-system-used' to the coding system actually used. I think I'm getting warm but, being only an occasional emacs lisp interloper I have not yet figured out the solution. I see that the default value emacs shows me buffer-file-coding-system's value is iso-latin-1-dos I tried changing this variable to nil but my change always seems to be buffer local!? I also looked at 'file-coding-system-alist' and 'find-buffer-file-type-coding-system' but I'm in over my head here. All I want is for Emacs to NEVER EVER "help" me by adding CR to the end of lines. I also don't want emacs to "help" me by making CR characters invisible rather than showing me "^M" in the buffer (I think my 'dos-w32' code above successfully does this). I would appreciate it if any of you emacs lisp gurus can close this issue.