annotate lisp/w32-fns.el @ 111870:b47e85affa59

Derive from prog-mode, use derived-mode-p, and fix up various minor style issues in lisp/progmodes. * lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init) (vhdl-hs-minor-mode, vhdl-ps-print-init): Fix make-local-variable -> make-local-hook. * lisp/progmodes/sh-script.el (sh-require-final-newline): Remove. (sh-set-shell): Don't set require-final-newline since it's already done by prog-mode. * lisp/progmodes/modula2.el (m2-mode): Don't make m2-end-comment-column since we never set it. * lisp/progmodes/ebrowse.el (ebrowse-set-tree-indentation): Use read-string and standard prompt. * lisp/progmodes/dcl-mode.el (dcl-mode-map): Move init into declaration. * lisp/progmodes/meta-mode.el (meta-mode-abbrev-table): Merge init and decl. (meta-common-mode-syntax-table): Rename from meta-mode-syntax-table. (meta-common-mode-map): Rename from meta-mode-map. Remove C-m binding, which is a user preference, not mode specific. (meta-common-mode): New major mode; replace meta-common-initialization. * lisp/progmodes/js.el (js-mode): Call syntax-propertize rather than messing around with font-lock. * lisp/progmodes/etags.el (select-tags-table-mode): Derive from special-mode. * lisp/progmodes/octave-mod.el (octave-mode): * lisp/progmodes/gdb-mi.el (gdb-inferior-io-mode, gdb-threads-mode) (gdb-memory-mode, gdb-disassembly-mode, gdb-breakpoints-mode) (gdb-frames-mode, gdb-locals-mode, gdb-registers-mode): Let define-derived-mode do its job. * lisp/progmodes/cpp.el (cpp-edit-mode-map): Move initialization into declaration. (cpp-edit-mode): Use define-derived-mode. (cpp-edit-load): Use derived-mode-p. * lisp/progmodes/mixal-mode.el (mixal-mode): * lisp/progmodes/f90.el (f90-mode): * lisp/progmodes/cfengine.el (cfengine-mode): Don't bother setting require-final-newline since prog-mode does it already. * lisp/progmodes/cc-cmds.el (c-update-modeline): Use match-string. * lisp/progmodes/asm-mode.el (asm-mode-map): Fix menu setup. * lisp/progmodes/antlr-mode.el: Require cc-mode upfront. (antlr-mode-syntax-table, antlr-action-syntax-table): Initialize in the declaration. (antlr-directory-dependencies, antlr-show-makefile-rules): Use derived-mode-p. (antlr-language-option): Don't assume point-min==1. (antlr-mode): Use define-derived-mode. * lisp/progmodes/ada-mode.el: Use derived-mode-p. (ada-mode): Use define-derived-mode. Use hack-local-variables-hook. * lisp/progmodes/vhdl-mode.el (vhdl-mode): * lisp/progmodes/verilog-mode.el (verilog-mode): * lisp/progmodes/vera-mode.el (vera-mode): * lisp/progmodes/sql.el (sql-mode): * lisp/progmodes/scheme.el (scheme-mode): * lisp/progmodes/perl-mode.el (perl-mode): * lisp/progmodes/octave-inf.el (inferior-octave-mode): * lisp/progmodes/autoconf.el (autoconf-mode): * lisp/progmodes/m4-mode.el (m4-mode): * lisp/progmodes/inf-lisp.el (inferior-lisp-mode): * lisp/progmodes/idlwave.el (idlwave-mode): * lisp/progmodes/icon.el (icon-mode): * lisp/progmodes/idlw-help.el (idlwave-help-mode): * lisp/progmodes/dcl-mode.el (dcl-mode): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/ebrowse.el (ebrowse-tree-mode, ebrowse-electric-list-mode) (ebrowse-member-mode, ebrowse-electric-position-mode): Use define-derived-mode. * lisp/progmodes/xscheme.el (xscheme-start) (local-set-scheme-interaction-buffer, scheme-interaction-mode): * lisp/progmodes/which-func.el (which-function): * lisp/progmodes/vhdl-mode.el (vhdl-set-style): * lisp/progmodes/verilog-mode.el (verilog-set-compile-command) (verilog-modify-compile-command, verilog-error-regexp-add-xemacs) (verilog-set-define, verilog-auto-reeval-locals): * lisp/progmodes/sql.el (sql-product-font-lock, sql-interactive-mode): * lisp/progmodes/simula.el (simula-mode): * lisp/progmodes/scheme.el (scheme-mode-variables, dsssl-mode): * lisp/progmodes/python.el (python-check, python-mode): * lisp/progmodes/prolog.el (prolog-mode-variables): * lisp/progmodes/gud.el (gud-tooltip-activate-mouse-motions): * lisp/progmodes/ebrowse.el (ebrowse-view-file-other-frame): * lisp/progmodes/delphi.el (delphi-mode): * lisp/progmodes/cc-styles.el (c-setup-paragraph-variables): * lisp/progmodes/cc-mode.el (c-basic-common-init, c-common-init) (c-font-lock-init): Move make-local-variable to their setq. * lisp/progmodes/xscheme.el (exit-scheme-interaction-mode) (xscheme-enter-interaction-mode, xscheme-enter-debugger-mode) (xscheme-debugger-mode-p, xscheme-send-string-1): * lisp/progmodes/tcl.el (inferior-tcl-proc, tcl-current-word) (tcl-load-file, tcl-restart-with-file): * lisp/progmodes/ps-mode.el (ps-run-running): * lisp/progmodes/gdb-mi.el (gud-watch, gdb-mouse-set-clear-breakpoint): * lisp/progmodes/js.el (js--get-all-known-symbols): * lisp/progmodes/inf-lisp.el (inferior-lisp-proc): * lisp/progmodes/idlwave.el (idlwave-beginning-of-statement) (idlwave-template, idlwave-update-buffer-routine-info) (idlwave-update-current-buffer-info) (idlwave-get-routine-info-from-buffers, idlwave-choose) (idlwave-scan-class-info, idlwave-fix-keywords) (idlwave-list-buffer-load-path-shadows): * lisp/progmodes/idlw-toolbar.el (idlwave-toolbar, idlwave-toolbar-add) (idlwave-toolbar-remove): * lisp/progmodes/idlw-shell.el (idlwave-shell-save-and-action) (idlwave-shell-file-name, idlwave-shell-electric-debug-all-off) (idlwave-shell-menu-def): * lisp/progmodes/idlw-complete-structtag.el (idlwave-prepare-structure-tag-completion): * lisp/progmodes/gud.el (gud-set-buffer): * lisp/progmodes/f90.el (f90-backslash-not-special): * lisp/progmodes/delphi.el (delphi-find-unit): Use derived-mode-p.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 10 Dec 2010 15:00:25 -0500
parents 6cf6c01cf9bf
children ce394dc068a8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 37621
diff changeset
1 ;;; w32-fns.el --- Lisp routines for Windows NT
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14121
diff changeset
2
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104706
diff changeset
3 ;; Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 105607
diff changeset
4 ;; 2009, 2010 Free Software Foundation, Inc.
9803
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5
21059
cbd9e55a6cdc Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 19692
diff changeset
6 ;; Author: Geoff Voelker <voelker@cs.washington.edu>
39117
abd085bfec0c Add Keywords header.
Gerd Moellmann <gerd@gnu.org>
parents: 38436
diff changeset
7 ;; Keywords: internal
110015
280c8ae2476d Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents: 109051
diff changeset
8 ;; Package: emacs
9803
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94505
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
9803
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94505
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94505
diff changeset
15 ;; (at your option) any later version.
9803
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94505
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
9803
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;;; Code:
85503
59ee4068f60b * progmodes/gud.el (gud-target-name): Move definition before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78236
diff changeset
29 (require 'w32-vars)
9803
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
65298
0028f546a4d3 (explicit-shell-file-name): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 64762
diff changeset
31 (defvar explicit-shell-file-name)
0028f546a4d3 (explicit-shell-file-name): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 64762
diff changeset
32
86268
f1604b3ab5ad (x-alternatives-map): Copy from term/x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 86265
diff changeset
33 ;;;; Function keys
f1604b3ab5ad (x-alternatives-map): Copy from term/x-win.el.
Jason Rumney <jasonr@gnu.org>
parents: 86265
diff changeset
34
86289
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86280
diff changeset
35 (declare-function set-message-beep "w32console.c")
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86280
diff changeset
36 (declare-function w32-get-clipboard-data "w32select.c")
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86280
diff changeset
37 (declare-function w32-get-locale-info "w32proc.c")
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86280
diff changeset
38 (declare-function w32-get-valid-locale-ids "w32proc.c")
8a7ed478f7bc * international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 86280
diff changeset
39 (declare-function w32-set-clipboard-data "w32select.c")
11399
f322675d5c53 Key [C-M-backspace] defined.
Karl Heuer <kwzh@gnu.org>
parents: 9803
diff changeset
40
40458
de4e98791121 (convert-standard-filename): Handle cygwin-specific pathnames.
Sam Steingold <sds@gnu.org>
parents: 40345
diff changeset
41 ;; Map all versions of a filename (8.3, longname, mixed case) to the
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
42 ;; same buffer.
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
43 (setq find-file-visit-truename t)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
44
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
45 (declare-function x-server-version "w32fns.c" (&optional display))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
46
33212
5298b23b61be (w32-version): New function.
Andrew Innes <andrewi@gnu.org>
parents: 32716
diff changeset
47 (defun w32-version ()
5298b23b61be (w32-version): New function.
Andrew Innes <andrewi@gnu.org>
parents: 32716
diff changeset
48 "Return the MS-Windows version numbers.
5298b23b61be (w32-version): New function.
Andrew Innes <andrewi@gnu.org>
parents: 32716
diff changeset
49 The value is a list of three integers: the major and minor version
5298b23b61be (w32-version): New function.
Andrew Innes <andrewi@gnu.org>
parents: 32716
diff changeset
50 numbers, and the build number."
5298b23b61be (w32-version): New function.
Andrew Innes <andrewi@gnu.org>
parents: 32716
diff changeset
51 (x-server-version))
5298b23b61be (w32-version): New function.
Andrew Innes <andrewi@gnu.org>
parents: 32716
diff changeset
52
17549
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
53 (defun w32-using-nt ()
90935
9f1c9eeab40d Doc fix
Jason Rumney <jasonr@gnu.org>
parents: 90737
diff changeset
54 "Return non-nil if running on a Windows NT descendant.
55792
0d890eccf70f (w32-using-nt, w32-shell-dos-semantics, set-w32-system-coding-system):
Juanma Barranquero <lekktu@gmail.com>
parents: 52401
diff changeset
55 That includes all Windows systems except for 9X/Me."
17549
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
56 (and (eq system-type 'windows-nt) (getenv "SystemRoot")))
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
57
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
58 (defun w32-shell-name ()
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
59 "Return the name of the shell being used."
64563
3a895c8815ed (w32-shell-name): Use `bound-and-true-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
60 (or (bound-and-true-p explicit-shell-file-name)
17549
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
61 (getenv "ESHELL")
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
62 (getenv "SHELL")
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
63 (and (w32-using-nt) "cmd.exe")
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
64 "command.com"))
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
65
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
66 (defun w32-system-shell-p (shell-name)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
67 (and shell-name
40458
de4e98791121 (convert-standard-filename): Handle cygwin-specific pathnames.
Sam Steingold <sds@gnu.org>
parents: 40345
diff changeset
68 (member (downcase (file-name-nondirectory shell-name))
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
69 w32-system-shells)))
9803
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70
23173
073e555c28c8 (w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21597
diff changeset
71 (defun w32-shell-dos-semantics ()
99540
c5c8f07bc47c * w32-fns.el (w32-shell-dos-semantics):
Juanma Barranquero <lekktu@gmail.com>
parents: 98791
diff changeset
72 "Return non-nil if the interactive shell being used expects MS-DOS shell semantics."
23173
073e555c28c8 (w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21597
diff changeset
73 (or (w32-system-shell-p (w32-shell-name))
073e555c28c8 (w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21597
diff changeset
74 (and (member (downcase (file-name-nondirectory (w32-shell-name)))
073e555c28c8 (w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21597
diff changeset
75 '("cmdproxy" "cmdproxy.exe"))
073e555c28c8 (w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21597
diff changeset
76 (w32-system-shell-p (getenv "COMSPEC")))))
073e555c28c8 (w32-shell-dos-semantics): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21597
diff changeset
77
85512
589532be95ec * w32-fns.el (w32-quote-process-args):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85503
diff changeset
78 (defvar w32-quote-process-args) ;; defined in w32proc.c
589532be95ec * w32-fns.el (w32-quote-process-args):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85503
diff changeset
79
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
80 (defun w32-check-shell-configuration ()
98778
0f8ccfd21a74 * w32-fns.el (w32-check-shell-configuration): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 97221
diff changeset
81 "Check the configuration of shell variables on Windows.
17549
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
82 This function is invoked after loading the init files and processing
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
83 the command line arguments. It issues a warning if the user or site
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
84 has configured the shell with inappropriate settings."
21597
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
85 (interactive)
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
86 (let ((prev-buffer (current-buffer))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
87 (buffer (get-buffer-create "*Shell Configuration*"))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
88 (system-shell))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
89 (set-buffer buffer)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
90 (erase-buffer)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
91 (if (w32-system-shell-p (getenv "ESHELL"))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
92 (insert (format "Warning! The ESHELL environment variable uses %s.
40458
de4e98791121 (convert-standard-filename): Handle cygwin-specific pathnames.
Sam Steingold <sds@gnu.org>
parents: 40345
diff changeset
93 You probably want to change it so that it uses cmdproxy.exe instead.\n\n"
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
94 (getenv "ESHELL"))))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
95 (if (w32-system-shell-p (getenv "SHELL"))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
96 (insert (format "Warning! The SHELL environment variable uses %s.
40458
de4e98791121 (convert-standard-filename): Handle cygwin-specific pathnames.
Sam Steingold <sds@gnu.org>
parents: 40345
diff changeset
97 You probably want to change it so that it uses cmdproxy.exe instead.\n\n"
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
98 (getenv "SHELL"))))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
99 (if (w32-system-shell-p shell-file-name)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
100 (insert (format "Warning! shell-file-name uses %s.
40458
de4e98791121 (convert-standard-filename): Handle cygwin-specific pathnames.
Sam Steingold <sds@gnu.org>
parents: 40345
diff changeset
101 You probably want to change it so that it uses cmdproxy.exe instead.\n\n"
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
102 shell-file-name)))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
103 (if (and (boundp 'explicit-shell-file-name)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
104 (w32-system-shell-p explicit-shell-file-name))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
105 (insert (format "Warning! explicit-shell-file-name uses %s.
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
106 You probably want to change it so that it uses cmdproxy.exe instead.\n\n"
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
107 explicit-shell-file-name)))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
108 (setq system-shell (> (buffer-size) 0))
21597
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
109
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
110 ;; Allow user to specify that they really do want to use one of the
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
111 ;; "system" shells, despite the drawbacks, but still warn if
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
112 ;; shell-command-switch doesn't match.
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
113 (if w32-allow-system-shell
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
114 (erase-buffer))
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
115
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
116 (cond (system-shell
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
117 ;; System shells.
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
118 (if (string-equal "-c" shell-command-switch)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
119 (insert "Warning! shell-command-switch is \"-c\".
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
120 You should set this to \"/c\" when using a system shell.\n\n"))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
121 (if w32-quote-process-args
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
122 (insert "Warning! w32-quote-process-args is t.
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
123 You should set this to nil when using a system shell.\n\n")))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
124 ;; Non-system shells.
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
125 (t
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
126 (if (string-equal "/c" shell-command-switch)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
127 (insert "Warning! shell-command-switch is \"/c\".
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
128 You should set this to \"-c\" when using a non-system shell.\n\n"))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
129 (if (not w32-quote-process-args)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
130 (insert "Warning! w32-quote-process-args is nil.
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
131 You should set this to t when using a non-system shell.\n\n"))))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
132 (if (> (buffer-size) 0)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
133 (display-buffer buffer)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
134 (kill-buffer buffer))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
135 (set-buffer prev-buffer)))
17549
f57de209f01b (w32-using-nt, w32-shell-name, w32-using-system-shell-p,
Geoff Voelker <voelker@cs.washington.edu>
parents: 16859
diff changeset
136
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
137 (add-hook 'after-init-hook 'w32-check-shell-configuration)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
138
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
139 ;; Override setting chosen at startup.
24514
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
140 (defun set-default-process-coding-system ()
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
141 ;; Most programs on Windows will accept Unix line endings on input
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
142 ;; (and some programs ported from Unix require it) but most will
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
143 ;; produce DOS line endings on output.
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
144 (setq default-process-coding-system
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104706
diff changeset
145 (if (default-value 'enable-multibyte-characters)
24514
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
146 '(undecided-dos . undecided-unix)
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
147 '(raw-text-dos . raw-text-unix)))
78192
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
148 ;; Make cmdproxy default to using DOS line endings for input,
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
149 ;; because some Windows programs (including command.com) require it.
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
150 (add-to-list 'process-coding-system-alist
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
151 `("[cC][mM][dD][pP][rR][oO][xX][yY]"
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104706
diff changeset
152 . ,(if (default-value 'enable-multibyte-characters)
78192
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
153 '(undecided-dos . undecided-dos)
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
154 '(raw-text-dos . raw-text-dos))))
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
155 ;; plink needs DOS input when entering the password.
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
156 (add-to-list 'process-coding-system-alist
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
157 `("[pP][lL][iI][nN][kK]"
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104706
diff changeset
158 . ,(if (default-value 'enable-multibyte-characters)
78192
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
159 '(undecided-dos . undecided-dos)
19db593f63bb (set-default-process-coding-system): Use dos line ends
Jason Rumney <jasonr@gnu.org>
parents: 75347
diff changeset
160 '(raw-text-dos . raw-text-dos)))))
24514
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
161
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
162 (add-hook 'before-init-hook 'set-default-process-coding-system)
06762ce530be (set-default-process-coding-system): Copied from
Andrew Innes <andrewi@gnu.org>
parents: 24498
diff changeset
163
21597
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
164
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
165 ;;; Basic support functions for managing Emacs' locale setting
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
166
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
167 (defvar w32-valid-locales nil
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
168 "List of locale ids known to be supported.")
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
169
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
170 ;; This is the brute-force version; an efficient version is now
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
171 ;; built-in though.
21597
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
172 (if (not (fboundp 'w32-get-valid-locale-ids))
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
173 (defun w32-get-valid-locale-ids ()
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
174 "Return list of all valid Windows locale ids."
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
175 (let ((i 65535)
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
176 locales)
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
177 (while (> i 0)
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
178 (if (w32-get-locale-info i)
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
179 (setq locales (cons i locales)))
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
180 (setq i (1- i)))
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
181 locales)))
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
182
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
183 (defun w32-list-locales ()
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
184 "List the name and id of all locales supported by Windows."
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
185 (interactive)
98791
eeef1de115b3 * w32-fns.el (w32-list-locales): Decode output of `w32-get-locale-info'
Juanma Barranquero <lekktu@gmail.com>
parents: 98778
diff changeset
186 (when (null w32-valid-locales)
eeef1de115b3 * w32-fns.el (w32-list-locales): Decode output of `w32-get-locale-info'
Juanma Barranquero <lekktu@gmail.com>
parents: 98778
diff changeset
187 (setq w32-valid-locales (sort (w32-get-valid-locale-ids) #'<)))
100195
caf4353286ff * w32-fns.el (w32-list-locales): Use `with-output-to-temp-buffer',
Juanma Barranquero <lekktu@gmail.com>
parents: 99540
diff changeset
188 (with-output-to-temp-buffer "*Supported Locales*"
caf4353286ff * w32-fns.el (w32-list-locales): Use `with-output-to-temp-buffer',
Juanma Barranquero <lekktu@gmail.com>
parents: 99540
diff changeset
189 (princ "LCID\tAbbrev\tFull name\n\n")
100351
d23b1588c7c1 Move decoding of locale info from Lisp to C.
Juanma Barranquero <lekktu@gmail.com>
parents: 100195
diff changeset
190 (dolist (locale w32-valid-locales)
d23b1588c7c1 Move decoding of locale info from Lisp to C.
Juanma Barranquero <lekktu@gmail.com>
parents: 100195
diff changeset
191 (princ (format "%d\t%s\t%s\n"
d23b1588c7c1 Move decoding of locale info from Lisp to C.
Juanma Barranquero <lekktu@gmail.com>
parents: 100195
diff changeset
192 locale
d23b1588c7c1 Move decoding of locale info from Lisp to C.
Juanma Barranquero <lekktu@gmail.com>
parents: 100195
diff changeset
193 (w32-get-locale-info locale)
d23b1588c7c1 Move decoding of locale info from Lisp to C.
Juanma Barranquero <lekktu@gmail.com>
parents: 100195
diff changeset
194 (w32-get-locale-info locale t))))))
21597
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
195
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
196 ;; Setup Info-default-directory-list to include the info directory
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
197 ;; near where Emacs executable was installed. We used to set INFOPATH,
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
198 ;; but when this is set Info-default-directory-list is ignored. We
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
199 ;; also cannot rely upon what is set in paths.el because they assume
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
200 ;; that configuration during build time is correct for runtime.
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
201 (defun w32-init-info ()
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
202 (let* ((instdir (file-name-directory invocation-directory))
21597
409211e285bc (w32-system-shells): Add 4dos and 4nt.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21059
diff changeset
203 (dir1 (expand-file-name "../info/" instdir))
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
204 (dir2 (expand-file-name "../../../info/" instdir)))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
205 (if (file-exists-p dir1)
40458
de4e98791121 (convert-standard-filename): Handle cygwin-specific pathnames.
Sam Steingold <sds@gnu.org>
parents: 40345
diff changeset
206 (setq Info-default-directory-list
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
207 (append Info-default-directory-list (list dir1)))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
208 (if (file-exists-p dir2)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
209 (setq Info-default-directory-list
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
210 (append Info-default-directory-list (list dir2)))))))
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
211
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
212 (add-hook 'before-init-hook 'w32-init-info)
15338
b0d95c32f026 (shell-mode-hook): Set comint-completion-addsuffix
Richard M. Stallman <rms@gnu.org>
parents: 15257
diff changeset
213
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
214 ;; The variable source-directory is used to initialize Info-directory-list.
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
215 ;; However, the common case is that Emacs is being used from a binary
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
216 ;; distribution, and the value of source-directory is meaningless in that
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
217 ;; case. Even worse, source-directory can refer to a directory on a drive
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
218 ;; on the build machine that happens to be a removable drive on the user's
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
219 ;; machine. When this happens, Emacs tries to access the removable drive
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
220 ;; and produces the abort/retry/ignore dialog. Since we do not use
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
221 ;; source-directory, set it to something that is a reasonable approximation
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
222 ;; on the user's machine.
23571
ae5eea3cc314 Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 23173
diff changeset
223
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
224 ;;(add-hook 'before-init-hook
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
225 ;; (lambda ()
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
226 ;; (setq source-directory (file-name-as-directory
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
227 ;; (expand-file-name ".." exec-directory)))))
23571
ae5eea3cc314 Remove a dangling reference to a directory on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 23173
diff changeset
228
108594
a5969c855306 Don't override standard definition of convert-standard-filename.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
229 (defun w32-convert-standard-filename (filename)
109051
7752767c4c7f w32-fns.el (w32-convert-standard-filename): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 108594
diff changeset
230 "Convert a standard file's name to something suitable for MS-Windows.
55865
ccd8cdf69359 Rework docstring (wording by Eli Zaretskii and Kai Grossjohann).
Juanma Barranquero <lekktu@gmail.com>
parents: 55792
diff changeset
231 This means to guarantee valid names and perhaps to canonicalize
ccd8cdf69359 Rework docstring (wording by Eli Zaretskii and Kai Grossjohann).
Juanma Barranquero <lekktu@gmail.com>
parents: 55792
diff changeset
232 certain patterns.
ccd8cdf69359 Rework docstring (wording by Eli Zaretskii and Kai Grossjohann).
Juanma Barranquero <lekktu@gmail.com>
parents: 55792
diff changeset
233
108594
a5969c855306 Don't override standard definition of convert-standard-filename.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
234 This function is called by `convert-standard-filename'.
a5969c855306 Don't override standard definition of convert-standard-filename.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
235
a5969c855306 Don't override standard definition of convert-standard-filename.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
236 Replace invalid characters and turn Cygwin names into native
a5969c855306 Don't override standard definition of convert-standard-filename.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
237 names, and also turn slashes into backslashes if the shell
a5969c855306 Don't override standard definition of convert-standard-filename.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
238 requires it (see `w32-shell-dos-semantics')."
74832
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
239 (save-match-data
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
240 (let ((name
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
241 (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename)
40458
de4e98791121 (convert-standard-filename): Handle cygwin-specific pathnames.
Sam Steingold <sds@gnu.org>
parents: 40345
diff changeset
242 (replace-match "\\1:/" t nil filename)
74832
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
243 (copy-sequence filename)))
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
244 (start 0))
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
245 ;; leave ':' if part of drive specifier
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
246 (if (and (> (length name) 1)
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
247 (eq (aref name 1) ?:))
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
248 (setq start 2))
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
249 ;; destructively replace invalid filename characters with !
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
250 (while (string-match "[?*:<>|\"\000-\037]" name start)
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
251 (aset name (match-beginning 0) ?!)
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
252 (setq start (match-end 0)))
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
253 ;; convert directory separators to Windows format
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
254 ;; (but only if the shell in use requires it)
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
255 (when (w32-shell-dos-semantics)
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
256 (setq start 0)
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
257 (while (string-match "/" name start)
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
258 (aset name (match-beginning 0) ?\\)
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
259 (setq start (match-end 0))))
d53f5b616853 (convert-standard-filename): Wrap in save-match-data.
Eli Zaretskii <eliz@gnu.org>
parents: 74511
diff changeset
260 name)))
15135
72a1f82a6748 (original-make-auto-save-file-name): New symbol bound
Geoff Voelker <voelker@cs.washington.edu>
parents: 15003
diff changeset
261
9803
fa698fd10c05 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 ;;; Fix interface to (X-specific) mouse.el
15350
a8bd6f986389 (x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents: 15338
diff changeset
263 (defun x-set-selection (type data)
104135
decfa3e02ba0 * select.el (x-set-selection): Doc fix (Bug#4021).
Chong Yidong <cyd@stupidchicken.com>
parents: 104066
diff changeset
264 "Make an X selection of type TYPE and value DATA.
104066
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
265 The argument TYPE (nil means `PRIMARY') says which selection, and
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
266 DATA specifies the contents. TYPE must be a symbol. \(It can also
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
267 be a string, which stands for the symbol with that name, but this
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
268 is considered obsolete.) DATA may be a string, a symbol, an
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
269 integer (or a cons of two integers or list of two integers).
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
270
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
271 The selection may also be a cons of two markers pointing to the same buffer,
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
272 or an overlay. In these cases, the selection is considered to be the text
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
273 between the markers *at whatever time the selection is examined*.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
274 Thus, editing done in the buffer after you specify the selection
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
275 can alter the effective value of the selection.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
276
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
277 The data may also be a vector of valid non-vector selection values.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
278
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
279 The return value is DATA.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
280
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
281 Interactively, this command sets the primary selection. Without
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
282 prefix argument, it reads the selection in the minibuffer. With
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
283 prefix argument, it uses the text of the region as the selection value.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
284
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
285 Note that on MS-Windows, primary and secondary selections set by Emacs
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
286 are not available to other programs."
103947
37177e1f2fcb * w32-fns.el (x-selection-owner-p): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
287 (put 'x-selections (or type 'PRIMARY) data))
15350
a8bd6f986389 (x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents: 15338
diff changeset
288
a8bd6f986389 (x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents: 15338
diff changeset
289 (defun x-get-selection (&optional type data-type)
104066
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
290 "Return the value of an X Windows selection.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
291 The argument TYPE (default `PRIMARY') says which selection,
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
292 and the argument DATA-TYPE (default `STRING') says
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
293 how to convert the data.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
294
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
295 TYPE may be any symbol \(but nil stands for `PRIMARY'). However,
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
296 only a few symbols are commonly used. They conventionally have
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
297 all upper-case names. The most often used ones, in addition to
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
298 `PRIMARY', are `SECONDARY' and `CLIPBOARD'.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
299
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
300 DATA-TYPE is usually `STRING', but can also be one of the symbols
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 103947
diff changeset
301 in `selection-converter-alist', which see."
103947
37177e1f2fcb * w32-fns.el (x-selection-owner-p): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
302 (get 'x-selections (or type 'PRIMARY)))
37177e1f2fcb * w32-fns.el (x-selection-owner-p): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
303
37177e1f2fcb * w32-fns.el (x-selection-owner-p): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
304 ;; x-selection-owner-p is used in simple.el
37177e1f2fcb * w32-fns.el (x-selection-owner-p): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
305 (defun x-selection-owner-p (&optional type)
37177e1f2fcb * w32-fns.el (x-selection-owner-p): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
306 (and (memq type '(nil PRIMARY SECONDARY))
37177e1f2fcb * w32-fns.el (x-selection-owner-p): New function.
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
307 (get 'x-selections (or type 'PRIMARY))))
15350
a8bd6f986389 (x-set-selection, x-get-selection): Define them to really use TYPE.
Richard M. Stallman <rms@gnu.org>
parents: 15338
diff changeset
308
24498
756058742361 (set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24441
diff changeset
309 (defun set-w32-system-coding-system (coding-system)
55792
0d890eccf70f (w32-using-nt, w32-shell-dos-semantics, set-w32-system-coding-system):
Juanma Barranquero <lekktu@gmail.com>
parents: 52401
diff changeset
310 "Set the coding system used by the Windows system to CODING-SYSTEM.
24498
756058742361 (set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24441
diff changeset
311 This is used for things like passing font names with non-ASCII
64563
3a895c8815ed (w32-shell-name): Use `bound-and-true-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
312 characters in them to the system. For a list of possible values of
41325
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
313 CODING-SYSTEM, use \\[list-coding-systems].
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
314
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
315 This function is provided for backward compatibility, since
55792
0d890eccf70f (w32-using-nt, w32-shell-dos-semantics, set-w32-system-coding-system):
Juanma Barranquero <lekktu@gmail.com>
parents: 52401
diff changeset
316 `w32-system-coding-system' is now an alias for `locale-coding-system'."
24498
756058742361 (set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24441
diff changeset
317 (interactive
41325
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
318 (list (let ((default locale-coding-system))
24498
756058742361 (set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24441
diff changeset
319 (read-coding-system
65680
ed770a0a7846 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65298
diff changeset
320 (format "Coding system for system calls (default %s): "
24498
756058742361 (set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24441
diff changeset
321 default)
756058742361 (set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24441
diff changeset
322 default))))
756058742361 (set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24441
diff changeset
323 (check-coding-system coding-system)
41325
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
324 (setq locale-coding-system coding-system))
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
325
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
326 ;; locale-coding-system was introduced to do the same thing as
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
327 ;; w32-system-coding-system. Use that instead.
65bad70edb17 (w32-system-coding-system): Change to an alias for
Jason Rumney <jasonr@gnu.org>
parents: 40458
diff changeset
328 (defvaralias 'w32-system-coding-system 'locale-coding-system)
24498
756058742361 (set-w32-system-coding-system) New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24441
diff changeset
329
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
330 ;; Set to a system sound if you want a fancy bell.
11399
f322675d5c53 Key [C-M-backspace] defined.
Karl Heuer <kwzh@gnu.org>
parents: 9803
diff changeset
331 (set-message-beep nil)
f322675d5c53 Key [C-M-backspace] defined.
Karl Heuer <kwzh@gnu.org>
parents: 9803
diff changeset
332
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
333 ;; The "Windows" keys on newer keyboards bring up the Start menu
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
334 ;; whether you want it or not - make Emacs ignore these keystrokes
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
335 ;; rather than beep.
19692
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
336 (global-set-key [lwindow] 'ignore)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
337 (global-set-key [rwindow] 'ignore)
4b8ff0021dcb Don't unset C-mouse-down bindings.
Geoff Voelker <voelker@cs.washington.edu>
parents: 17549
diff changeset
338
33385
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
339 (defun w32-add-charset-info (xlfd-charset windows-charset codepage)
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
340 "Function to add character sets to display with Windows fonts.
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
341 Creates entries in `w32-charset-info-alist'.
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
342 XLFD-CHARSET is a string which will appear in the XLFD font name to
98778
0f8ccfd21a74 * w32-fns.el (w32-check-shell-configuration): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 97221
diff changeset
343 identify the character set. WINDOWS-CHARSET is a symbol identifying
64563
3a895c8815ed (w32-shell-name): Use `bound-and-true-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
344 the Windows character set this maps to. For the list of possible
3a895c8815ed (w32-shell-name): Use `bound-and-true-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 64091
diff changeset
345 values, see the documentation for `w32-charset-info-alist'. CODEPAGE
33385
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
346 can be a numeric codepage that Windows uses to display the character
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
347 set, t for Unicode output with no codepage translation or nil for 8
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
348 bit output with no translation."
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
349 (add-to-list 'w32-charset-info-alist
98778
0f8ccfd21a74 * w32-fns.el (w32-check-shell-configuration): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents: 97221
diff changeset
350 (cons xlfd-charset (cons windows-charset codepage))))
33385
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
351
45814
8e79905a56dd (w32-charset-info-alist): Reorder.
Jason Rumney <jasonr@gnu.org>
parents: 43756
diff changeset
352 ;; The last charset we add becomes the "preferred" charset for the return
8e79905a56dd (w32-charset-info-alist): Reorder.
Jason Rumney <jasonr@gnu.org>
parents: 43756
diff changeset
353 ;; value from w32-select-font etc, so list the most important charsets last.
33385
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
354 (w32-add-charset-info "iso8859-14" 'w32-charset-ansi 28604)
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
355 (w32-add-charset-info "iso8859-15" 'w32-charset-ansi 28605)
89596
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
356 ;; The following two are included for pattern matching.
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
357 (w32-add-charset-info "jisx0201" 'w32-charset-shiftjis 932)
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
358 (w32-add-charset-info "jisx0208" 'w32-charset-shiftjis 932)
33385
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
359 (w32-add-charset-info "jisx0201-latin" 'w32-charset-shiftjis 932)
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
360 (w32-add-charset-info "jisx0201-katakana" 'w32-charset-shiftjis 932)
79980
399b25047283 Partially revert 2007-11-10 change.
Jason Rumney <jasonr@gnu.org>
parents: 79721
diff changeset
361 (w32-add-charset-info "ksc5601.1989" 'w32-charset-hangeul 949)
399b25047283 Partially revert 2007-11-10 change.
Jason Rumney <jasonr@gnu.org>
parents: 79721
diff changeset
362 (w32-add-charset-info "big5" 'w32-charset-chinesebig5 950)
399b25047283 Partially revert 2007-11-10 change.
Jason Rumney <jasonr@gnu.org>
parents: 79721
diff changeset
363 (w32-add-charset-info "gb2312.1980" 'w32-charset-gb2312 936)
33385
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
364 (w32-add-charset-info "ms-symbol" 'w32-charset-symbol nil)
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
365 (w32-add-charset-info "ms-oem" 'w32-charset-oem 437)
262bed8a9ecf (w32-add-charset-info): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33212
diff changeset
366 (w32-add-charset-info "ms-oemlatin" 'w32-charset-oem 850)
96385
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
367 (w32-add-charset-info "iso8859-2" 'w32-charset-easteurope 28592)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
368 (w32-add-charset-info "iso8859-3" 'w32-charset-turkish 28593)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
369 (w32-add-charset-info "iso8859-4" 'w32-charset-baltic 28594)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
370 (w32-add-charset-info "iso8859-6" 'w32-charset-arabic 28596)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
371 (w32-add-charset-info "iso8859-7" 'w32-charset-greek 28597)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
372 (w32-add-charset-info "iso8859-8" 'w32-charset-hebrew 1255)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
373 (w32-add-charset-info "iso8859-9" 'w32-charset-turkish 1254)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
374 (w32-add-charset-info "iso8859-13" 'w32-charset-baltic 1257)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
375 (w32-add-charset-info "koi8-r" 'w32-charset-russian 20866)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
376 (w32-add-charset-info "iso8859-5" 'w32-charset-russian 28595)
97221
b4be5834c484 (tis620-2533): Use as preferred registry for thai fonts.
Jason Rumney <jasonr@gnu.org>
parents: 96386
diff changeset
377 (w32-add-charset-info "tis620-2533" 'w32-charset-thai 874)
96385
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
378 (w32-add-charset-info "windows-1258" 'w32-charset-vietnamese 1258)
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
379 (w32-add-charset-info "ksc5601.1992" 'w32-charset-johab 1361)
96386
8a353ec4f1de Fix last change.
Jason Rumney <jasonr@gnu.org>
parents: 96385
diff changeset
380 (w32-add-charset-info "mac-roman" 'w32-charset-mac 10000)
8a353ec4f1de Fix last change.
Jason Rumney <jasonr@gnu.org>
parents: 96385
diff changeset
381 (w32-add-charset-info "iso10646-1" 'w32-charset-default t)
96385
01647003e227 * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight)
Jason Rumney <jasonr@gnu.org>
parents: 95841
diff changeset
382
89596
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
383 ;; ;; If unicode windows charset is not defined, use ansi fonts.
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
384 ;; (w32-add-charset-info "iso10646-1" 'w32-charset-ansi t))
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
385
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
386 ;; Prefered names
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
387 (w32-add-charset-info "big5-0" 'w32-charset-chinesebig5 950)
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
388 (w32-add-charset-info "gb2312.1980-0" 'w32-charset-gb2312 936)
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
389 (w32-add-charset-info "jisx0208-sjis" 'w32-charset-shiftjis 932)
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
390 (w32-add-charset-info "ksc5601.1987-0" 'w32-charset-hangeul 949)
967bca3bf3dd (w32-charset-info-alist): Accept more charset aliases.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
391 (w32-add-charset-info "tis620-0" 'w32-charset-thai 874)
45814
8e79905a56dd (w32-charset-info-alist): Reorder.
Jason Rumney <jasonr@gnu.org>
parents: 43756
diff changeset
392 (w32-add-charset-info "iso8859-1" 'w32-charset-ansi 1252)
28273
454890f5952d (w32-charset-info-alist): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 27521
diff changeset
393
33885
fd77fd05cecb add version to obsolete variables.
Jason Rumney <jasonr@gnu.org>
parents: 33385
diff changeset
394 (make-obsolete-variable 'w32-enable-italics
fd77fd05cecb add version to obsolete variables.
Jason Rumney <jasonr@gnu.org>
parents: 33385
diff changeset
395 'w32-enable-synthesized-fonts "21.1")
30237
c470ffbc2a4a (w32-enable-italics, w32-charset-to-codepage-alist): Declare as obsolete.
Jason Rumney <jasonr@gnu.org>
parents: 29323
diff changeset
396 (make-obsolete-variable 'w32-charset-to-codepage-alist
33885
fd77fd05cecb add version to obsolete variables.
Jason Rumney <jasonr@gnu.org>
parents: 33385
diff changeset
397 'w32-charset-info-alist "21.1")
30237
c470ffbc2a4a (w32-enable-italics, w32-charset-to-codepage-alist): Declare as obsolete.
Jason Rumney <jasonr@gnu.org>
parents: 29323
diff changeset
398
34369
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
399
110148
bcc7c00e9ef4 Remove cut buffer from documentation.
Jan D. <jan.h.d@swipnet.se>
parents: 110145
diff changeset
400 ;;;; Selections
34369
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
401
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
402 ;; We keep track of the last text selected here, so we can check the
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
403 ;; current selection against it, and avoid passing back our own text
110145
c403c2e0a620 Removed cut-buffer code.
Jan D. <jan.h.d@swipnet.se>
parents: 110015
diff changeset
404 ;; from x-selection-value.
34369
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
405 (defvar x-last-selected-text nil)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
406
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
407 (defun x-get-selection-value ()
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
408 "Return the value of the current selection.
110148
bcc7c00e9ef4 Remove cut buffer from documentation.
Jan D. <jan.h.d@swipnet.se>
parents: 110145
diff changeset
409 Consult the selection. Treat empty strings as if they were unset."
34369
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
410 (if x-select-enable-clipboard
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
411 (let (text)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
412 ;; Don't die if x-get-selection signals an error.
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
413 (condition-case c
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
414 (setq text (w32-get-clipboard-data))
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
415 (error (message "w32-get-clipboard-data:%s" c)))
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
416 (if (string= text "") (setq text nil))
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
417 (cond
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
418 ((not text) nil)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
419 ((eq text x-last-selected-text) nil)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
420 ((string= text x-last-selected-text)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
421 ;; Record the newer string, so subsequent calls can use the 'eq' test.
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
422 (setq x-last-selected-text text)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
423 nil)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
424 (t
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
425 (setq x-last-selected-text text))))))
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
426
110145
c403c2e0a620 Removed cut-buffer code.
Jan D. <jan.h.d@swipnet.se>
parents: 110015
diff changeset
427 (defalias 'x-selection-value 'x-get-selection-value)
34369
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
428
104706
76a2a2b0cf04 Fixup commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104135
diff changeset
429 ;; Arrange for the kill and yank functions to set and check the clipboard.
34369
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
430 (setq interprogram-cut-function 'x-select-text)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
431 (setq interprogram-paste-function 'x-get-selection-value)
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
432
67794
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
433
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
434 ;;;; Support for build process
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
435 (defun w32-batch-update-autoloads ()
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
436 "Like `batch-update-autoloads', but takes the name of the autoloads file
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
437 from the command line.
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
438
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
439 This is required because some Windows build environments, such as MSYS,
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
440 munge command-line arguments that include file names to a horrible mess
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
441 that Emacs is unable to cope with."
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
442 (let ((generated-autoload-file
105607
f937670ddf40 (w32-batch-update-autoloads): Take autoload-make-program from the
Glenn Morris <rgm@gnu.org>
parents: 105009
diff changeset
443 (expand-file-name (pop command-line-args-left)))
f937670ddf40 (w32-batch-update-autoloads): Take autoload-make-program from the
Glenn Morris <rgm@gnu.org>
parents: 105009
diff changeset
444 ;; I can only assume the same considerations may apply here...
f937670ddf40 (w32-batch-update-autoloads): Take autoload-make-program from the
Glenn Morris <rgm@gnu.org>
parents: 105009
diff changeset
445 (autoload-make-program (pop command-line-args-left)))
67794
09f3c0ac0073 (w32-batch-update-autoloads): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 65680
diff changeset
446 (batch-update-autoloads)))
34369
b5cb05f23e04 Add clipboard support from term/w32-win.el, so it is
Andrew Innes <andrewi@gnu.org>
parents: 33885
diff changeset
447
74511
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
448 (defun w32-append-code-lines (orig extra)
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
449 "Append non-empty non-comment lines in the file EXTRA to the file ORIG.
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
450
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
451 This function saves all buffers and kills the Emacs session, without asking
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
452 for any permissions.
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
453
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
454 This is required because the Windows build environment is not required
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
455 to include Sed, which is used by leim/Makefile.in to do the job."
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
456 (find-file orig)
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
457 (goto-char (point-max))
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
458 (insert-file-contents extra)
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
459 (delete-matching-lines "^$\\|^;")
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
460 (save-buffers-kill-emacs t))
de08a74adc2a (w32-append-code-lines): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
461
16592
a5e9fa379097 Use new file name w32-fns.el
Geoff Voelker <voelker@cs.washington.edu>
parents: 16028
diff changeset
462 ;;; w32-fns.el ends here