Add defgroup; use defcustom for user vars.
[emacs.git] / lisp / w32-fns.el
blobab26ba71cff07277131c7ff67c13dbcca30020c3
1 ;;; w32-fns.el --- Lisp routines for Windows NT.
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
5 ;; Author: Geoff Voelker (voelker@cs.washington.edu)
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; any later version.
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
24 ;;; Commentary:
26 ;; (August 12, 1993)
27 ;; Created.
29 ;; (November 21, 1994)
30 ;; [C-M-backspace] defined.
31 ;; mode-line-format defined to show buffer file type.
32 ;; audio bell initialized.
34 ;;; Code:
36 ;; Map delete and backspace
37 (define-key function-key-map [backspace] "\177")
38 (define-key function-key-map [delete] "\C-d")
39 (define-key function-key-map [M-backspace] [?\M-\177])
40 (define-key function-key-map [C-M-backspace] [\C-\M-delete])
42 ;; Ignore case on file-name completion
43 (setq completion-ignore-case t)
45 ;; The cmd.exe shell uses the "/c" switch instead of the "-c" switch
46 ;; for executing its command line argument (from simple.el).
47 (setq shell-command-switch "/c")
49 ;; For appending suffixes to directories and files in shell completions.
50 (add-hook 'shell-mode-hook
51 '(lambda () (setq comint-completion-addsuffix '("\\" . " "))))
53 ;; Avoid creating auto-save file names containing invalid characters.
54 (fset 'original-make-auto-save-file-name
55 (symbol-function 'make-auto-save-file-name))
57 (defun make-auto-save-file-name ()
58 "Return file name to use for auto-saves of current buffer.
59 Does not consider `auto-save-visited-file-name' as that variable is checked
60 before calling this function. You can redefine this for customization.
61 See also `auto-save-file-name-p'."
62 (let ((name (original-make-auto-save-file-name))
63 (start 0))
64 ;; Skip drive letter if present.
65 (if (string-match "^[\/]?[a-zA-`]:" name)
66 (setq start (- (match-end 0) (match-beginning 0))))
67 ;; Destructively replace occurrences of *?"<>|: with $
68 (while (string-match "[?*\"<>|:]" name start)
69 (aset name (match-beginning 0) ?$)
70 (setq start (1+ (match-end 0))))
71 name))
73 ;;; Fix interface to (X-specific) mouse.el
74 (defun x-set-selection (type data)
75 (or type (setq type 'PRIMARY))
76 (put 'x-selections type data))
78 (defun x-get-selection (&optional type data-type)
79 (or type (setq type 'PRIMARY))
80 (get 'x-selections type))
82 (fmakunbound 'font-menu-add-default)
83 (global-unset-key [C-down-mouse-1])
84 (global-unset-key [C-down-mouse-2])
85 (global-unset-key [C-down-mouse-3])
87 ;;; Set to a system sound if you want a fancy bell.
88 (set-message-beep nil)
90 ;;; w32-fns.el ends here