]> code.delx.au - gnu-emacs/blobdiff - lisp/dos-w32.el
execute-extended-command prompt fix (bug#13395)
[gnu-emacs] / lisp / dos-w32.el
index 20b04e0db34b247e1febc3d392007a1ca8f80a9e..5866edfc3d663d230e2a688ad159462c7c433e6c 100644 (file)
@@ -1,6 +1,6 @@
 ;; dos-w32.el --- Functions shared among MS-DOS and W32 (NT/95) platforms
 
-;; Copyright (C) 1996, 2001-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2013 Free Software Foundation, Inc.
 
 ;; Maintainer: Geoff Voelker <voelker@cs.washington.edu>
 ;; Keywords: internal
@@ -38,9 +38,8 @@
 (setq null-device "NUL")
 
 ;; For distinguishing file types based upon suffixes.
-(defvar file-name-buffer-file-type-alist
-  '(
-    ("[:/].*config.sys$" . nil)                ; config.sys text
+(defcustom file-name-buffer-file-type-alist
+  '(("[:/].*config.sys$" . nil)                ; config.sys text
     ("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|bin\\|ico\\|pif\\|class\\)$" . t)
                                        ; MS-Dos stuff
     ("\\.\\(dll\\|drv\\|386\\|vxd\\|fon\\|fnt\\|fot\\|ttf\\|grp\\)$" . t)
     ("\\.tp[ulpw]$" . t)               ; borland Pascal stuff
     ("[:/]tags$" . nil)                        ; emacs TAGS file
     )
-  "*Alist for distinguishing text files from binary files.
+  "Alist for distinguishing text files from binary files.
 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."
+  :type '(repeat (cons regexp boolean))
+  :group 'dos-fns
+  :group 'w32)
 
 ;; Return the pair matching filename on file-name-buffer-file-type-alist,
 ;; or nil otherwise.
@@ -208,7 +210,7 @@ set to the appropriate coding system, and the value of
                     (untranslated-file-p (buffer-file-name))))
        (setq coding (coding-system-change-eol-conversion coding 0))
        (setq buffer-file-coding-system coding))
-      (setq buffer-file-type (eq buffer-file-coding-system 'no-conversion)))))
+      nil)))
 
 ;;; To set the default coding system on new files.
 (add-hook 'find-file-not-found-functions
@@ -228,10 +230,10 @@ dealing with untranslated filesystems."
       ;; 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).
@@ -282,15 +284,18 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
 
 ;;; Support for printing under DOS/Windows, see lpr.el and ps-print.el.
 
-(defvar direct-print-region-use-command-dot-com t
-  "*Control whether command.com is used to print on Windows 9x.")
+(defcustom direct-print-region-use-command-dot-com t
+  "If non-nil, use command.com to print on Windows 9x."
+  :type 'boolean
+  :group 'dos-fns
+  :group 'w32)
 
 ;; Function to actually send data to the printer port.
 ;; Supports writing directly, and using various programs.
 (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)
@@ -356,7 +361,7 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
          (apply 'call-process lpr-prog nil errbuf nil rest))
         ;; Run command.com to access printer port on Windows 9x, unless
         ;; we are supposed to append to an existing (non-empty) file,
-        ;; to work around a bug in Windows 9x that prevents Win32
+        ;; to work around a bug in Windows 9x that prevents Windows
         ;; programs from accessing LPT ports reliably.
         ((and (eq system-type 'windows-nt)
               (getenv "winbootdir")
@@ -381,9 +386,9 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
 (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'
@@ -399,7 +404,7 @@ indicates a specific program should be invoked."
         ;; 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))