;; dos-w32.el --- Functions shared among MS-DOS and W32 (NT/95) platforms
-;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: Geoff Voelker <voelker@cs.washington.edu>
;; Keywords: internal
+;; Package: emacs
;; This file is part of GNU Emacs.
(setq alist (cdr alist)))
found)))
-;; Silence compiler. Defined in src/buffer.c on DOS_NT.
-(defvar default-buffer-file-type)
-
;; 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-buffer-file-type
+ (default-value 'buffer-file-type)
(setq code (cdr match))
(cond ((memq code '(nil t)) code)
((and (symbolp code) (fboundp code))
If the match is nil (for dos-text): `undecided-dos'
Otherwise:
If the file exists: `undecided'
- If the file does not exist: default-buffer-file-coding-system
+ If the file does not exist default value of `buffer-file-coding-system'
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
(text '(undecided-dos . undecided-dos))
(undecided-unix '(undecided-unix . undecided-unix))
(undecided '(undecided . undecided))
- (t (cons default-buffer-file-coding-system
- default-buffer-file-coding-system))))
+ (t (cons (default-value 'buffer-file-coding-system)
+ (default-value 'buffer-file-coding-system)))))
((eq op 'write-region)
(if buffer-file-coding-system
(cons buffer-file-coding-system
(find-file filename)))
(defun find-file-not-found-set-buffer-file-coding-system ()
- (save-excursion
- (set-buffer (current-buffer))
+ (with-current-buffer (current-buffer)
(let ((coding buffer-file-coding-system))
;; buffer-file-coding-system is already set by
;; find-operation-coding-system, which was called from
;; directory separators changed to directory-sep-char.
(let ((name nil))
(setq name (mapconcat
- '(lambda (char)
- (if (and (<= ?A char) (<= char ?Z))
- (char-to-string (+ (- char ?A) ?a))
- (char-to-string char)))
+ (lambda (char)
+ (if (and (<= ?A char) (<= char ?Z))
+ (char-to-string (+ (- char ?A) ?a))
+ (char-to-string char)))
filename nil))
;; Use expand-file-name to canonicalize directory separators, except
;; with bare drive letters (which would have the cwd appended).
(defun direct-print-region-helper (printer
start end
lpr-prog
- delete-text buf display
+ _delete-text _buf _display
rest)
(let* (;; Ignore case when matching known external program names.
(case-fold-search t)
(declare-function default-printer-name "w32fns.c")
(defun direct-print-region-function (start end
- &optional lpr-prog
- delete-text buf display
- &rest rest)
+ &optional lpr-prog
+ delete-text buf display
+ &rest rest)
"DOS/Windows-specific function to print the region on a printer.
Writes the region to the device or file which is a value of
`printer-name' \(which see\), unless the value of `lpr-command'
;; paper if the file ends with a form-feed already.
(write-region-annotate-functions
(cons
- (lambda (start end)
+ (lambda (_start end)
(if (not (char-equal (char-before end) ?\C-l))
`((,end . "\f"))))
write-region-annotate-functions))
(provide 'dos-w32)
-;; arch-tag: dcfefdd2-362f-4fbc-9141-9634f5f4d6a7
;;; dos-w32.el ends here