aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-02-09 14:52:01 +0200
committerEli Zaretskii2013-02-09 14:52:01 +0200
commit8549f9e89bd9288c4c709d183a5bf8f07dbeed3d (patch)
treed1c618cc8dd547322911fc5dab74b7a3235f6448
parent2cdd55fc764336b5dee1e69842b9cc2d28976041 (diff)
downloademacs-8549f9e89bd9288c4c709d183a5bf8f07dbeed3d.tar.gz
emacs-8549f9e89bd9288c4c709d183a5bf8f07dbeed3d.zip
Remove all references to buffer-file-type and related features.
src/xdisp.c (decode_mode_spec): Remove handling of %t. lisp/net/ange-ftp.el (ange-ftp-insert-file-contents): Don't reference buffer-file-type. lisp/mail/feedmail.el (feedmail-force-binary-write): Doc fix. (feedmail-run-the-queue, feedmail-dump-message-to-queue) (feedmail-send-it-immediately): Don't bind buffer-file-type, bind coding-system-for-write instead. lisp/jka-compr.el (jka-compr-write-region): Don't bind buffer-file-type. lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't bind buffer-file-type. lisp/files.el (file-name-buffer-file-type-alist): Remove defvar. (insert-file-contents-literally): Remove reference to file-name-buffer-file-type-alist. lisp/dos-w32.el (file-name-buffer-file-type-alist): Deprecate and make-obsolete. (find-buffer-file-type-match, find-buffer-file-type): Remove. (find-buffer-file-type-coding-system): Remove references to find-buffer-file-type-match, find-buffer-file-type, and buffer-file-type. Don't put find-buffer-file-type-coding-system into file-coding-system-alist. (find-file-binary, find-file-text): Bind coding-system-for-read instead of file-name-buffer-file-type-alist. lisp/erc/erc-dcc.el (erc-dcc-get-file): Don't reference buffer-file-type. doc/emacs/msdog.texi (Text and Binary): Delete the description of file-name-buffer-file-type-alist. doc/lispref/modes.texi (%-Constructs): Remove the description of %t. doc/lispref/nonascii.texi (MS-DOS File Types): Delete node. Fixes: debbugs:12989
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/msdog.texi23
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/modes.texi5
-rw-r--r--doc/lispref/nonascii.texi58
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/ChangeLog31
-rw-r--r--lisp/arc-mode.el5
-rw-r--r--lisp/dos-w32.el90
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/erc-dcc.el1
-rw-r--r--lisp/files.el3
-rw-r--r--lisp/jka-compr.el2
-rw-r--r--lisp/mail/feedmail.el23
-rw-r--r--lisp/net/ange-ftp.el6
-rw-r--r--src/ChangeLog2
-rw-r--r--src/xdisp.c3
19 files changed, 95 insertions, 182 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 3b7ab6527aa..d2f44eabb0e 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
12013-02-09 Eli Zaretskii <eliz@gnu.org>
2
3 * msdog.texi (Text and Binary): Delete the description of
4 file-name-buffer-file-type-alist.
5
12013-01-19 Paul Eggert <eggert@cs.ucla.edu> 62013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * trouble.texi (Crashing): Suggest -p for newer addr2line. (Bug#13445) 8 * trouble.texi (Crashing): Suggest -p for newer addr2line. (Bug#13445)
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi
index 2c22c89a113..0f01958b51c 100644
--- a/doc/emacs/msdog.texi
+++ b/doc/emacs/msdog.texi
@@ -218,29 +218,6 @@ set conversion, only end-of-line conversion. Essentially, it directs
218Emacs to create new files with the Unix-style convention of using 218Emacs to create new files with the Unix-style convention of using
219newline at the end of a line. @xref{Coding Systems}. 219newline at the end of a line. @xref{Coding Systems}.
220 220
221@vindex file-name-buffer-file-type-alist
222@cindex binary files, on MS-DOS/MS-Windows
223 Some kinds of files should not be converted at all, because their
224contents are not really text. Therefore, Emacs on MS-Windows distinguishes
225certain files as @dfn{binary files}. (This distinction is not part of
226MS-Windows; it is made by Emacs only.) Binary files include executable
227programs, compressed archives, etc. Emacs uses the file name to decide
228whether to treat a file as binary: the variable
229@code{file-name-buffer-file-type-alist} defines the file-name patterns
230that indicate binary files. If a file name matches one of the patterns
231for binary files (those whose associations are of the type
232@code{(@var{pattern} . t)}, Emacs reads and writes that file using the
233@code{no-conversion} coding system (@pxref{Coding Systems}) which turns
234off @emph{all} coding-system conversions, not only the EOL conversion.
235@code{file-name-buffer-file-type-alist} also includes file-name patterns
236for files which are known to be Windows-style text files with
237carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs
238always writes those files with Windows-style EOLs.
239
240 If a file that belongs to an untranslated file system matches one of
241the file-name patterns in @code{file-name-buffer-file-type-alist}, the
242EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
243
244@node Windows Files 221@node Windows Files
245@section File Names on MS-Windows 222@section File Names on MS-Windows
246@cindex file names on MS-Windows 223@cindex file names on MS-Windows
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 7c444a038af..90b2349387f 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12013-02-09 Eli Zaretskii <eliz@gnu.org>
2
3 * modes.texi (%-Constructs): Remove the description of %t.
4
5 * nonascii.texi (MS-DOS File Types): Delete node.
6
12013-02-08 Glenn Morris <rgm@gnu.org> 72013-02-08 Glenn Morris <rgm@gnu.org>
2 8
3 * keymaps.texi (Active Keymaps, Searching Keymaps): 9 * keymaps.texi (Active Keymaps, Searching Keymaps):
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 127b22086d0..3d1c4cf577d 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1209,8 +1209,6 @@ Coding Systems
1209 for a single file operation. 1209 for a single file operation.
1210* Explicit Encoding:: Encoding or decoding text without doing I/O. 1210* Explicit Encoding:: Encoding or decoding text without doing I/O.
1211* Terminal I/O Encoding:: Use of encoding for terminal I/O. 1211* Terminal I/O Encoding:: Use of encoding for terminal I/O.
1212* MS-DOS File Types:: How DOS "text" and "binary" files
1213 relate to coding systems.
1214 1212
1215Searching and Matching 1213Searching and Matching
1216 1214
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 29aba877ba2..71ce2bb9271 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2150,11 +2150,6 @@ visible on screen; or @samp{Bottom} or @samp{All}.
2150The status of the subprocess belonging to the current buffer, obtained with 2150The status of the subprocess belonging to the current buffer, obtained with
2151@code{process-status}. @xref{Process Information}. 2151@code{process-status}. @xref{Process Information}.
2152 2152
2153@item %t
2154Whether the visited file is a text file or a binary file. This is a
2155meaningful distinction only on certain operating systems (@pxref{MS-DOS
2156File Types}).
2157
2158@item %z 2153@item %z
2159The mnemonics of keyboard, terminal, and buffer coding systems. 2154The mnemonics of keyboard, terminal, and buffer coding systems.
2160 2155
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 9ad68be60cb..e462c3b4ce4 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -855,8 +855,6 @@ documented here.
855 for a single file operation. 855 for a single file operation.
856* Explicit Encoding:: Encoding or decoding text without doing I/O. 856* Explicit Encoding:: Encoding or decoding text without doing I/O.
857* Terminal I/O Encoding:: Use of encoding for terminal I/O. 857* Terminal I/O Encoding:: Use of encoding for terminal I/O.
858* MS-DOS File Types:: How DOS "text" and "binary" files
859 relate to coding systems.
860@end menu 858@end menu
861 859
862@node Coding System Basics 860@node Coding System Basics
@@ -1775,62 +1773,6 @@ for encoding terminal output from @var{terminal}. If
1775@code{nil}, that means the currently selected frame's terminal. 1773@code{nil}, that means the currently selected frame's terminal.
1776@end deffn 1774@end deffn
1777 1775
1778@node MS-DOS File Types
1779@subsection MS-DOS File Types
1780@cindex DOS file types
1781@cindex MS-DOS file types
1782@cindex Windows file types
1783@cindex file types on MS-DOS and Windows
1784@cindex text files and binary files
1785@cindex binary files and text files
1786
1787 On MS-DOS and Microsoft Windows, Emacs guesses the appropriate
1788end-of-line conversion for a file by looking at the file's name. This
1789feature classifies files as @dfn{text files} and @dfn{binary files}. By
1790``binary file'' we mean a file of literal byte values that are not
1791necessarily meant to be characters; Emacs does no end-of-line conversion
1792and no character code conversion for them. On the other hand, the bytes
1793in a text file are intended to represent characters; when you create a
1794new file whose name implies that it is a text file, Emacs uses DOS
1795end-of-line conversion.
1796
1797@defvar buffer-file-type
1798This variable, automatically buffer-local in each buffer, records the
1799file type of the buffer's visited file. When a buffer does not specify
1800a coding system with @code{buffer-file-coding-system}, this variable is
1801used to determine which coding system to use when writing the contents
1802of the buffer. It should be @code{nil} for text, @code{t} for binary.
1803If it is @code{t}, the coding system is @code{no-conversion}.
1804Otherwise, @code{undecided-dos} is used.
1805
1806Normally this variable is set by visiting a file; it is set to
1807@code{nil} if the file was visited without any actual conversion.
1808
1809Its default value is used to decide how to handle files for which
1810@code{file-name-buffer-file-type-alist} says nothing about the type:
1811If the default value is non-@code{nil}, then these files are treated as
1812binary: the coding system @code{no-conversion} is used. Otherwise,
1813nothing special is done for them---the coding system is deduced solely
1814from the file contents, in the usual Emacs fashion.
1815@end defvar
1816
1817@defopt file-name-buffer-file-type-alist
1818This variable holds an alist for recognizing text and binary files.
1819Each element has the form (@var{regexp} . @var{type}), where
1820@var{regexp} is matched against the file name, and @var{type} may be
1821@code{nil} for text, @code{t} for binary, or a function to call to
1822compute which. If it is a function, then it is called with a single
1823argument (the file name) and should return @code{t} or @code{nil}.
1824
1825When running on MS-DOS or MS-Windows, Emacs checks this alist to decide
1826which coding system to use when reading a file. For a text file,
1827@code{undecided-dos} is used. For a binary file, @code{no-conversion}
1828is used.
1829
1830If no element in this alist matches a given file name, then
1831the default value of @code{buffer-file-type} says how to treat the file.
1832@end defopt
1833
1834@node Input Methods 1776@node Input Methods
1835@section Input Methods 1777@section Input Methods
1836@cindex input methods 1778@cindex input methods
diff --git a/etc/NEWS b/etc/NEWS
index f068110d5f0..d1723166b6e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -280,6 +280,12 @@ and ACL entries.
280The backtrace is written to the 'emacs_backtrace.txt' file in the 280The backtrace is written to the 'emacs_backtrace.txt' file in the
281directory where Emacs was running. 281directory where Emacs was running.
282 282
283+++
284** The variable `buffer-file-type' is no longer supported.
285Setting it has no effect, and %t in the mode-line format is ignored.
286Likewise, `file-name-buffer-file-type-alist' is now obsolete, and
287modifying it has no effect.
288
283 289
284* Installation Changes in Emacs 24.3 290* Installation Changes in Emacs 24.3
285 291
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f5b6daf16d8..0712f9a1fc8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,34 @@
12013-02-09 Eli Zaretskii <eliz@gnu.org>
2
3 * net/ange-ftp.el (ange-ftp-insert-file-contents): Don't reference
4 buffer-file-type.
5
6 * mail/feedmail.el (feedmail-force-binary-write): Doc fix.
7 (feedmail-run-the-queue, feedmail-dump-message-to-queue)
8 (feedmail-send-it-immediately): Don't bind buffer-file-type, bind
9 coding-system-for-write instead.
10
11 * jka-compr.el (jka-compr-write-region): Don't bind
12 buffer-file-type.
13
14 * emacs-lisp/bytecomp.el (byte-compile-file): Don't bind
15 buffer-file-type.
16
17 * files.el (file-name-buffer-file-type-alist): Remove defvar.
18 (insert-file-contents-literally): Remove reference to
19 file-name-buffer-file-type-alist.
20
21 * dos-w32.el (file-name-buffer-file-type-alist): Deprecate and
22 make-obsolete.
23 (find-buffer-file-type-match, find-buffer-file-type): Remove.
24 (find-buffer-file-type-coding-system): Remove references to
25 find-buffer-file-type-match, find-buffer-file-type, and
26 buffer-file-type.
27 Don't put find-buffer-file-type-coding-system into
28 file-coding-system-alist.
29 (find-file-binary, find-file-text): Bind coding-system-for-read
30 instead of file-name-buffer-file-type-alist.
31
12013-02-09 Tassilo Horn <tsdh@gnu.org> 322013-02-09 Tassilo Horn <tsdh@gnu.org>
2 33
3 * doc-view.el: Use (and prefer) soffice as default ODF->PDF 34 * doc-view.el: Use (and prefer) soffice as default ODF->PDF
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 8849fb85244..4fc04b706b5 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -975,11 +975,6 @@ using `make-temp-file', and the generated name is returned."
975 (save-excursion 975 (save-excursion
976 (funcall set-auto-coding-function 976 (funcall set-auto-coding-function
977 filename (- (point-max) (point-min))))) 977 filename (- (point-max) (point-min)))))
978 ;; dos-w32.el defines the function
979 ;; find-buffer-file-type-coding-system for DOS/Windows
980 ;; systems which preserves the coding-system of existing files.
981 ;; (That function is called via file-coding-system-alist.)
982 ;; Here, we want it to act as if the extracted file existed.
983 ;; The following let-binding of file-name-handler-alist forces 978 ;; The following let-binding of file-name-handler-alist forces
984 ;; find-file-not-found-set-buffer-file-coding-system to ignore 979 ;; find-file-not-found-set-buffer-file-coding-system to ignore
985 ;; the file's name (see dos-w32.el). 980 ;; the file's name (see dos-w32.el).
diff --git a/lisp/dos-w32.el b/lisp/dos-w32.el
index 5866edfc3d6..d6788ffe028 100644
--- a/lisp/dos-w32.el
+++ b/lisp/dos-w32.el
@@ -37,7 +37,7 @@
37;; Set the null device (for compile.el). 37;; Set the null device (for compile.el).
38(setq null-device "NUL") 38(setq null-device "NUL")
39 39
40;; For distinguishing file types based upon suffixes. 40;; For distinguishing file types based upon suffixes. DEPRECATED, DO NOT USE!
41(defcustom file-name-buffer-file-type-alist 41(defcustom file-name-buffer-file-type-alist
42 '(("[:/].*config.sys$" . nil) ; config.sys text 42 '(("[:/].*config.sys$" . nil) ; config.sys text
43 ("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|bin\\|ico\\|pif\\|class\\)$" . t) 43 ("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|bin\\|ico\\|pif\\|class\\)$" . t)
@@ -54,36 +54,18 @@
54 ("\\.tp[ulpw]$" . t) ; borland Pascal stuff 54 ("\\.tp[ulpw]$" . t) ; borland Pascal stuff
55 ("[:/]tags$" . nil) ; emacs TAGS file 55 ("[:/]tags$" . nil) ; emacs TAGS file
56 ) 56 )
57 "Alist for distinguishing text files from binary files. 57 "Alist used in the past for distinguishing text files from binary files.
58Each element has the form (REGEXP . TYPE), where REGEXP is matched 58Each element has the form (REGEXP . TYPE), where REGEXP is matched
59against the file name, and TYPE is nil for text, t for binary." 59against the file name, and TYPE is nil for text, t for binary.
60
61This variable is deprecated, not used anywhere, and will soon be deleted."
60 :type '(repeat (cons regexp boolean)) 62 :type '(repeat (cons regexp boolean))
61 :group 'dos-fns 63 :group 'dos-fns
62 :group 'w32) 64 :group 'w32)
63 65
64;; Return the pair matching filename on file-name-buffer-file-type-alist, 66(make-obsolete-variable 'file-name-buffer-file-type-alist
65;; or nil otherwise. 67 'file-coding-system-alist
66(defun find-buffer-file-type-match (filename) 68 "24.4")
67 (let ((alist file-name-buffer-file-type-alist)
68 (found nil))
69 (let ((case-fold-search t))
70 (setq filename (file-name-sans-versions filename))
71 (while (and (not found) alist)
72 (if (string-match (car (car alist)) filename)
73 (setq found (car alist)))
74 (setq alist (cdr alist)))
75 found)))
76
77;; Don't check for untranslated file systems here.
78(defun find-buffer-file-type (filename)
79 (let ((match (find-buffer-file-type-match filename))
80 (code))
81 (if (not match)
82 (default-value 'buffer-file-type)
83 (setq code (cdr match))
84 (cond ((memq code '(nil t)) code)
85 ((and (symbolp code) (fboundp code))
86 (funcall code filename))))))
87 69
88(setq-default buffer-file-coding-system 'undecided-dos) 70(setq-default buffer-file-coding-system 'undecided-dos)
89 71
@@ -99,9 +81,6 @@ and whether the file exists:
99 If it matches in `untranslated-filesystem-list': 81 If it matches in `untranslated-filesystem-list':
100 If the file exists: `undecided' 82 If the file exists: `undecided'
101 If the file does not exist: `undecided-unix' 83 If the file does not exist: `undecided-unix'
102 If it matches in `file-name-buffer-file-type-alist':
103 If the match is t (for binary): `no-conversion'
104 If the match is nil (for dos-text): `undecided-dos'
105 Otherwise: 84 Otherwise:
106 If the file exists: `undecided' 85 If the file exists: `undecided'
107 If the file does not exist default value of `buffer-file-coding-system' 86 If the file does not exist default value of `buffer-file-coding-system'
@@ -110,25 +89,23 @@ Note that the CAR of arguments to `insert-file-contents' operation could
110be a cons cell of the form \(FILENAME . BUFFER\), where BUFFER is a buffer 89be a cons cell of the form \(FILENAME . BUFFER\), where BUFFER is a buffer
111into which the file's contents were already read, but not yet decoded. 90into which the file's contents were already read, but not yet decoded.
112 91
113If operation is `write-region', the coding system is chosen based upon 92If operation is `write-region', the coding system is chosen based
114the value of `buffer-file-coding-system' and `buffer-file-type'. If 93upon the value of `buffer-file-coding-system'. If
115`buffer-file-coding-system' is non-nil, its value is used. If it is 94`buffer-file-coding-system' is non-nil, its value is used.
116nil and `buffer-file-type' is t, the coding system is `no-conversion'.
117Otherwise, it is `undecided-dos'. 95Otherwise, it is `undecided-dos'.
118 96
119The two most common situations are when DOS and Unix files are read 97The most common situation is when DOS and Unix files are read and
120and written, and their names do not match in 98written, and their names do not match in `untranslated-filesystem-list'.
121`untranslated-filesystem-list' and `file-name-buffer-file-type-alist'. 99In these cases, the coding system initially will be `undecided'.
122In these cases, the coding system initially will be `undecided'. As 100As the file is read in the DOS case, the coding system will be
123the file is read in the DOS case, the coding system will be changed to 101changed to `undecided-dos' as CR/LFs are detected. As the file
124`undecided-dos' as CR/LFs are detected. As the file is read in the 102is read in the Unix case, the coding system will be changed to
125Unix case, the coding system will be changed to `undecided-unix' as 103`undecided-unix' as LFs are detected. In both cases,
126LFs are detected. In both cases, `buffer-file-coding-system' will be 104`buffer-file-coding-system' will be set to the appropriate coding
127set to the appropriate coding system, and the value of 105system, and the value of `buffer-file-coding-system' will be used
128`buffer-file-coding-system' will be used when writing the file." 106when writing the file."
129 107
130 (let ((op (nth 0 command)) 108 (let ((op (nth 0 command))
131 (binary nil) (text nil)
132 (undecided nil) (undecided-unix nil) 109 (undecided nil) (undecided-unix nil)
133 target target-buf) 110 target target-buf)
134 (cond ((eq op 'insert-file-contents) 111 (cond ((eq op 'insert-file-contents)
@@ -144,15 +121,8 @@ set to the appropriate coding system, and the value of
144 (and (bufferp (cdr target)) 121 (and (bufferp (cdr target))
145 (buffer-name (cdr target)))) 122 (buffer-name (cdr target))))
146 (setq target (car target))) 123 (setq target (car target)))
147 ;; First check for a file name that indicates 124 (cond ((or
148 ;; it is truly binary. 125 ;; For any existing file, decide based on contents.
149 (setq binary (find-buffer-file-type target))
150 (cond (binary)
151 ;; Next check for files that MUST use DOS eol conversion.
152 ((find-buffer-file-type-match target)
153 (setq text t))
154 ;; For any other existing file, decide based on contents.
155 ((or
156 (file-exists-p target) 126 (file-exists-p target)
157 ;; If TARGET does not exist as a file, replace its 127 ;; If TARGET does not exist as a file, replace its
158 ;; base name with TARGET-BUF and try again. This 128 ;; base name with TARGET-BUF and try again. This
@@ -167,9 +137,7 @@ set to the appropriate coding system, and the value of
167 ;; Next check for a non-DOS file system. 137 ;; Next check for a non-DOS file system.
168 ((untranslated-file-p target) 138 ((untranslated-file-p target)
169 (setq undecided-unix t))) 139 (setq undecided-unix t)))
170 (cond (binary '(no-conversion . no-conversion)) 140 (cond (undecided-unix '(undecided-unix . undecided-unix))
171 (text '(undecided-dos . undecided-dos))
172 (undecided-unix '(undecided-unix . undecided-unix))
173 (undecided '(undecided . undecided)) 141 (undecided '(undecided . undecided))
174 (t (cons (default-value 'buffer-file-coding-system) 142 (t (cons (default-value 'buffer-file-coding-system)
175 (default-value 'buffer-file-coding-system))))) 143 (default-value 'buffer-file-coding-system)))))
@@ -180,22 +148,18 @@ set to the appropriate coding system, and the value of
180 ;; Normally this is used only in a non-file-visiting 148 ;; Normally this is used only in a non-file-visiting
181 ;; buffer, because normally buffer-file-coding-system is non-nil 149 ;; buffer, because normally buffer-file-coding-system is non-nil
182 ;; in a file-visiting buffer. 150 ;; in a file-visiting buffer.
183 (if buffer-file-type 151 '(undecided-dos . undecided-dos))))))
184 '(no-conversion . no-conversion)
185 '(undecided-dos . undecided-dos)))))))
186
187(modify-coding-system-alist 'file "" 'find-buffer-file-type-coding-system)
188 152
189(defun find-file-binary (filename) 153(defun find-file-binary (filename)
190 "Visit file FILENAME and treat it as binary." 154 "Visit file FILENAME and treat it as binary."
191 (interactive "FFind file binary: ") 155 (interactive "FFind file binary: ")
192 (let ((file-name-buffer-file-type-alist '(("" . t)))) 156 (let ((coding-system-for-read 'no-conversion))
193 (find-file filename))) 157 (find-file filename)))
194 158
195(defun find-file-text (filename) 159(defun find-file-text (filename)
196 "Visit file FILENAME and treat it as a text file." 160 "Visit file FILENAME and treat it as a text file."
197 (interactive "FFind file text: ") 161 (interactive "FFind file text: ")
198 (let ((file-name-buffer-file-type-alist '(("" . nil)))) 162 (let ((coding-system-for-read 'undecided-dos))
199 (find-file filename))) 163 (find-file filename)))
200 164
201(defun find-file-not-found-set-buffer-file-coding-system () 165(defun find-file-not-found-set-buffer-file-coding-system ()
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 4e002cfc8cb..280a1bbc2dd 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1795,8 +1795,6 @@ The value is non-nil if there were no errors, nil if errors."
1795 (kill-emacs-hook 1795 (kill-emacs-hook
1796 (cons (lambda () (ignore-errors (delete-file tempfile))) 1796 (cons (lambda () (ignore-errors (delete-file tempfile)))
1797 kill-emacs-hook))) 1797 kill-emacs-hook)))
1798 (if (memq system-type '(ms-dos 'windows-nt))
1799 (setq buffer-file-type t))
1800 (write-region (point-min) (point-max) tempfile nil 1) 1798 (write-region (point-min) (point-max) tempfile nil 1)
1801 ;; This has the intentional side effect that any 1799 ;; This has the intentional side effect that any
1802 ;; hard-links to target-file continue to 1800 ;; hard-links to target-file continue to
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index bbe551c735d..cc7624dee03 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,7 @@
12013-02-09 Eli Zaretskii <eliz@gnu.org>
2
3 * erc-dcc.el (erc-dcc-get-file): Don't reference buffer-file-type.
4
12013-01-11 Dmitry Antipov <dmantipov@yandex.ru> 52013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2 6
3 * erc-dcc.el (erc-dcc-send-file): Use point-min-marker. 7 * erc-dcc.el (erc-dcc-send-file): Use point-min-marker.
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index c27bb629f9d..acb8febea80 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -942,7 +942,6 @@ filter and a process sentinel, and making the connection."
942 (set-buffer-multibyte nil)) 942 (set-buffer-multibyte nil))
943 943
944 (setq mode-line-process '(":%s") 944 (setq mode-line-process '(":%s")
945 buffer-file-type t
946 buffer-read-only t) 945 buffer-read-only t)
947 (setq erc-dcc-file-name file) 946 (setq erc-dcc-file-name file)
948 947
diff --git a/lisp/files.el b/lisp/files.el
index 3bc3059c68f..9fca70d36f7 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1983,8 +1983,6 @@ Do you want to revisit the file normally now? ")
1983 (after-find-file error (not nowarn))) 1983 (after-find-file error (not nowarn)))
1984 (current-buffer)))) 1984 (current-buffer))))
1985 1985
1986(defvar file-name-buffer-file-type-alist) ;From dos-w32.el.
1987
1988(defun insert-file-contents-literally (filename &optional visit beg end replace) 1986(defun insert-file-contents-literally (filename &optional visit beg end replace)
1989 "Like `insert-file-contents', but only reads in the file literally. 1987 "Like `insert-file-contents', but only reads in the file literally.
1990A buffer may be modified in several ways after reading into the buffer, 1988A buffer may be modified in several ways after reading into the buffer,
@@ -1996,7 +1994,6 @@ This function ensures that none of these modifications will take place."
1996 (after-insert-file-functions nil) 1994 (after-insert-file-functions nil)
1997 (coding-system-for-read 'no-conversion) 1995 (coding-system-for-read 'no-conversion)
1998 (coding-system-for-write 'no-conversion) 1996 (coding-system-for-write 'no-conversion)
1999 (file-name-buffer-file-type-alist '(("" . t)))
2000 (inhibit-file-name-handlers 1997 (inhibit-file-name-handlers
2001 ;; FIXME: Yuck!! We should turn insert-file-contents-literally 1998 ;; FIXME: Yuck!! We should turn insert-file-contents-literally
2002 ;; into a file operation instead! 1999 ;; into a file operation instead!
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index ac81cf0d52d..5664a890cb1 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -332,8 +332,6 @@ There should be no more than seven characters after the final `/'."
332 332
333 (with-current-buffer temp-buffer 333 (with-current-buffer temp-buffer
334 (let ((coding-system-for-write 'no-conversion)) 334 (let ((coding-system-for-write 'no-conversion))
335 (if (memq system-type '(ms-dos windows-nt))
336 (setq buffer-file-type t) )
337 (jka-compr-run-real-handler 'write-region 335 (jka-compr-run-real-handler 'write-region
338 (list (point-min) (point-max) 336 (list (point-min) (point-max)
339 filename 337 filename
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 4305094611a..0502e7f9487 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -590,7 +590,7 @@ header is fiddled after the From: header is fiddled."
590(defcustom feedmail-force-binary-write t 590(defcustom feedmail-force-binary-write t
591 "If non-nil, force writing file as binary (this applies to queues and Fcc:). 591 "If non-nil, force writing file as binary (this applies to queues and Fcc:).
592On systems where there is a difference between binary and text files, 592On systems where there is a difference between binary and text files,
593feedmail will temporarily manipulate the value of `buffer-file-type' 593feedmail will temporarily manipulate the value of `coding-system-for-write'
594to make the writing as binary. If nil, writing will be in text mode. 594to make the writing as binary. If nil, writing will be in text mode.
595On systems where there is no distinction or where it is controlled by other 595On systems where there is no distinction or where it is controlled by other
596variables or other means, this option has no effect." 596variables or other means, this option has no effect."
@@ -2016,7 +2016,6 @@ backup file names and the like)."
2016 (setq buffer-offer-save nil) 2016 (setq buffer-offer-save nil)
2017 (buffer-disable-undo blobby-buffer) 2017 (buffer-disable-undo blobby-buffer)
2018 (insert-file-contents-literally maybe-file) 2018 (insert-file-contents-literally maybe-file)
2019 (setq buffer-file-type t) ; binary
2020 (goto-char (point-min)) 2019 (goto-char (point-min))
2021 ;; if at least two line-endings with CRLF, translate the file 2020 ;; if at least two line-endings with CRLF, translate the file
2022 (if (looking-at ".*\r\n.*\r\n") 2021 (if (looking-at ".*\r\n.*\r\n")
@@ -2334,7 +2333,10 @@ mapped to mostly alphanumerics for safety."
2334 (setq filename buffer-file-name) 2333 (setq filename buffer-file-name)
2335 (setq filename (feedmail-create-queue-filename queue-directory))) 2334 (setq filename (feedmail-create-queue-filename queue-directory)))
2336 ;; make binary file on DOS/Windows 95/Windows NT, etc 2335 ;; make binary file on DOS/Windows 95/Windows NT, etc
2337 (let ((buffer-file-type feedmail-force-binary-write)) 2336 (let ((coding-system-for-write
2337 (if feedmail-force-binary-write
2338 'no-conversion
2339 coding-system-for-write)))
2338 (write-file filename)) 2340 (write-file filename))
2339 ;; convenient for moving from draft to q, for example 2341 ;; convenient for moving from draft to q, for example
2340 (if (and previous-buffer-file-name (or (not is-fqm) (not is-in-this-dir)) 2342 (if (and previous-buffer-file-name (or (not is-fqm) (not is-in-this-dir))
@@ -2571,26 +2573,27 @@ mapped to mostly alphanumerics for safety."
2571 ;; Re-insert and handle any Fcc fields (and, optionally, 2573 ;; Re-insert and handle any Fcc fields (and, optionally,
2572 ;; any Bcc). 2574 ;; any Bcc).
2573 (when fcc 2575 (when fcc
2574 (let ((old (default-value 'buffer-file-type))) 2576 (let ((coding-system-for-write
2577 (if (and (memq system-type '(ms-dos windows-nt))
2578 feedmail-force-binary-write)
2579 'no-conversion
2580 coding-system-for-write)))
2575 (unwind-protect 2581 (unwind-protect
2576 (progn 2582 (progn
2577 (setq-default buffer-file-type
2578 feedmail-force-binary-write)
2579 (insert fcc) 2583 (insert fcc)
2580 (unless feedmail-nuke-bcc-in-fcc 2584 (unless feedmail-nuke-bcc-in-fcc
2581 (if bcc-holder (insert bcc-holder)) 2585 (if bcc-holder (insert bcc-holder))
2582 (if resent-bcc-holder 2586 (if resent-bcc-holder
2583 (insert resent-bcc-holder))) 2587 (insert resent-bcc-holder)))
2584 2588
2585 (run-hooks 'feedmail-before-fcc-hook) 2589 (run-hooks 'feedmail-before-fcc-hook)
2586 2590
2587 (when feedmail-nuke-body-in-fcc 2591 (when feedmail-nuke-body-in-fcc
2588 (goto-char eoh-marker) 2592 (goto-char eoh-marker)
2589 (if (natnump feedmail-nuke-body-in-fcc) 2593 (if (natnump feedmail-nuke-body-in-fcc)
2590 (forward-line feedmail-nuke-body-in-fcc)) 2594 (forward-line feedmail-nuke-body-in-fcc))
2591 (delete-region (point) (point-max))) 2595 (delete-region (point) (point-max)))
2592 (mail-do-fcc eoh-marker)) 2596 (mail-do-fcc eoh-marker))))))
2593 (setq-default buffer-file-type old)))))
2594 ;; User bailed out of one-last-look. 2597 ;; User bailed out of one-last-look.
2595 (if feedmail-queue-runner-is-active 2598 (if feedmail-queue-runner-is-active
2596 (throw 'skip-me-q 'skip-me-q) 2599 (throw 'skip-me-q 'skip-me-q)
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 4f7d8092891..ea318ec3250 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3297,7 +3297,6 @@ system TYPE.")
3297 (name (ange-ftp-quote-string (nth 2 parsed))) 3297 (name (ange-ftp-quote-string (nth 2 parsed)))
3298 (temp (ange-ftp-make-tmp-name host)) 3298 (temp (ange-ftp-make-tmp-name host))
3299 (binary (ange-ftp-binary-file filename)) 3299 (binary (ange-ftp-binary-file filename))
3300 (buffer-file-type buffer-file-type)
3301 (abbr (ange-ftp-abbreviate-filename filename)) 3300 (abbr (ange-ftp-abbreviate-filename filename))
3302 (coding-system-used last-coding-system-used) 3301 (coding-system-used last-coding-system-used)
3303 size) 3302 size)
@@ -3322,10 +3321,7 @@ system TYPE.")
3322 size 3321 size
3323 (nth 1 (ange-ftp-real-insert-file-contents 3322 (nth 1 (ange-ftp-real-insert-file-contents
3324 temp visit beg end replace)) 3323 temp visit beg end replace))
3325 coding-system-used last-coding-system-used 3324 coding-system-used last-coding-system-used)
3326 ;; override autodetection of buffer file type
3327 ;; to ensure buffer is saved in DOS format
3328 buffer-file-type binary)
3329 (signal 'ftp-error 3325 (signal 'ftp-error
3330 (list 3326 (list
3331 "Opening input file:" 3327 "Opening input file:"
diff --git a/src/ChangeLog b/src/ChangeLog
index 173e1bf53ed..599c515e858 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
12013-02-09 Eli Zaretskii <eliz@gnu.org> 12013-02-09 Eli Zaretskii <eliz@gnu.org>
2 2
3 * xdisp.c (decode_mode_spec): Remove handling of %t.
4
3 * msdos.c (careadlinkatcwd): Remove. 5 * msdos.c (careadlinkatcwd): Remove.
4 6
52013-02-08 Stefan Monnier <monnier@iro.umontreal.ca> 72013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/src/xdisp.c b/src/xdisp.c
index 02f2ae5d961..7434cdf728c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -21525,9 +21525,6 @@ decode_mode_spec (struct window *w, register int c, int field_width,
21525 return "@"; 21525 return "@";
21526 } 21526 }
21527 21527
21528 case 't': /* indicate TEXT or BINARY */
21529 return "T";
21530
21531 case 'z': 21528 case 'z':
21532 /* coding-system (not including end-of-line format) */ 21529 /* coding-system (not including end-of-line format) */
21533 case 'Z': 21530 case 'Z':