annotate lisp/emulation/pc-mode.el @ 60092:04686828d0da

2004-11-08 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> * w32select.c: Summary: Thorough rework to implement Unicode clipboard operations and delayed rendering. Drop last_clipboard_text and related code, keep track of ownership via clipboard_owner instead. Drop old #if0 sections. (DEFAULT_LCID, ANSICP, OEMCP, QUNICODE, QANSICP, QOEMCP) (clipboard_owner, modifying_clipboard, cfg_coding_system) (cfg_codepage, cfg_lcid, cfg_clipboard_type, current_text) (current_coding_system, current_requires_encoding) (current_num_nls, current_clipboard_type, current_lcid): New static variables. (convert_to_handle_as_ascii, convert_to_handle_as_coded) (render, render_all, run_protected, lisp_error_handler) (owner_callback, create_owner, setup_config) (enum_locale_callback, cp_from_locale, coding_from_cp): New local functions. (term_w32select, globals_of_w32select): New global functions. (Fw32_set_clipboard_data): Ignore parameter FRAME, use clipboard_owner instead. Use delayed rendering and provide all text formats. Provide CF_LOCALE if necessary. (Fw32_get_clipboard_data): Handle CF_UNICODETEXT and CF_LOCALE. Fall back to CF_TEXT, if CF_UNICODETEXT is not available. Force DOS line-ends for decoding. (Fx_selection_exists_p): Handle CF_UNICODETEXT. (syms_of_w32select): Init and register new variables. * w32.h: Add prototypes for globals_of_w32select and term_w32select. Make the neighboring K&R declarations into prototypes, too. * emacs.c: Include w32.h to get function prototypes. (main): Call globals_of_w32select. * w32.c (term_ntproc): Call term_w32select. * mule-cmds.el (set-locale-environment): Remove call to set-selection-coding-system on Windows. * s/ms-w32.h: Guard MSC-specific #pragmas with an #ifdef.
author Jason Rumney <jasonr@gnu.org>
date Tue, 15 Feb 2005 23:19:26 +0000
parents 695cf19ef79e
children 18a818a2ee7c 375f2633d815
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 18383
diff changeset
1 ;;; pc-mode.el --- emulate certain key bindings used on PCs
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
2
13336
f225e4de23b4 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 12372
diff changeset
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
12372
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
4
38695
01c7199c0ee7 Specify FSF as Maintainer.
Pavel Janík <Pavel@Janik.cz>
parents: 38414
diff changeset
5 ;; Maintainer: FSF
12372
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
6 ;; Keywords: emulations
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
7
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
8 ;; This file is part of GNU Emacs.
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
9
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
13 ;; any later version.
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
14
12372
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
18 ;; GNU General Public License for more details.
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
19
12372
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
20 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
23 ;; Boston, MA 02111-1307, USA.
12372
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
24
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 18383
diff changeset
25 ;;; Commentary:
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 18383
diff changeset
26
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13337
diff changeset
27 ;;; Code:
12372
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
28
91dc931a32c8 (pc-bindings-mode): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 11748
diff changeset
29 ;;;###autoload
11344
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 (defun pc-bindings-mode ()
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 "Set up certain key bindings for PC compatibility.
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 The keys affected are:
11748
f09f5b29f524 Add C-escape binding.
Richard M. Stallman <rms@gnu.org>
parents: 11747
diff changeset
33 Delete (and its variants) delete forward instead of backward.
f09f5b29f524 Add C-escape binding.
Richard M. Stallman <rms@gnu.org>
parents: 11747
diff changeset
34 C-Backspace kills backward a word (as C-Delete normally would).
f09f5b29f524 Add C-escape binding.
Richard M. Stallman <rms@gnu.org>
parents: 11747
diff changeset
35 M-Backspace does undo.
f09f5b29f524 Add C-escape binding.
Richard M. Stallman <rms@gnu.org>
parents: 11747
diff changeset
36 Home and End move to beginning and end of line
f09f5b29f524 Add C-escape binding.
Richard M. Stallman <rms@gnu.org>
parents: 11747
diff changeset
37 C-Home and C-End move to beginning and end of buffer.
f09f5b29f524 Add C-escape binding.
Richard M. Stallman <rms@gnu.org>
parents: 11747
diff changeset
38 C-Escape does list-buffers."
11344
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 (interactive)
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 (define-key function-key-map [delete] "\C-d")
11747
afc9c0b4fbb5 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 11344
diff changeset
42 (define-key function-key-map [M-delete] [?\M-d])
afc9c0b4fbb5 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 11344
diff changeset
43 (define-key function-key-map [C-delete] [?\M-d])
11344
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 (global-set-key [C-M-delete] 'kill-sexp)
11747
afc9c0b4fbb5 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 11344
diff changeset
45 (global-set-key [C-backspace] 'backward-kill-word)
afc9c0b4fbb5 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 11344
diff changeset
46 (global-set-key [M-backspace] 'undo)
11344
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47
11748
f09f5b29f524 Add C-escape binding.
Richard M. Stallman <rms@gnu.org>
parents: 11747
diff changeset
48 (global-set-key [C-escape] 'list-buffers)
f09f5b29f524 Add C-escape binding.
Richard M. Stallman <rms@gnu.org>
parents: 11747
diff changeset
49
11344
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 (global-set-key [home] 'beginning-of-line)
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 (global-set-key [end] 'end-of-line)
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 (global-set-key [C-home] 'beginning-of-buffer)
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 (global-set-key [C-end] 'end-of-buffer))
6f5c3bb789a5 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54
18383
11218164bc54 Add provide call.
Richard M. Stallman <rms@gnu.org>
parents: 15261
diff changeset
55 (provide 'pc-mode)
11218164bc54 Add provide call.
Richard M. Stallman <rms@gnu.org>
parents: 15261
diff changeset
56
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 38695
diff changeset
57 ;;; arch-tag: df007c05-f885-4cd0-8c1e-487d0f8dd9c9
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 18383
diff changeset
58 ;;; pc-mode.el ends here