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
This commit is contained in:
parent
2cdd55fc76
commit
8549f9e89b
19 changed files with 95 additions and 182 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
2013-02-09 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
|
* msdog.texi (Text and Binary): Delete the description of
|
||||||
|
file-name-buffer-file-type-alist.
|
||||||
|
|
||||||
2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
|
2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
* trouble.texi (Crashing): Suggest -p for newer addr2line. (Bug#13445)
|
* trouble.texi (Crashing): Suggest -p for newer addr2line. (Bug#13445)
|
||||||
|
|
|
||||||
|
|
@ -218,29 +218,6 @@ set conversion, only end-of-line conversion. Essentially, it directs
|
||||||
Emacs to create new files with the Unix-style convention of using
|
Emacs to create new files with the Unix-style convention of using
|
||||||
newline at the end of a line. @xref{Coding Systems}.
|
newline at the end of a line. @xref{Coding Systems}.
|
||||||
|
|
||||||
@vindex file-name-buffer-file-type-alist
|
|
||||||
@cindex binary files, on MS-DOS/MS-Windows
|
|
||||||
Some kinds of files should not be converted at all, because their
|
|
||||||
contents are not really text. Therefore, Emacs on MS-Windows distinguishes
|
|
||||||
certain files as @dfn{binary files}. (This distinction is not part of
|
|
||||||
MS-Windows; it is made by Emacs only.) Binary files include executable
|
|
||||||
programs, compressed archives, etc. Emacs uses the file name to decide
|
|
||||||
whether to treat a file as binary: the variable
|
|
||||||
@code{file-name-buffer-file-type-alist} defines the file-name patterns
|
|
||||||
that indicate binary files. If a file name matches one of the patterns
|
|
||||||
for binary files (those whose associations are of the type
|
|
||||||
@code{(@var{pattern} . t)}, Emacs reads and writes that file using the
|
|
||||||
@code{no-conversion} coding system (@pxref{Coding Systems}) which turns
|
|
||||||
off @emph{all} coding-system conversions, not only the EOL conversion.
|
|
||||||
@code{file-name-buffer-file-type-alist} also includes file-name patterns
|
|
||||||
for files which are known to be Windows-style text files with
|
|
||||||
carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs
|
|
||||||
always writes those files with Windows-style EOLs.
|
|
||||||
|
|
||||||
If a file that belongs to an untranslated file system matches one of
|
|
||||||
the file-name patterns in @code{file-name-buffer-file-type-alist}, the
|
|
||||||
EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
|
|
||||||
|
|
||||||
@node Windows Files
|
@node Windows Files
|
||||||
@section File Names on MS-Windows
|
@section File Names on MS-Windows
|
||||||
@cindex file names on MS-Windows
|
@cindex file names on MS-Windows
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
2013-02-09 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
|
* modes.texi (%-Constructs): Remove the description of %t.
|
||||||
|
|
||||||
|
* nonascii.texi (MS-DOS File Types): Delete node.
|
||||||
|
|
||||||
2013-02-08 Glenn Morris <rgm@gnu.org>
|
2013-02-08 Glenn Morris <rgm@gnu.org>
|
||||||
|
|
||||||
* keymaps.texi (Active Keymaps, Searching Keymaps):
|
* keymaps.texi (Active Keymaps, Searching Keymaps):
|
||||||
|
|
|
||||||
|
|
@ -1209,8 +1209,6 @@ Coding Systems
|
||||||
for a single file operation.
|
for a single file operation.
|
||||||
* Explicit Encoding:: Encoding or decoding text without doing I/O.
|
* Explicit Encoding:: Encoding or decoding text without doing I/O.
|
||||||
* Terminal I/O Encoding:: Use of encoding for terminal I/O.
|
* Terminal I/O Encoding:: Use of encoding for terminal I/O.
|
||||||
* MS-DOS File Types:: How DOS "text" and "binary" files
|
|
||||||
relate to coding systems.
|
|
||||||
|
|
||||||
Searching and Matching
|
Searching and Matching
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2150,11 +2150,6 @@ visible on screen; or @samp{Bottom} or @samp{All}.
|
||||||
The status of the subprocess belonging to the current buffer, obtained with
|
The status of the subprocess belonging to the current buffer, obtained with
|
||||||
@code{process-status}. @xref{Process Information}.
|
@code{process-status}. @xref{Process Information}.
|
||||||
|
|
||||||
@item %t
|
|
||||||
Whether the visited file is a text file or a binary file. This is a
|
|
||||||
meaningful distinction only on certain operating systems (@pxref{MS-DOS
|
|
||||||
File Types}).
|
|
||||||
|
|
||||||
@item %z
|
@item %z
|
||||||
The mnemonics of keyboard, terminal, and buffer coding systems.
|
The mnemonics of keyboard, terminal, and buffer coding systems.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -855,8 +855,6 @@ documented here.
|
||||||
for a single file operation.
|
for a single file operation.
|
||||||
* Explicit Encoding:: Encoding or decoding text without doing I/O.
|
* Explicit Encoding:: Encoding or decoding text without doing I/O.
|
||||||
* Terminal I/O Encoding:: Use of encoding for terminal I/O.
|
* Terminal I/O Encoding:: Use of encoding for terminal I/O.
|
||||||
* MS-DOS File Types:: How DOS "text" and "binary" files
|
|
||||||
relate to coding systems.
|
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node Coding System Basics
|
@node Coding System Basics
|
||||||
|
|
@ -1775,62 +1773,6 @@ for encoding terminal output from @var{terminal}. If
|
||||||
@code{nil}, that means the currently selected frame's terminal.
|
@code{nil}, that means the currently selected frame's terminal.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@node MS-DOS File Types
|
|
||||||
@subsection MS-DOS File Types
|
|
||||||
@cindex DOS file types
|
|
||||||
@cindex MS-DOS file types
|
|
||||||
@cindex Windows file types
|
|
||||||
@cindex file types on MS-DOS and Windows
|
|
||||||
@cindex text files and binary files
|
|
||||||
@cindex binary files and text files
|
|
||||||
|
|
||||||
On MS-DOS and Microsoft Windows, Emacs guesses the appropriate
|
|
||||||
end-of-line conversion for a file by looking at the file's name. This
|
|
||||||
feature classifies files as @dfn{text files} and @dfn{binary files}. By
|
|
||||||
``binary file'' we mean a file of literal byte values that are not
|
|
||||||
necessarily meant to be characters; Emacs does no end-of-line conversion
|
|
||||||
and no character code conversion for them. On the other hand, the bytes
|
|
||||||
in a text file are intended to represent characters; when you create a
|
|
||||||
new file whose name implies that it is a text file, Emacs uses DOS
|
|
||||||
end-of-line conversion.
|
|
||||||
|
|
||||||
@defvar buffer-file-type
|
|
||||||
This variable, automatically buffer-local in each buffer, records the
|
|
||||||
file type of the buffer's visited file. When a buffer does not specify
|
|
||||||
a coding system with @code{buffer-file-coding-system}, this variable is
|
|
||||||
used to determine which coding system to use when writing the contents
|
|
||||||
of the buffer. It should be @code{nil} for text, @code{t} for binary.
|
|
||||||
If it is @code{t}, the coding system is @code{no-conversion}.
|
|
||||||
Otherwise, @code{undecided-dos} is used.
|
|
||||||
|
|
||||||
Normally this variable is set by visiting a file; it is set to
|
|
||||||
@code{nil} if the file was visited without any actual conversion.
|
|
||||||
|
|
||||||
Its default value is used to decide how to handle files for which
|
|
||||||
@code{file-name-buffer-file-type-alist} says nothing about the type:
|
|
||||||
If the default value is non-@code{nil}, then these files are treated as
|
|
||||||
binary: the coding system @code{no-conversion} is used. Otherwise,
|
|
||||||
nothing special is done for them---the coding system is deduced solely
|
|
||||||
from the file contents, in the usual Emacs fashion.
|
|
||||||
@end defvar
|
|
||||||
|
|
||||||
@defopt file-name-buffer-file-type-alist
|
|
||||||
This variable holds an alist for recognizing text and binary files.
|
|
||||||
Each element has the form (@var{regexp} . @var{type}), where
|
|
||||||
@var{regexp} is matched against the file name, and @var{type} may be
|
|
||||||
@code{nil} for text, @code{t} for binary, or a function to call to
|
|
||||||
compute which. If it is a function, then it is called with a single
|
|
||||||
argument (the file name) and should return @code{t} or @code{nil}.
|
|
||||||
|
|
||||||
When running on MS-DOS or MS-Windows, Emacs checks this alist to decide
|
|
||||||
which coding system to use when reading a file. For a text file,
|
|
||||||
@code{undecided-dos} is used. For a binary file, @code{no-conversion}
|
|
||||||
is used.
|
|
||||||
|
|
||||||
If no element in this alist matches a given file name, then
|
|
||||||
the default value of @code{buffer-file-type} says how to treat the file.
|
|
||||||
@end defopt
|
|
||||||
|
|
||||||
@node Input Methods
|
@node Input Methods
|
||||||
@section Input Methods
|
@section Input Methods
|
||||||
@cindex input methods
|
@cindex input methods
|
||||||
|
|
|
||||||
6
etc/NEWS
6
etc/NEWS
|
|
@ -280,6 +280,12 @@ and ACL entries.
|
||||||
The backtrace is written to the 'emacs_backtrace.txt' file in the
|
The backtrace is written to the 'emacs_backtrace.txt' file in the
|
||||||
directory where Emacs was running.
|
directory where Emacs was running.
|
||||||
|
|
||||||
|
+++
|
||||||
|
** The variable `buffer-file-type' is no longer supported.
|
||||||
|
Setting it has no effect, and %t in the mode-line format is ignored.
|
||||||
|
Likewise, `file-name-buffer-file-type-alist' is now obsolete, and
|
||||||
|
modifying it has no effect.
|
||||||
|
|
||||||
|
|
||||||
* Installation Changes in Emacs 24.3
|
* Installation Changes in Emacs 24.3
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,34 @@
|
||||||
|
2013-02-09 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
|
* net/ange-ftp.el (ange-ftp-insert-file-contents): Don't reference
|
||||||
|
buffer-file-type.
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
* jka-compr.el (jka-compr-write-region): Don't bind
|
||||||
|
buffer-file-type.
|
||||||
|
|
||||||
|
* emacs-lisp/bytecomp.el (byte-compile-file): Don't bind
|
||||||
|
buffer-file-type.
|
||||||
|
|
||||||
|
* files.el (file-name-buffer-file-type-alist): Remove defvar.
|
||||||
|
(insert-file-contents-literally): Remove reference to
|
||||||
|
file-name-buffer-file-type-alist.
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2013-02-09 Tassilo Horn <tsdh@gnu.org>
|
2013-02-09 Tassilo Horn <tsdh@gnu.org>
|
||||||
|
|
||||||
* doc-view.el: Use (and prefer) soffice as default ODF->PDF
|
* doc-view.el: Use (and prefer) soffice as default ODF->PDF
|
||||||
|
|
|
||||||
|
|
@ -975,11 +975,6 @@ using `make-temp-file', and the generated name is returned."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(funcall set-auto-coding-function
|
(funcall set-auto-coding-function
|
||||||
filename (- (point-max) (point-min)))))
|
filename (- (point-max) (point-min)))))
|
||||||
;; dos-w32.el defines the function
|
|
||||||
;; find-buffer-file-type-coding-system for DOS/Windows
|
|
||||||
;; systems which preserves the coding-system of existing files.
|
|
||||||
;; (That function is called via file-coding-system-alist.)
|
|
||||||
;; Here, we want it to act as if the extracted file existed.
|
|
||||||
;; The following let-binding of file-name-handler-alist forces
|
;; The following let-binding of file-name-handler-alist forces
|
||||||
;; find-file-not-found-set-buffer-file-coding-system to ignore
|
;; find-file-not-found-set-buffer-file-coding-system to ignore
|
||||||
;; the file's name (see dos-w32.el).
|
;; the file's name (see dos-w32.el).
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
;; Set the null device (for compile.el).
|
;; Set the null device (for compile.el).
|
||||||
(setq null-device "NUL")
|
(setq null-device "NUL")
|
||||||
|
|
||||||
;; For distinguishing file types based upon suffixes.
|
;; For distinguishing file types based upon suffixes. DEPRECATED, DO NOT USE!
|
||||||
(defcustom file-name-buffer-file-type-alist
|
(defcustom file-name-buffer-file-type-alist
|
||||||
'(("[:/].*config.sys$" . nil) ; config.sys text
|
'(("[:/].*config.sys$" . nil) ; config.sys text
|
||||||
("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|bin\\|ico\\|pif\\|class\\)$" . t)
|
("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|bin\\|ico\\|pif\\|class\\)$" . t)
|
||||||
|
|
@ -54,36 +54,18 @@
|
||||||
("\\.tp[ulpw]$" . t) ; borland Pascal stuff
|
("\\.tp[ulpw]$" . t) ; borland Pascal stuff
|
||||||
("[:/]tags$" . nil) ; emacs TAGS file
|
("[:/]tags$" . nil) ; emacs TAGS file
|
||||||
)
|
)
|
||||||
"Alist for distinguishing text files from binary files.
|
"Alist used in the past for distinguishing text files from binary files.
|
||||||
Each element has the form (REGEXP . TYPE), where REGEXP is matched
|
Each element has the form (REGEXP . TYPE), where REGEXP is matched
|
||||||
against the file name, and TYPE is nil for text, t for binary."
|
against the file name, and TYPE is nil for text, t for binary.
|
||||||
|
|
||||||
|
This variable is deprecated, not used anywhere, and will soon be deleted."
|
||||||
:type '(repeat (cons regexp boolean))
|
:type '(repeat (cons regexp boolean))
|
||||||
:group 'dos-fns
|
:group 'dos-fns
|
||||||
:group 'w32)
|
:group 'w32)
|
||||||
|
|
||||||
;; Return the pair matching filename on file-name-buffer-file-type-alist,
|
(make-obsolete-variable 'file-name-buffer-file-type-alist
|
||||||
;; or nil otherwise.
|
'file-coding-system-alist
|
||||||
(defun find-buffer-file-type-match (filename)
|
"24.4")
|
||||||
(let ((alist file-name-buffer-file-type-alist)
|
|
||||||
(found nil))
|
|
||||||
(let ((case-fold-search t))
|
|
||||||
(setq filename (file-name-sans-versions filename))
|
|
||||||
(while (and (not found) alist)
|
|
||||||
(if (string-match (car (car alist)) filename)
|
|
||||||
(setq found (car alist)))
|
|
||||||
(setq alist (cdr alist)))
|
|
||||||
found)))
|
|
||||||
|
|
||||||
;; Don't check for untranslated file systems here.
|
|
||||||
(defun find-buffer-file-type (filename)
|
|
||||||
(let ((match (find-buffer-file-type-match filename))
|
|
||||||
(code))
|
|
||||||
(if (not match)
|
|
||||||
(default-value 'buffer-file-type)
|
|
||||||
(setq code (cdr match))
|
|
||||||
(cond ((memq code '(nil t)) code)
|
|
||||||
((and (symbolp code) (fboundp code))
|
|
||||||
(funcall code filename))))))
|
|
||||||
|
|
||||||
(setq-default buffer-file-coding-system 'undecided-dos)
|
(setq-default buffer-file-coding-system 'undecided-dos)
|
||||||
|
|
||||||
|
|
@ -99,9 +81,6 @@ and whether the file exists:
|
||||||
If it matches in `untranslated-filesystem-list':
|
If it matches in `untranslated-filesystem-list':
|
||||||
If the file exists: `undecided'
|
If the file exists: `undecided'
|
||||||
If the file does not exist: `undecided-unix'
|
If the file does not exist: `undecided-unix'
|
||||||
If it matches in `file-name-buffer-file-type-alist':
|
|
||||||
If the match is t (for binary): `no-conversion'
|
|
||||||
If the match is nil (for dos-text): `undecided-dos'
|
|
||||||
Otherwise:
|
Otherwise:
|
||||||
If the file exists: `undecided'
|
If the file exists: `undecided'
|
||||||
If the file does not exist default value of `buffer-file-coding-system'
|
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
|
||||||
be a cons cell of the form \(FILENAME . BUFFER\), where BUFFER is a buffer
|
be a cons cell of the form \(FILENAME . BUFFER\), where BUFFER is a buffer
|
||||||
into which the file's contents were already read, but not yet decoded.
|
into which the file's contents were already read, but not yet decoded.
|
||||||
|
|
||||||
If operation is `write-region', the coding system is chosen based upon
|
If operation is `write-region', the coding system is chosen based
|
||||||
the value of `buffer-file-coding-system' and `buffer-file-type'. If
|
upon the value of `buffer-file-coding-system'. If
|
||||||
`buffer-file-coding-system' is non-nil, its value is used. If it is
|
`buffer-file-coding-system' is non-nil, its value is used.
|
||||||
nil and `buffer-file-type' is t, the coding system is `no-conversion'.
|
|
||||||
Otherwise, it is `undecided-dos'.
|
Otherwise, it is `undecided-dos'.
|
||||||
|
|
||||||
The two most common situations are when DOS and Unix files are read
|
The most common situation is when DOS and Unix files are read and
|
||||||
and written, and their names do not match in
|
written, and their names do not match in `untranslated-filesystem-list'.
|
||||||
`untranslated-filesystem-list' and `file-name-buffer-file-type-alist'.
|
In these cases, the coding system initially will be `undecided'.
|
||||||
In these cases, the coding system initially will be `undecided'. As
|
As the file is read in the DOS case, the coding system will be
|
||||||
the file is read in the DOS case, the coding system will be changed to
|
changed to `undecided-dos' as CR/LFs are detected. As the file
|
||||||
`undecided-dos' as CR/LFs are detected. As the file is read in the
|
is read in the Unix case, the coding system will be changed to
|
||||||
Unix case, the coding system will be changed to `undecided-unix' as
|
`undecided-unix' as LFs are detected. In both cases,
|
||||||
LFs are detected. In both cases, `buffer-file-coding-system' will be
|
`buffer-file-coding-system' will be set to the appropriate coding
|
||||||
set to the appropriate coding system, and the value of
|
system, and the value of `buffer-file-coding-system' will be used
|
||||||
`buffer-file-coding-system' will be used when writing the file."
|
when writing the file."
|
||||||
|
|
||||||
(let ((op (nth 0 command))
|
(let ((op (nth 0 command))
|
||||||
(binary nil) (text nil)
|
|
||||||
(undecided nil) (undecided-unix nil)
|
(undecided nil) (undecided-unix nil)
|
||||||
target target-buf)
|
target target-buf)
|
||||||
(cond ((eq op 'insert-file-contents)
|
(cond ((eq op 'insert-file-contents)
|
||||||
|
|
@ -144,15 +121,8 @@ set to the appropriate coding system, and the value of
|
||||||
(and (bufferp (cdr target))
|
(and (bufferp (cdr target))
|
||||||
(buffer-name (cdr target))))
|
(buffer-name (cdr target))))
|
||||||
(setq target (car target)))
|
(setq target (car target)))
|
||||||
;; First check for a file name that indicates
|
(cond ((or
|
||||||
;; it is truly binary.
|
;; For any existing file, decide based on contents.
|
||||||
(setq binary (find-buffer-file-type target))
|
|
||||||
(cond (binary)
|
|
||||||
;; Next check for files that MUST use DOS eol conversion.
|
|
||||||
((find-buffer-file-type-match target)
|
|
||||||
(setq text t))
|
|
||||||
;; For any other existing file, decide based on contents.
|
|
||||||
((or
|
|
||||||
(file-exists-p target)
|
(file-exists-p target)
|
||||||
;; If TARGET does not exist as a file, replace its
|
;; If TARGET does not exist as a file, replace its
|
||||||
;; base name with TARGET-BUF and try again. This
|
;; base name with TARGET-BUF and try again. This
|
||||||
|
|
@ -167,9 +137,7 @@ set to the appropriate coding system, and the value of
|
||||||
;; Next check for a non-DOS file system.
|
;; Next check for a non-DOS file system.
|
||||||
((untranslated-file-p target)
|
((untranslated-file-p target)
|
||||||
(setq undecided-unix t)))
|
(setq undecided-unix t)))
|
||||||
(cond (binary '(no-conversion . no-conversion))
|
(cond (undecided-unix '(undecided-unix . undecided-unix))
|
||||||
(text '(undecided-dos . undecided-dos))
|
|
||||||
(undecided-unix '(undecided-unix . undecided-unix))
|
|
||||||
(undecided '(undecided . undecided))
|
(undecided '(undecided . undecided))
|
||||||
(t (cons (default-value 'buffer-file-coding-system)
|
(t (cons (default-value 'buffer-file-coding-system)
|
||||||
(default-value 'buffer-file-coding-system)))))
|
(default-value 'buffer-file-coding-system)))))
|
||||||
|
|
@ -180,22 +148,18 @@ set to the appropriate coding system, and the value of
|
||||||
;; Normally this is used only in a non-file-visiting
|
;; Normally this is used only in a non-file-visiting
|
||||||
;; buffer, because normally buffer-file-coding-system is non-nil
|
;; buffer, because normally buffer-file-coding-system is non-nil
|
||||||
;; in a file-visiting buffer.
|
;; in a file-visiting buffer.
|
||||||
(if buffer-file-type
|
'(undecided-dos . undecided-dos))))))
|
||||||
'(no-conversion . no-conversion)
|
|
||||||
'(undecided-dos . undecided-dos)))))))
|
|
||||||
|
|
||||||
(modify-coding-system-alist 'file "" 'find-buffer-file-type-coding-system)
|
|
||||||
|
|
||||||
(defun find-file-binary (filename)
|
(defun find-file-binary (filename)
|
||||||
"Visit file FILENAME and treat it as binary."
|
"Visit file FILENAME and treat it as binary."
|
||||||
(interactive "FFind file binary: ")
|
(interactive "FFind file binary: ")
|
||||||
(let ((file-name-buffer-file-type-alist '(("" . t))))
|
(let ((coding-system-for-read 'no-conversion))
|
||||||
(find-file filename)))
|
(find-file filename)))
|
||||||
|
|
||||||
(defun find-file-text (filename)
|
(defun find-file-text (filename)
|
||||||
"Visit file FILENAME and treat it as a text file."
|
"Visit file FILENAME and treat it as a text file."
|
||||||
(interactive "FFind file text: ")
|
(interactive "FFind file text: ")
|
||||||
(let ((file-name-buffer-file-type-alist '(("" . nil))))
|
(let ((coding-system-for-read 'undecided-dos))
|
||||||
(find-file filename)))
|
(find-file filename)))
|
||||||
|
|
||||||
(defun find-file-not-found-set-buffer-file-coding-system ()
|
(defun find-file-not-found-set-buffer-file-coding-system ()
|
||||||
|
|
|
||||||
|
|
@ -1795,8 +1795,6 @@ The value is non-nil if there were no errors, nil if errors."
|
||||||
(kill-emacs-hook
|
(kill-emacs-hook
|
||||||
(cons (lambda () (ignore-errors (delete-file tempfile)))
|
(cons (lambda () (ignore-errors (delete-file tempfile)))
|
||||||
kill-emacs-hook)))
|
kill-emacs-hook)))
|
||||||
(if (memq system-type '(ms-dos 'windows-nt))
|
|
||||||
(setq buffer-file-type t))
|
|
||||||
(write-region (point-min) (point-max) tempfile nil 1)
|
(write-region (point-min) (point-max) tempfile nil 1)
|
||||||
;; This has the intentional side effect that any
|
;; This has the intentional side effect that any
|
||||||
;; hard-links to target-file continue to
|
;; hard-links to target-file continue to
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
2013-02-09 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
|
* erc-dcc.el (erc-dcc-get-file): Don't reference buffer-file-type.
|
||||||
|
|
||||||
2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
|
2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
|
||||||
|
|
||||||
* erc-dcc.el (erc-dcc-send-file): Use point-min-marker.
|
* erc-dcc.el (erc-dcc-send-file): Use point-min-marker.
|
||||||
|
|
|
||||||
|
|
@ -942,7 +942,6 @@ filter and a process sentinel, and making the connection."
|
||||||
(set-buffer-multibyte nil))
|
(set-buffer-multibyte nil))
|
||||||
|
|
||||||
(setq mode-line-process '(":%s")
|
(setq mode-line-process '(":%s")
|
||||||
buffer-file-type t
|
|
||||||
buffer-read-only t)
|
buffer-read-only t)
|
||||||
(setq erc-dcc-file-name file)
|
(setq erc-dcc-file-name file)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1983,8 +1983,6 @@ Do you want to revisit the file normally now? ")
|
||||||
(after-find-file error (not nowarn)))
|
(after-find-file error (not nowarn)))
|
||||||
(current-buffer))))
|
(current-buffer))))
|
||||||
|
|
||||||
(defvar file-name-buffer-file-type-alist) ;From dos-w32.el.
|
|
||||||
|
|
||||||
(defun insert-file-contents-literally (filename &optional visit beg end replace)
|
(defun insert-file-contents-literally (filename &optional visit beg end replace)
|
||||||
"Like `insert-file-contents', but only reads in the file literally.
|
"Like `insert-file-contents', but only reads in the file literally.
|
||||||
A buffer may be modified in several ways after reading into the buffer,
|
A 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."
|
||||||
(after-insert-file-functions nil)
|
(after-insert-file-functions nil)
|
||||||
(coding-system-for-read 'no-conversion)
|
(coding-system-for-read 'no-conversion)
|
||||||
(coding-system-for-write 'no-conversion)
|
(coding-system-for-write 'no-conversion)
|
||||||
(file-name-buffer-file-type-alist '(("" . t)))
|
|
||||||
(inhibit-file-name-handlers
|
(inhibit-file-name-handlers
|
||||||
;; FIXME: Yuck!! We should turn insert-file-contents-literally
|
;; FIXME: Yuck!! We should turn insert-file-contents-literally
|
||||||
;; into a file operation instead!
|
;; into a file operation instead!
|
||||||
|
|
|
||||||
|
|
@ -332,8 +332,6 @@ There should be no more than seven characters after the final `/'."
|
||||||
|
|
||||||
(with-current-buffer temp-buffer
|
(with-current-buffer temp-buffer
|
||||||
(let ((coding-system-for-write 'no-conversion))
|
(let ((coding-system-for-write 'no-conversion))
|
||||||
(if (memq system-type '(ms-dos windows-nt))
|
|
||||||
(setq buffer-file-type t) )
|
|
||||||
(jka-compr-run-real-handler 'write-region
|
(jka-compr-run-real-handler 'write-region
|
||||||
(list (point-min) (point-max)
|
(list (point-min) (point-max)
|
||||||
filename
|
filename
|
||||||
|
|
|
||||||
|
|
@ -590,7 +590,7 @@ header is fiddled after the From: header is fiddled."
|
||||||
(defcustom feedmail-force-binary-write t
|
(defcustom feedmail-force-binary-write t
|
||||||
"If non-nil, force writing file as binary (this applies to queues and Fcc:).
|
"If non-nil, force writing file as binary (this applies to queues and Fcc:).
|
||||||
On systems where there is a difference between binary and text files,
|
On systems where there is a difference between binary and text files,
|
||||||
feedmail will temporarily manipulate the value of `buffer-file-type'
|
feedmail will temporarily manipulate the value of `coding-system-for-write'
|
||||||
to make the writing as binary. If nil, writing will be in text mode.
|
to make the writing as binary. If nil, writing will be in text mode.
|
||||||
On systems where there is no distinction or where it is controlled by other
|
On systems where there is no distinction or where it is controlled by other
|
||||||
variables or other means, this option has no effect."
|
variables or other means, this option has no effect."
|
||||||
|
|
@ -2016,7 +2016,6 @@ backup file names and the like)."
|
||||||
(setq buffer-offer-save nil)
|
(setq buffer-offer-save nil)
|
||||||
(buffer-disable-undo blobby-buffer)
|
(buffer-disable-undo blobby-buffer)
|
||||||
(insert-file-contents-literally maybe-file)
|
(insert-file-contents-literally maybe-file)
|
||||||
(setq buffer-file-type t) ; binary
|
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
;; if at least two line-endings with CRLF, translate the file
|
;; if at least two line-endings with CRLF, translate the file
|
||||||
(if (looking-at ".*\r\n.*\r\n")
|
(if (looking-at ".*\r\n.*\r\n")
|
||||||
|
|
@ -2334,7 +2333,10 @@ mapped to mostly alphanumerics for safety."
|
||||||
(setq filename buffer-file-name)
|
(setq filename buffer-file-name)
|
||||||
(setq filename (feedmail-create-queue-filename queue-directory)))
|
(setq filename (feedmail-create-queue-filename queue-directory)))
|
||||||
;; make binary file on DOS/Windows 95/Windows NT, etc
|
;; make binary file on DOS/Windows 95/Windows NT, etc
|
||||||
(let ((buffer-file-type feedmail-force-binary-write))
|
(let ((coding-system-for-write
|
||||||
|
(if feedmail-force-binary-write
|
||||||
|
'no-conversion
|
||||||
|
coding-system-for-write)))
|
||||||
(write-file filename))
|
(write-file filename))
|
||||||
;; convenient for moving from draft to q, for example
|
;; convenient for moving from draft to q, for example
|
||||||
(if (and previous-buffer-file-name (or (not is-fqm) (not is-in-this-dir))
|
(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."
|
||||||
;; Re-insert and handle any Fcc fields (and, optionally,
|
;; Re-insert and handle any Fcc fields (and, optionally,
|
||||||
;; any Bcc).
|
;; any Bcc).
|
||||||
(when fcc
|
(when fcc
|
||||||
(let ((old (default-value 'buffer-file-type)))
|
(let ((coding-system-for-write
|
||||||
|
(if (and (memq system-type '(ms-dos windows-nt))
|
||||||
|
feedmail-force-binary-write)
|
||||||
|
'no-conversion
|
||||||
|
coding-system-for-write)))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
(setq-default buffer-file-type
|
|
||||||
feedmail-force-binary-write)
|
|
||||||
(insert fcc)
|
(insert fcc)
|
||||||
(unless feedmail-nuke-bcc-in-fcc
|
(unless feedmail-nuke-bcc-in-fcc
|
||||||
(if bcc-holder (insert bcc-holder))
|
(if bcc-holder (insert bcc-holder))
|
||||||
(if resent-bcc-holder
|
(if resent-bcc-holder
|
||||||
(insert resent-bcc-holder)))
|
(insert resent-bcc-holder)))
|
||||||
|
|
||||||
(run-hooks 'feedmail-before-fcc-hook)
|
(run-hooks 'feedmail-before-fcc-hook)
|
||||||
|
|
||||||
(when feedmail-nuke-body-in-fcc
|
(when feedmail-nuke-body-in-fcc
|
||||||
(goto-char eoh-marker)
|
(goto-char eoh-marker)
|
||||||
(if (natnump feedmail-nuke-body-in-fcc)
|
(if (natnump feedmail-nuke-body-in-fcc)
|
||||||
(forward-line feedmail-nuke-body-in-fcc))
|
(forward-line feedmail-nuke-body-in-fcc))
|
||||||
(delete-region (point) (point-max)))
|
(delete-region (point) (point-max)))
|
||||||
(mail-do-fcc eoh-marker))
|
(mail-do-fcc eoh-marker))))))
|
||||||
(setq-default buffer-file-type old)))))
|
|
||||||
;; User bailed out of one-last-look.
|
;; User bailed out of one-last-look.
|
||||||
(if feedmail-queue-runner-is-active
|
(if feedmail-queue-runner-is-active
|
||||||
(throw 'skip-me-q 'skip-me-q)
|
(throw 'skip-me-q 'skip-me-q)
|
||||||
|
|
|
||||||
|
|
@ -3297,7 +3297,6 @@ system TYPE.")
|
||||||
(name (ange-ftp-quote-string (nth 2 parsed)))
|
(name (ange-ftp-quote-string (nth 2 parsed)))
|
||||||
(temp (ange-ftp-make-tmp-name host))
|
(temp (ange-ftp-make-tmp-name host))
|
||||||
(binary (ange-ftp-binary-file filename))
|
(binary (ange-ftp-binary-file filename))
|
||||||
(buffer-file-type buffer-file-type)
|
|
||||||
(abbr (ange-ftp-abbreviate-filename filename))
|
(abbr (ange-ftp-abbreviate-filename filename))
|
||||||
(coding-system-used last-coding-system-used)
|
(coding-system-used last-coding-system-used)
|
||||||
size)
|
size)
|
||||||
|
|
@ -3322,10 +3321,7 @@ system TYPE.")
|
||||||
size
|
size
|
||||||
(nth 1 (ange-ftp-real-insert-file-contents
|
(nth 1 (ange-ftp-real-insert-file-contents
|
||||||
temp visit beg end replace))
|
temp visit beg end replace))
|
||||||
coding-system-used last-coding-system-used
|
coding-system-used last-coding-system-used)
|
||||||
;; override autodetection of buffer file type
|
|
||||||
;; to ensure buffer is saved in DOS format
|
|
||||||
buffer-file-type binary)
|
|
||||||
(signal 'ftp-error
|
(signal 'ftp-error
|
||||||
(list
|
(list
|
||||||
"Opening input file:"
|
"Opening input file:"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
2013-02-09 Eli Zaretskii <eliz@gnu.org>
|
2013-02-09 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
|
* xdisp.c (decode_mode_spec): Remove handling of %t.
|
||||||
|
|
||||||
* msdos.c (careadlinkatcwd): Remove.
|
* msdos.c (careadlinkatcwd): Remove.
|
||||||
|
|
||||||
2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||||
|
|
|
||||||
|
|
@ -21525,9 +21525,6 @@ decode_mode_spec (struct window *w, register int c, int field_width,
|
||||||
return "@";
|
return "@";
|
||||||
}
|
}
|
||||||
|
|
||||||
case 't': /* indicate TEXT or BINARY */
|
|
||||||
return "T";
|
|
||||||
|
|
||||||
case 'z':
|
case 'z':
|
||||||
/* coding-system (not including end-of-line format) */
|
/* coding-system (not including end-of-line format) */
|
||||||
case 'Z':
|
case 'Z':
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue