Mercurial > hg > xemacs-beta
annotate lisp/keydefs.el @ 4952:19a72041c5ed
Mule-izing, various fixes related to char * arguments
-------------------- ChangeLog entries follow: --------------------
modules/ChangeLog addition:
2010-01-26 Ben Wing <ben@xemacs.org>
* postgresql/postgresql.c:
* postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
* postgresql/postgresql.c (print_pgresult):
* postgresql/postgresql.c (Fpq_conn_defaults):
* postgresql/postgresql.c (Fpq_connectdb):
* postgresql/postgresql.c (Fpq_connect_start):
* postgresql/postgresql.c (Fpq_result_status):
* postgresql/postgresql.c (Fpq_res_status):
Mule-ize large parts of it.
2010-01-26 Ben Wing <ben@xemacs.org>
* ldap/eldap.c (print_ldap):
* ldap/eldap.c (allocate_ldap):
Use write_ascstring().
src/ChangeLog addition:
2010-01-26 Ben Wing <ben@xemacs.org>
* alloc.c:
* alloc.c (build_ascstring):
* alloc.c (build_msg_cistring):
* alloc.c (staticpro_1):
* alloc.c (staticpro_name):
* alloc.c (staticpro_nodump_1):
* alloc.c (staticpro_nodump_name):
* alloc.c (unstaticpro_nodump_1):
* alloc.c (mcpro_1):
* alloc.c (mcpro_name):
* alloc.c (object_memory_usage_stats):
* alloc.c (common_init_alloc_early):
* alloc.c (init_alloc_once_early):
* buffer.c (print_buffer):
* buffer.c (vars_of_buffer):
* buffer.c (common_init_complex_vars_of_buffer):
* buffer.c (init_initial_directory):
* bytecode.c (invalid_byte_code):
* bytecode.c (print_compiled_function):
* bytecode.c (mark_compiled_function):
* chartab.c (print_table_entry):
* chartab.c (print_char_table):
* config.h.in:
* console-gtk.c:
* console-gtk.c (gtk_device_to_console_connection):
* console-gtk.c (gtk_semi_canonicalize_console_connection):
* console-gtk.c (gtk_canonicalize_console_connection):
* console-gtk.c (gtk_semi_canonicalize_device_connection):
* console-gtk.c (gtk_canonicalize_device_connection):
* console-stream.c (stream_init_frame_1):
* console-stream.c (vars_of_console_stream):
* console-stream.c (init_console_stream):
* console-x.c (x_semi_canonicalize_console_connection):
* console-x.c (x_semi_canonicalize_device_connection):
* console-x.c (x_canonicalize_device_connection):
* console-x.h:
* data.c (eq_with_ebola_notice):
* data.c (Fsubr_interactive):
* data.c (Fnumber_to_string):
* data.c (digit_to_number):
* device-gtk.c (gtk_init_device):
* device-msw.c (print_devmode):
* device-x.c (x_event_name):
* dialog-msw.c (handle_directory_dialog_box):
* dialog-msw.c (handle_file_dialog_box):
* dialog-msw.c (vars_of_dialog_mswindows):
* doc.c (weird_doc):
* doc.c (Fsnarf_documentation):
* doc.c (vars_of_doc):
* dumper.c (pdump):
* dynarr.c:
* dynarr.c (Dynarr_realloc):
* editfns.c (Fuser_real_login_name):
* editfns.c (get_home_directory):
* elhash.c (print_hash_table_data):
* elhash.c (print_hash_table):
* emacs.c (main_1):
* emacs.c (vars_of_emacs):
* emodules.c:
* emodules.c (_emodules_list):
* emodules.c (Fload_module):
* emodules.c (Funload_module):
* emodules.c (Flist_modules):
* emodules.c (find_make_module):
* emodules.c (attempt_module_delete):
* emodules.c (emodules_load):
* emodules.c (emodules_doc_subr):
* emodules.c (emodules_doc_sym):
* emodules.c (syms_of_module):
* emodules.c (vars_of_module):
* emodules.h:
* eval.c (print_subr):
* eval.c (signal_call_debugger):
* eval.c (build_error_data):
* eval.c (signal_error):
* eval.c (maybe_signal_error):
* eval.c (signal_continuable_error):
* eval.c (maybe_signal_continuable_error):
* eval.c (signal_error_2):
* eval.c (maybe_signal_error_2):
* eval.c (signal_continuable_error_2):
* eval.c (maybe_signal_continuable_error_2):
* eval.c (signal_ferror):
* eval.c (maybe_signal_ferror):
* eval.c (signal_continuable_ferror):
* eval.c (maybe_signal_continuable_ferror):
* eval.c (signal_ferror_with_frob):
* eval.c (maybe_signal_ferror_with_frob):
* eval.c (signal_continuable_ferror_with_frob):
* eval.c (maybe_signal_continuable_ferror_with_frob):
* eval.c (syntax_error):
* eval.c (syntax_error_2):
* eval.c (maybe_syntax_error):
* eval.c (sferror):
* eval.c (sferror_2):
* eval.c (maybe_sferror):
* eval.c (invalid_argument):
* eval.c (invalid_argument_2):
* eval.c (maybe_invalid_argument):
* eval.c (invalid_constant):
* eval.c (invalid_constant_2):
* eval.c (maybe_invalid_constant):
* eval.c (invalid_operation):
* eval.c (invalid_operation_2):
* eval.c (maybe_invalid_operation):
* eval.c (invalid_change):
* eval.c (invalid_change_2):
* eval.c (maybe_invalid_change):
* eval.c (invalid_state):
* eval.c (invalid_state_2):
* eval.c (maybe_invalid_state):
* eval.c (wtaerror):
* eval.c (stack_overflow):
* eval.c (out_of_memory):
* eval.c (print_multiple_value):
* eval.c (issue_call_trapping_problems_warning):
* eval.c (backtrace_specials):
* eval.c (backtrace_unevalled_args):
* eval.c (Fbacktrace):
* eval.c (warn_when_safe):
* event-Xt.c (modwarn):
* event-Xt.c (modbarf):
* event-Xt.c (check_modifier):
* event-Xt.c (store_modifier):
* event-Xt.c (emacs_Xt_format_magic_event):
* event-Xt.c (describe_event):
* event-gtk.c (dragndrop_data_received):
* event-gtk.c (store_modifier):
* event-gtk.c (gtk_reset_modifier_mapping):
* event-msw.c (dde_eval_string):
* event-msw.c (Fdde_alloc_advise_item):
* event-msw.c (mswindows_dde_callback):
* event-msw.c (FROB):
* event-msw.c (emacs_mswindows_format_magic_event):
* event-stream.c (external_debugging_print_event):
* event-stream.c (execute_help_form):
* event-stream.c (vars_of_event_stream):
* events.c (print_event_1):
* events.c (print_event):
* events.c (event_equal):
* extents.c (print_extent_1):
* extents.c (print_extent):
* extents.c (vars_of_extents):
* faces.c (print_face):
* faces.c (complex_vars_of_faces):
* file-coding.c:
* file-coding.c (print_coding_system):
* file-coding.c (print_coding_system_in_print_method):
* file-coding.c (default_query_method):
* file-coding.c (find_coding_system):
* file-coding.c (make_coding_system_1):
* file-coding.c (chain_print):
* file-coding.c (undecided_print):
* file-coding.c (gzip_print):
* file-coding.c (vars_of_file_coding):
* file-coding.c (complex_vars_of_file_coding):
* fileio.c:
* fileio.c (report_file_type_error):
* fileio.c (report_error_with_errno):
* fileio.c (report_file_error):
* fileio.c (barf_or_query_if_file_exists):
* fileio.c (vars_of_fileio):
* floatfns.c (matherr):
* fns.c (print_bit_vector):
* fns.c (Fmapconcat):
* fns.c (add_suffix_to_symbol):
* fns.c (add_prefix_to_symbol):
* frame-gtk.c:
* frame-gtk.c (Fgtk_window_id):
* frame-x.c (def):
* frame-x.c (x_cde_transfer_callback):
* frame.c:
* frame.c (Fmake_frame):
* gc.c (show_gc_cursor_and_message):
* gc.c (vars_of_gc):
* glyphs-eimage.c (png_instantiate):
* glyphs-eimage.c (tiff_instantiate):
* glyphs-gtk.c (gtk_print_image_instance):
* glyphs-msw.c (mswindows_print_image_instance):
* glyphs-x.c (x_print_image_instance):
* glyphs-x.c (update_widget_face):
* glyphs.c (make_string_from_file):
* glyphs.c (print_image_instance):
* glyphs.c (signal_image_error):
* glyphs.c (signal_image_error_2):
* glyphs.c (signal_double_image_error):
* glyphs.c (signal_double_image_error_2):
* glyphs.c (xbm_mask_file_munging):
* glyphs.c (pixmap_to_lisp_data):
* glyphs.h:
* gui.c (gui_item_display_flush_left):
* hpplay.c (player_error_internal):
* hpplay.c (myHandler):
* intl-win32.c:
* intl-win32.c (langcode_to_lang):
* intl-win32.c (sublangcode_to_lang):
* intl-win32.c (Fmswindows_get_locale_info):
* intl-win32.c (lcid_to_locale_mule_or_no):
* intl-win32.c (mswindows_multibyte_to_unicode_print):
* intl-win32.c (complex_vars_of_intl_win32):
* keymap.c:
* keymap.c (print_keymap):
* keymap.c (ensure_meta_prefix_char_keymapp):
* keymap.c (Fkey_description):
* keymap.c (Ftext_char_description):
* lisp.h:
* lisp.h (struct):
* lisp.h (DECLARE_INLINE_HEADER):
* lread.c (Fload_internal):
* lread.c (locate_file):
* lread.c (read_escape):
* lread.c (read_raw_string):
* lread.c (read1):
* lread.c (read_list):
* lread.c (read_compiled_function):
* lread.c (init_lread):
* lrecord.h:
* marker.c (print_marker):
* marker.c (marker_equal):
* menubar-msw.c (displayable_menu_item):
* menubar-x.c (command_builder_operate_menu_accelerator):
* menubar.c (vars_of_menubar):
* minibuf.c (reinit_complex_vars_of_minibuf):
* minibuf.c (complex_vars_of_minibuf):
* mule-charset.c (Fmake_charset):
* mule-charset.c (complex_vars_of_mule_charset):
* mule-coding.c (iso2022_print):
* mule-coding.c (fixed_width_query):
* number.c (bignum_print):
* number.c (ratio_print):
* number.c (bigfloat_print):
* number.c (bigfloat_finalize):
* objects-msw.c:
* objects-msw.c (mswindows_color_to_string):
* objects-msw.c (mswindows_color_list):
* objects-tty.c:
* objects-tty.c (tty_font_list):
* objects-tty.c (tty_find_charset_font):
* objects-xlike-inc.c (xft_find_charset_font):
* objects-xlike-inc.c (endif):
* print.c:
* print.c (write_istring):
* print.c (write_ascstring):
* print.c (Fterpri):
* print.c (Fprint):
* print.c (print_error_message):
* print.c (print_vector_internal):
* print.c (print_cons):
* print.c (print_string):
* print.c (printing_unreadable_object):
* print.c (print_internal):
* print.c (print_float):
* print.c (print_symbol):
* process-nt.c (mswindows_report_winsock_error):
* process-nt.c (nt_canonicalize_host_name):
* process-unix.c (unix_canonicalize_host_name):
* process.c (print_process):
* process.c (report_process_error):
* process.c (report_network_error):
* process.c (make_process_internal):
* process.c (Fstart_process_internal):
* process.c (status_message):
* process.c (putenv_internal):
* process.c (vars_of_process):
* process.h:
* profile.c (vars_of_profile):
* rangetab.c (print_range_table):
* realpath.c (vars_of_realpath):
* redisplay.c (vars_of_redisplay):
* search.c (wordify):
* search.c (Freplace_match):
* sheap.c (sheap_adjust_h):
* sound.c (report_sound_error):
* sound.c (Fplay_sound_file):
* specifier.c (print_specifier):
* symbols.c (Fsubr_name):
* symbols.c (do_symval_forwarding):
* symbols.c (set_default_buffer_slot_variable):
* symbols.c (set_default_console_slot_variable):
* symbols.c (store_symval_forwarding):
* symbols.c (default_value):
* symbols.c (defsymbol_massage_name_1):
* symbols.c (defsymbol_massage_name_nodump):
* symbols.c (defsymbol_massage_name):
* symbols.c (defsymbol_massage_multiword_predicate_nodump):
* symbols.c (defsymbol_massage_multiword_predicate):
* symbols.c (defsymbol_nodump):
* symbols.c (defsymbol):
* symbols.c (defkeyword):
* symbols.c (defkeyword_massage_name):
* symbols.c (check_module_subr):
* symbols.c (deferror_1):
* symbols.c (deferror):
* symbols.c (deferror_massage_name):
* symbols.c (deferror_massage_name_and_message):
* symbols.c (defvar_magic):
* symeval.h:
* symeval.h (DEFVAR_SYMVAL_FWD):
* sysdep.c:
* sysdep.c (init_system_name):
* sysdll.c:
* sysdll.c (MAYBE_PREPEND_UNDERSCORE):
* sysdll.c (dll_function):
* sysdll.c (dll_variable):
* sysdll.c (dll_error):
* sysdll.c (dll_open):
* sysdll.c (dll_close):
* sysdll.c (image_for_address):
* sysdll.c (my_find_image):
* sysdll.c (search_linked_libs):
* sysdll.h:
* sysfile.h:
* sysfile.h (DEFAULT_DIRECTORY_FALLBACK):
* syswindows.h:
* tests.c (DFC_CHECK_LENGTH):
* tests.c (DFC_CHECK_CONTENT):
* tests.c (Ftest_hash_tables):
* text.c (vars_of_text):
* text.h:
* tooltalk.c (tt_opnum_string):
* tooltalk.c (tt_message_arg_ival_string):
* tooltalk.c (Ftooltalk_default_procid):
* tooltalk.c (Ftooltalk_default_session):
* tooltalk.c (init_tooltalk):
* tooltalk.c (vars_of_tooltalk):
* ui-gtk.c (Fdll_load):
* ui-gtk.c (type_to_marshaller_type):
* ui-gtk.c (Fgtk_import_function_internal):
* ui-gtk.c (emacs_gtk_object_printer):
* ui-gtk.c (emacs_gtk_boxed_printer):
* unicode.c (unicode_to_ichar):
* unicode.c (unicode_print):
* unicode.c (unicode_query):
* unicode.c (vars_of_unicode):
* unicode.c (complex_vars_of_unicode):
* win32.c:
* win32.c (mswindows_report_process_error):
* window.c (print_window):
* xemacs.def.in.in:
BASIC IDEA: Further fixing up uses of char * and CIbyte *
to reflect their actual semantics; Mule-izing some code;
redoing of the not-yet-working code to handle message translation.
Clean up code to handle message-translation (not yet working).
Create separate versions of build_msg_string() for working with
Ibyte *, CIbyte *, and Ascbyte * arguments. Assert that Ascbyte *
arguments are pure-ASCII. Make build_msg_string() be the same
as build_msg_ascstring(). Create same three versions of GETTEXT()
and DEFER_GETTEXT(). Also create build_defer_string() and
variants for the equivalent of DEFER_GETTEXT() when building a
string. Remove old CGETTEXT(). Clean up code where GETTEXT(),
DEFER_GETTEXT(), build_msg_string(), etc. was being called and
introduce some new calls to build_msg_string(), etc. Remove
GETTEXT() from calls to weird_doc() -- we assume that the
message snarfer knows about weird_doc(). Remove uses of
DEFER_GETTEXT() from error messages in sysdep.c and instead use
special comments /* @@@begin-snarf@@@ */ and /* @@@end-snarf@@@ */
that the message snarfer presumably knows about.
Create build_ascstring() and use it in many instances in place
of build_string(). The purpose of having Ascbyte * variants is
to make the code more self-documenting in terms of what sort of
semantics is expected for char * strings. In fact in the process
of looking for uses of build_string(), much improperly Mule-ized
was discovered.
Mule-ize a lot of code as described in previous paragraph,
e.g. in sysdep.c.
Make the error functions take Ascbyte * strings and fix up a
couple of places where non-pure-ASCII strings were being passed in
(file-coding.c, mule-coding.c, unicode.c). (It's debatable whether
we really need to make the error functions work this way. It
helps catch places where code is written in a way that message
translation won't work, but we may well never implement message
translation.)
Make staticpro() and friends take Ascbyte * strings instead of
raw char * strings. Create a const_Ascbyte_ptr dynarr type
to describe what's held by staticpro_names[] and friends,
create pdump descriptions for const_Ascbyte_ptr dynarrs, and
use them in place of specially-crafted staticpro descriptions.
Mule-ize certain other functions (e.g. x_event_name) by correcting
raw use of char * to Ascbyte *, Rawbyte * or another such type,
and raw use of char[] buffers to another type (usually Ascbyte[]).
Change many uses of write_c_string() to write_msg_string(),
write_ascstring(), etc.
Mule-ize emodules.c, emodules.h, sysdll.h.
Fix some un-Mule-ized code in intl-win32.c.
A comment in event-Xt.c and the limitations of the message
snarfer (make-msgfile or whatever) is presumably incorrect --
it should be smart enough to handle function calls spread over
more than one line. Clean up code in event-Xt.c that was
written awkwardly for this reason.
In config.h.in, instead of NEED_ERROR_CHECK_TYPES_INLINES,
create a more general XEMACS_DEFS_NEEDS_INLINE_DECLS to
indicate when inlined functions need to be declared in
xemacs.defs.in.in, and make use of it in xemacs.defs.in.in.
We need to do this because postgresql.c now calls qxestrdup(),
which is an inline function.
Make nconc2() and other such functions MODULE_API and put
them in xemacs.defs.in.in since postgresql.c now uses them.
Clean up indentation in lread.c and a few other places.
In text.h, document ASSERT_ASCTEXT_ASCII() and
ASSERT_ASCTEXT_ASCII_LEN(), group together the stand-in
encodings and add some more for DLL symbols, function and
variable names, etc.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Tue, 26 Jan 2010 23:22:30 -0600 |
parents | 9e28067e3083 |
children | 308d34e9f07d |
rev | line source |
---|---|
428 | 1 ;;; keydefs.el --- Define standard keybindings. |
2 | |
3 ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc. | |
814 | 4 ;; Copyright (C) 2000, 2001, 2002 Ben Wing. |
428 | 5 |
6 ;; Maintainer: XEmacs Development Team | |
7 ;; Keywords: internal, dumped | |
8 | |
9 ;; This file is part of XEmacs. | |
10 | |
11 ;; XEmacs is free software; you can redistribute it and/or modify it | |
12 ;; under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; XEmacs is distributed in the hope that it will be useful, but | |
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 ;; General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
686 | 22 ;; along with XEmacs; see the file COPYING. If not, write to the |
428 | 23 ;; Free Software Foundation, 59 Temple Place - Suite 330, |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;; All the global bindings should be here so that one can reload things | |
27 ;; like files.el without trashing one's personal bindings. | |
28 | |
29 ;;; Synched up with: Not synched with FSF. | |
30 | |
31 ;;; Commentary: | |
32 | |
33 ;; This file is dumped with XEmacs | |
34 | |
35 ;;; Code: | |
36 | |
37 (defgroup keyboard nil | |
38 "Input from the keyboard." | |
39 :group 'environment) | |
40 | |
41 | |
42 ;; created by C code | |
43 (defvar global-map (current-global-map) "\ | |
44 Default global keymap mapping XEmacs keyboard input into commands. | |
45 The value is a keymap which is usually (but not necessarily) XEmacs's | |
46 global map.") | |
47 | |
48 ;; created by C code | |
49 (defvar esc-map (symbol-function 'ESC-prefix) "\ | |
50 Default keymap for ESC (meta) commands. | |
51 The normal global definition of the character ESC indirects to this keymap.") | |
52 | |
53 (set-keymap-name global-map 'global-map) | |
54 (set-keymap-name esc-map 'ESC-prefix) | |
55 | |
56 (define-prefix-command 'Control-X-prefix t) | |
57 (defvar ctl-x-map (symbol-function 'Control-X-prefix) "\ | |
58 Default keymap for C-x commands. | |
59 The normal global definition of the character C-x indirects to this keymap.") | |
60 (define-key global-map "\C-x" 'Control-X-prefix) | |
61 | |
62 (define-prefix-command 'ctl-x-4-prefix t) | |
63 (defvar ctl-x-4-map (symbol-function 'ctl-x-4-prefix) "\ | |
64 Keymap for subcommands of C-x 4") | |
65 (define-key global-map "\C-x4" 'ctl-x-4-prefix) | |
66 | |
67 (define-prefix-command 'ctl-x-5-prefix t) | |
68 (defvar ctl-x-5-map (symbol-function 'ctl-x-5-prefix) "\ | |
69 Keymap for subcommands of C-x 5") | |
70 (define-key global-map "\C-x5" 'ctl-x-5-prefix) | |
71 | |
72 (define-prefix-command 'mode-specific-command-prefix t) | |
73 (defvar mode-specific-map (symbol-function 'mode-specific-command-prefix) "\ | |
74 Keymap for characters following C-c.") | |
75 (define-key global-map "\C-c" 'mode-specific-command-prefix) | |
76 | |
77 ;; FSFmacs buffer.c | |
78 | |
79 (define-key global-map "\C-xb" 'switch-to-buffer) | |
80 (define-key global-map "\C-xk" 'kill-buffer) | |
81 (define-key global-map "\C-x\C-b" 'list-buffers) | |
82 (put 'erase-buffer 'disabled t) ;from buffer.c | |
83 | |
84 ;; FSFmacs casefiddle.c | |
85 | |
86 (define-key global-map "\C-x\C-u" 'upcase-region) | |
87 ;; This is silly with zmacs regions | |
88 ;(put 'upcase-region 'disabled t) | |
89 (define-key global-map "\C-x\C-l" 'downcase-region) | |
90 ;; This is silly with zmacs regions | |
91 ;(put 'downcase-region 'disabled t) | |
92 (define-key global-map "\M-u" 'upcase-region-or-word) | |
93 (define-key global-map "\M-l" 'downcase-region-or-word) | |
94 (define-key global-map "\M-c" 'capitalize-region-or-word) | |
95 | |
96 ;; FSFmacs cmds.c | |
97 | |
98 (let ((n 33)) | |
99 (while (<= n 255) | |
100 (if (not (= n 127)) | |
101 (define-key global-map n 'self-insert-command)) | |
102 (setq n (1+ n)))) | |
103 (define-key global-map " " 'self-insert-command) | |
104 | |
105 (define-key global-map "\C-a" 'beginning-of-line) | |
106 (define-key global-map "\C-b" 'backward-char-command) | |
107 (define-key global-map "\C-e" 'end-of-line) | |
108 (define-key global-map "\C-f" 'forward-char-command) | |
109 (define-key global-map "\C-d" 'delete-char) | |
110 | |
111 ;; FSFmacs files.el | |
112 | |
113 (define-key global-map "\C-x\C-f" 'find-file) | |
114 (define-key global-map "\C-x\C-q" 'toggle-read-only) | |
115 (define-key global-map "\C-x\C-r" 'find-file-read-only) | |
116 (define-key global-map "\C-x\C-v" 'find-alternate-file) | |
117 (define-key global-map "\C-x\C-s" 'save-buffer) | |
118 (define-key global-map "\C-xs" 'save-some-buffers) | |
119 (define-key global-map "\C-x\C-w" 'write-file) | |
120 (define-key global-map "\C-xi" 'insert-file) | |
121 (define-key global-map "\M-~" 'not-modified) | |
122 (define-key global-map "\C-x\C-d" 'list-directory) | |
123 (define-key global-map "\C-x\C-c" 'save-buffers-kill-emacs) | |
124 | |
1333 | 125 (define-key global-map "\C-x4c" 'clone-indirect-buffer-other-window) |
428 | 126 (define-key global-map "\C-x4f" 'find-file-other-window) |
127 (define-key global-map "\C-x4r" 'find-file-read-only-other-window) | |
128 (define-key global-map "\C-x4\C-f" 'find-file-other-window) | |
129 (define-key global-map "\C-x4b" 'switch-to-buffer-other-window) | |
130 (define-key global-map "\C-x4\C-o" 'display-buffer) | |
131 | |
132 (define-key global-map "\C-x5b" 'switch-to-buffer-other-frame) | |
133 (define-key global-map "\C-x5f" 'find-file-other-frame) | |
134 (define-key global-map "\C-x5\C-f" 'find-file-other-frame) | |
135 (define-key global-map "\C-x5r" 'find-file-read-only-other-frame) | |
136 | |
137 ;; FSFmacs frame.c | |
138 ;FSFmacs has these. It's probably a good idea to provide ways of hooking | |
139 ;these events, but it's unlikely that it's a good idea to do it this way. | |
140 ;Just provide a hook, like the existing `select-frame-hook', | |
141 ;`deselect-frame-hook', `map-frame-hook', and `unmap-frame-hook'. | |
142 ;#### ergo need hooks for delete-frame and iconify-frame | |
143 ;(define-key global-map 'switch-frame 'handle-switch-frame) | |
144 ;(define-key global-map 'delete-frame 'handle-delete-frame) | |
145 ;(define-key global-map 'iconify-frame 'ignore-event) | |
146 ;(define-key global-map 'make-frame-visible 'ignore-event) | |
147 | |
148 ;; FSFmacs frame.el | |
149 | |
150 ;; New FSF19 bindings: C-x 5 as prefix for window commands | |
151 (define-key global-map "\C-x52" 'make-frame) | |
152 (define-key global-map "\C-x50" 'delete-frame) | |
153 (define-key global-map "\C-x5o" 'other-frame) | |
716 | 154 ;; New FSF21 binding: |
155 (define-key global-map "\C-x51" 'delete-other-frames) | |
428 | 156 |
157 ;; FSFmacs help.el | |
158 | |
159 (define-key global-map (vector help-char) 'help-command) | |
160 (define-key global-map 'help 'help-command) | |
161 (define-key global-map 'f1 'help-command) | |
622 | 162 ;; This is a failsafe mechanism, esp. on TTY's, in case the terminal is |
163 ;; somewhat broken and f1 keys can't work, and backspace is redefined to | |
164 ;; do backspace. | |
165 (define-key global-map '(meta ??) 'help-command) | |
428 | 166 |
167 ;; FSFmacs indent.el | |
168 | |
169 ;;(define-key global-map "\t" 'self-insert-command) | |
170 (define-key global-map "\t" 'indent-for-tab-command) | |
814 | 171 (define-key global-map "\M-\C-\\" 'indent-region-or-balanced-expression) |
428 | 172 (define-key global-map "\C-x\t" 'indent-rigidly) |
173 (define-key global-map "\M-i" 'tab-to-tab-stop) | |
174 ;; XEmacs addition: | |
814 | 175 (define-key global-map [(shift tab)] 'self-insert-command) |
428 | 176 |
177 ;; FSFmacs isearch.el | |
178 | |
179 (define-key global-map "\C-s" 'isearch-forward) | |
180 (define-key global-map "\C-r" 'isearch-backward) | |
181 (define-key global-map "\M-\C-s" 'isearch-forward-regexp) | |
182 (define-key global-map "\M-\C-r" 'isearch-backward-regexp) | |
183 | |
184 ;; FSFmacs keyboard.c | |
185 | |
3547 | 186 (define-key global-tty-map "\C-z" 'suspend-or-iconify-emacs) |
771 | 187 (define-key global-window-system-map "\C-z" 'zap-up-to-char) |
188 (define-key global-window-system-map '(control Z) 'iconify-frame) | |
428 | 189 (define-key global-map "\C-x\C-z" 'suspend-or-iconify-emacs) |
190 | |
191 ;; FSFmacs loaddefs.el | |
192 | |
193 ;; New FSF19 bindings: C-x n as a prefix for narrowing commands. | |
194 (define-key global-map "\C-xn" (let ((map (make-sparse-keymap))) | |
195 (set-keymap-name map 'narrowing-prefix) | |
196 map)) | |
197 (put 'narrow-to-region 'disabled t) | |
198 (define-key global-map "\C-xnn" 'narrow-to-region) | |
199 (define-key global-map "\C-xnw" 'widen) | |
200 (define-key global-map "\C-xnd" 'narrow-to-defun) | |
201 ;; Old v18 bindings | |
202 ;(define-key global-map "\C-xn" 'narrow-to-region) | |
203 ;(define-key global-map "\C-xw" 'widen) | |
204 | |
205 (define-key global-map "\C-j" 'newline-and-indent) | |
206 (define-key global-map "\C-m" 'newline) | |
207 (define-key global-map "\C-o" 'open-line) | |
208 (define-key global-map "\M-\C-o" 'split-line) | |
209 (define-key global-map "\C-q" 'quoted-insert) | |
210 (define-key global-map "\M-^" 'delete-indentation) | |
211 (define-key global-map "\M-\\" 'delete-horizontal-space) | |
212 (define-key global-map "\M-m" 'back-to-indentation) | |
213 (define-key global-map "\C-x\C-o" 'delete-blank-lines) | |
214 (define-key global-map "\M- " 'just-one-space) | |
215 (define-key global-map "\M-z" 'zap-to-char) | |
216 (define-key global-map "\M-=" 'count-lines-region) | |
217 (define-key global-map "\C-x=" 'what-cursor-position) | |
218 (define-key global-map "\M-:" 'eval-expression) | |
219 ;; Define ESC ESC : like ESC : for people who type ESC ESC out of habit. | |
771 | 220 ;(define-key global-map "\M-\e:" 'eval-expression) |
428 | 221 ;(define-key global-map "\M-\e" 'eval-expression) |
222 ;; Do we really need to disable this now that it is harder to type | |
223 ;; by accident? | |
224 ;; (put 'eval-expression 'disabled t) | |
225 ;; Changed from C-x ESC so that function keys work following C-x. | |
771 | 226 ;; FMH! I tried putting back C-x ESC using global-window-system-map and |
227 ;; removing the other bindings, but it doesn't work! I don't understand why | |
228 ;; M-ESC ESC (i.e. ESC ESC ESC) does work. | |
428 | 229 (define-key global-map "\C-x\e\e" 'repeat-complex-command) |
230 ;; From Emacs 20. | |
231 (define-key global-map "\C-x\M-:" 'repeat-complex-command) | |
771 | 232 (define-key global-map "\C-xu" 'undo) |
428 | 233 ;; Many people are used to typing C-/ on X terminals and getting C-_. |
234 (define-key global-map '(control /) 'undo) | |
235 (define-key global-map "\C-_" 'undo) | |
236 (define-key global-map "\M-!" 'shell-command) | |
237 (define-key global-map "\M-|" 'shell-command-on-region) | |
238 | |
239 (define-key global-map "\C-u" 'universal-argument) | |
240 ;; Make Control-0 - Control-9 set the prefix argument, like Meta-0. | |
241 (let ((i ?0)) | |
242 (while (<= i ?9) | |
243 (define-key global-map (list 'meta i) 'digit-argument) | |
244 (define-key global-map (list 'control i) 'digit-argument) | |
245 (define-key global-map (list 'control 'meta i) 'digit-argument) | |
246 (setq i (1+ i)))) | |
247 (define-key global-map '(meta -) 'negative-argument) | |
248 (define-key global-map '(control -) 'negative-argument) | |
249 (define-key global-map '(control meta -) 'negative-argument) | |
250 | |
251 (define-key global-map "\C-k" 'kill-line) | |
462 | 252 ;will change like this in 21.5. |
253 ;(define-key global-map "\M-k" 'kill-entire-line) | |
428 | 254 (define-key global-map "\C-w" 'kill-region) |
255 (define-key global-map "\M-w" 'kill-ring-save) | |
256 (define-key global-map "\M-\C-w" 'append-next-kill) | |
257 (define-key global-map "\C-y" 'yank) | |
258 (define-key global-map "\M-y" 'yank-pop) | |
259 | |
260 ;; Old v18 binding | |
261 ;(define-key global-map "\C-xa" 'append-to-buffer) | |
262 | |
263 (define-key global-map "\C-@" 'set-mark-command) | |
264 ;; Many people are used to typing C-SPC and getting C-@. | |
265 (define-key global-map '(control ? ) 'set-mark-command) | |
266 (define-key global-map "\C-x\C-x" 'exchange-point-and-mark) | |
267 (define-key global-map "\C-x\C-@" 'pop-global-mark) | |
268 (define-key global-map [(control x) (control ? )] 'pop-global-mark) | |
269 | |
270 (define-key global-map "\C-n" 'next-line) | |
271 (define-key global-map "\C-p" 'previous-line) | |
272 ;(define-key global-map "\C-x\C-n" 'set-goal-column) | |
273 ;; XEmacs: | |
274 ;;; Many people have said they rarely use this feature, and often type | |
275 ;;; it by accident. Maybe it shouldn't even be on a key. | |
276 ;;; Done. -hniksic | |
277 ;(put 'set-goal-column 'disabled t) | |
278 | |
487 | 279 (define-key global-map 'menu 'popup-mode-menu) |
428 | 280 (define-key global-map [find] 'search-forward) |
281 | |
282 (define-key global-map "\C-t" 'transpose-chars) | |
283 (define-key global-map "\M-t" 'transpose-words) | |
284 (define-key global-map "\M-\C-t" 'transpose-sexps) | |
285 (define-key global-map "\C-x\C-t" 'transpose-lines) | |
286 | |
442 | 287 ;; XEmacs: much more reasonable and useful key definitions. |
288 (define-key global-map '(control T) 'transpose-line-down) | |
289 (define-key global-map '(meta T) 'transpose-line-up) | |
290 | |
428 | 291 (define-key global-map "\M-;" 'indent-for-comment) |
292 (define-key global-map "\M-j" 'indent-new-comment-line) | |
293 (define-key global-map "\M-\C-j" 'indent-new-comment-line) | |
294 (define-key global-map "\C-x;" 'set-comment-column) | |
295 (define-key global-map "\C-xf" 'set-fill-column) | |
296 (define-key global-map "\C-x$" 'set-selective-display) | |
297 | |
298 (define-key global-map "\M-@" 'mark-word) | |
299 (define-key global-map "\M-f" 'forward-word) | |
300 (define-key global-map "\M-b" 'backward-word) | |
301 (define-key global-map "\M-d" 'kill-word) | |
302 | |
303 (define-key global-map "\M-<" 'beginning-of-buffer) | |
304 (define-key global-map "\M->" 'end-of-buffer) | |
305 (define-key global-map "\C-xh" 'mark-whole-buffer) | |
306 (define-key global-map "\M-\\" 'delete-horizontal-space) | |
307 | |
308 (define-key global-map "\M-\C-f" 'forward-sexp) | |
309 (define-key global-map "\M-\C-b" 'backward-sexp) | |
310 (define-key global-map "\M-\C-u" 'backward-up-list) | |
311 (define-key global-map "\M-\C-@" 'mark-sexp) | |
312 (define-key global-map "\M-\C-d" 'down-list) | |
313 (define-key global-map "\M-\C-k" 'kill-sexp) | |
314 (define-key global-map "\M-\C-n" 'forward-list) | |
315 (define-key global-map "\M-\C-p" 'backward-list) | |
316 (define-key global-map "\M-\C-a" 'beginning-of-defun) | |
317 (define-key global-map "\M-\C-e" 'end-of-defun) | |
318 (define-key global-map "\M-\C-h" 'mark-defun) | |
319 (define-key global-map "\M-\(" 'insert-parentheses) | |
320 (define-key global-map "\M-\)" 'move-past-close-and-reindent) | |
321 (define-key global-map "\M-\t" 'lisp-complete-symbol) | |
322 | |
323 | |
324 (define-key global-map "\C-x/" 'point-to-register) | |
325 (define-key global-map "\C-xj" 'jump-to-register) | |
326 (define-key global-map "\C-xx" 'copy-to-register) | |
327 (define-key global-map "\C-xg" 'insert-register) | |
328 ;; Old v18 binding | |
329 ;(define-key global-map "\C-xr" 'copy-rectangle-to-register) | |
330 | |
331 ;; New FSF19 bindings: C-x r as a prefix for register commands | |
332 (define-key global-map "\C-xr" (let ((map (make-sparse-keymap))) | |
333 (set-keymap-name map 'rectangle-prefix) | |
334 map)) | |
335 (define-key global-map "\C-xr\C-@" 'point-to-register) | |
336 (define-key global-map "\C-xr " 'point-to-register) | |
337 (define-key global-map "\C-xrj" 'jump-to-register) | |
338 (define-key global-map "\C-xrs" 'copy-to-register) | |
339 (define-key global-map "\C-xrx" 'copy-to-register) | |
340 (define-key global-map "\C-xri" 'insert-register) | |
341 (define-key global-map "\C-xrg" 'insert-register) | |
342 (define-key global-map "\C-xrr" 'copy-rectangle-to-register) | |
343 (define-key global-map "\C-xrn" 'number-to-register) | |
344 (define-key global-map "\C-xr+" 'increment-register) | |
345 (define-key global-map "\C-xrc" 'clear-rectangle) | |
346 (define-key global-map "\C-xrk" 'kill-rectangle) | |
1034 | 347 (define-key global-map "\C-xrd" 'delete-rectangle) |
428 | 348 (define-key global-map "\C-xry" 'yank-rectangle) |
349 (define-key global-map "\C-xro" 'open-rectangle) | |
350 (define-key global-map "\C-xrt" 'string-rectangle) | |
686 | 351 (define-key global-map "\C-xrp" 'replace-rectangle) |
428 | 352 (define-key global-map "\C-xrw" 'window-configuration-to-register) |
353 ;(define-key global-map "\C-xrf" 'frame-configuration-to-register) | |
354 | |
355 (define-key global-map "\M-q" 'fill-paragraph-or-region) | |
356 ;(define-key global-map "\M-q" 'fill-paragraph) | |
357 ;(define-key global-map "\M-g" 'fill-region) ;now bound to goto-line | |
358 (define-key global-map "\C-x." 'set-fill-prefix) | |
359 | |
360 ; Using {} instead of [] is 1) FSF compatible and 2) allows function | |
361 ; keys to work on ttys. M-[ is the beginning of most the function key | |
362 ; sequences. | |
363 (define-key global-map "\M-{" 'backward-paragraph) | |
364 (define-key global-map "\M-}" 'forward-paragraph) | |
365 (define-key global-map "\M-h" 'mark-paragraph) | |
366 (define-key global-map "\M-a" 'backward-sentence) | |
367 (define-key global-map "\M-e" 'forward-sentence) | |
368 (define-key global-map "\M-k" 'kill-sentence) | |
462 | 369 ;will change like this in 21.5. |
370 ;(define-key global-map "\M-K" 'kill-sentence) | |
428 | 371 ;;(define-key global-map "\C-x\177" 'backward-kill-sentence) |
372 | |
373 (define-key global-map "\C-x[" 'backward-page) | |
374 (define-key global-map "\C-x]" 'forward-page) | |
375 (define-key global-map "\C-x\C-p" 'mark-page) | |
376 (define-key global-map "\C-xl" 'count-lines-page) | |
377 (define-key global-map "\C-xnp" 'narrow-to-page) | |
378 ;; Old v18 bindings | |
379 ;(define-key global-map "\C-xp" 'narrow-to-page) | |
380 (put 'narrow-to-page 'disabled t) | |
381 | |
382 ;; Old v18 bindings | |
383 ;(define-key global-map "\C-x\C-a" 'add-mode-abbrev) | |
384 ;(define-key global-map "\C-x+" 'add-global-abbrev) | |
385 ;(define-key global-map "\C-x\C-h" 'inverse-add-mode-abbrev) | |
386 ;(define-key global-map "\C-x-" 'inverse-add-global-abbrev) | |
387 | |
388 (define-key global-map "\M-'" 'abbrev-prefix-mark) | |
389 (define-key global-map "\C-x'" 'expand-abbrev) | |
390 | |
391 ;; New FSF19 bindings: C-x a as a prefix for abbrev commands | |
392 (define-key global-map "\C-xal" 'add-mode-abbrev) | |
393 (define-key global-map "\C-xa\C-a" 'add-mode-abbrev) | |
394 (define-key global-map "\C-xag" 'add-global-abbrev) | |
395 (define-key global-map "\C-xa+" 'add-mode-abbrev) | |
396 (define-key global-map "\C-xaig" 'inverse-add-global-abbrev) | |
397 (define-key global-map "\C-xail" 'inverse-add-mode-abbrev) | |
398 (define-key global-map "\C-xa-" 'inverse-add-global-abbrev) | |
399 (define-key global-map "\C-xae" 'expand-abbrev) | |
400 (define-key global-map "\C-xa'" 'expand-abbrev) | |
401 | |
402 (define-key global-map "\M-\C-l" 'switch-to-other-buffer) | |
403 | |
404 ;; Default binding of "Backspace" is no longer the same as delete. | |
405 ;; Default binding of "Control-h" is help. | |
406 (define-key global-map 'backspace 'delete-backward-char) | |
407 (define-key global-map '(meta backspace) 'backward-kill-word) | |
442 | 408 (define-key global-map [(control x) backspace] 'backward-kill-sentence) |
428 | 409 |
410 (define-key global-map "\M-\C-z" 'activate-region) | |
411 | |
412 ;; FSFmacs macros.c | |
413 | |
414 (define-key global-map "\C-xe" 'call-last-kbd-macro) | |
415 (define-key global-map "\C-x\(" 'start-kbd-macro) | |
416 (define-key global-map "\C-x\)" 'end-kbd-macro) | |
417 | |
418 ;; FSFmacs macros.el | |
419 | |
420 (define-key global-map "\C-xq" 'kbd-macro-query) | |
421 | |
422 | |
423 ;; FSFmacs minibuffer.c | |
424 ; see also minibuf.el | |
425 | |
426 (define-key global-map "\M-\C-c" 'exit-recursive-edit) | |
427 (define-key global-map "\C-]" 'abort-recursive-edit) | |
428 (define-key global-map "\M-x" 'execute-extended-command) | |
429 | |
430 ;; FSFmacs window.c | |
431 | |
432 (define-key global-map "\C-x0" 'delete-window) | |
433 (define-key global-map "\C-x1" 'delete-other-windows) | |
434 (define-key global-map "\C-x2" 'split-window-vertically) | |
435 (define-key global-map "\C-x3" 'split-window-horizontally) | |
436 ;; Old XEmacs binding | |
437 ;;(define-key global-map "\C-x5" 'split-window-horizontally) | |
438 (define-key global-map "\C-xo" 'other-window) | |
439 (define-key global-map "\C-x^" 'enlarge-window) | |
440 (define-key global-map "\C-x<" 'scroll-left) | |
441 (define-key global-map "\C-x>" 'scroll-right) | |
442 | |
443 (define-key global-map "\C-v" 'scroll-up-command) | |
444 (define-key global-map "\M-v" 'scroll-down-command) | |
445 (define-key global-map "\M-\C-v" 'scroll-other-window) | |
446 ; meta-shift-V, that is. | |
447 (define-key global-map '(meta V) 'scroll-other-window-down) | |
448 | |
449 (define-key global-map "\C-l" 'recenter) | |
450 (define-key global-map "\M-r" 'move-to-window-line) | |
451 | |
452 ;; FSFmacs window.el | |
453 | |
454 (define-key global-map "\C-x6" 'window-configuration-to-register) | |
455 ;(define-key global-map "\C-x7" 'jump-to-register);ie register-to-window-config | |
456 (define-key global-map "\C-x}" 'enlarge-window-horizontally) | |
457 (define-key global-map "\C-x{" 'shrink-window-horizontally) | |
458 ;; New FSF19 bindings | |
459 (define-key global-map "\C-x-" 'shrink-window-if-larger-than-buffer) | |
460 (define-key global-map "\C-x+" 'balance-windows) | |
461 (define-key ctl-x-4-map "0" 'kill-buffer-and-window) | |
462 | |
463 ;;(define-key global-map "\C-g" 'keyboard-quit) | |
464 (let ((ch (quit-char))) | |
465 (if (or (characterp ch) (integerp ch)) | |
466 (setq ch (char-to-string ch))) | |
467 (define-key global-map ch 'keyboard-quit)) | |
771 | 468 (define-key global-tty-map "\e\e\e" 'keyboard-escape-quit) |
469 (define-key global-window-system-map "\e\e" 'keyboard-escape-quit) | |
428 | 470 |
471 (define-key global-map "\M-%" 'query-replace) | |
472 | |
473 ;; FSF v20 binding | |
474 (define-key global-map [(control meta %)] 'query-replace-regexp) | |
475 | |
476 | |
477 ; autoloaded | |
478 ;(define-key global-map "\C-x4a" 'add-change-log-entry-other-window) | |
479 | |
480 ; autoloaded | |
481 ;(define-key global-map "\C-x`" 'next-error) | |
482 | |
483 ; autoloaded | |
484 ;(define-key global-map "\M-/" 'dabbrev-expand) | |
485 | |
486 ; autoloaded | |
487 ;(define-key global-map "\C-xd" 'dired) | |
488 | |
489 ; autoloaded | |
490 ;(define-key global-map "\C-x4d" 'dired-other-window) | |
491 | |
492 (define-key global-map "\M-$" 'ispell-word) | |
493 | |
494 (define-key global-map "\C-xm" 'compose-mail) | |
495 (define-key global-map "\C-x4m" 'compose-mail-other-window) | |
496 (define-key global-map "\C-x5m" 'compose-mail-other-frame) | |
497 | |
498 (define-key global-map "\M-." 'find-tag) | |
499 | |
500 (define-key global-map "\C-x4." 'find-tag-other-window) | |
501 | |
502 (define-key global-map "\M-," 'tags-loop-continue) | |
503 | |
504 | |
505 (define-key global-map '(control <) 'mark-beginning-of-buffer) | |
506 (define-key global-map '(control >) 'mark-end-of-buffer) | |
507 | |
508 (define-key global-map "\C-x\C-e" 'eval-last-sexp) ;bogus! | |
509 | |
510 | |
511 (define-key global-map "\M-g" 'goto-line) | |
512 | |
513 ;; Keypad type things | |
514 | |
515 ;; I removed all the fkey crap, because where-is is now smart enough | |
516 ;; to show all bindings. --ben | |
517 | |
518 ;;; These aren't bound to kbd macros like "\C-b" so that they have the | |
519 ;; expected behavior even in, for example, vi-mode. | |
520 | |
521 ;; We use here symbolic names, assuming that the corresponding keys will | |
686 | 522 ;; generate these keysyms. This is not true on Suns, but x-win-sun.el |
428 | 523 ;; fixes that. If it turns out that the semantics of these keys should |
524 ;; differ from server to server, this should be moved into server-specific | |
525 ;; files, but these appear to be the standard Motif and PC bindings. | |
526 | |
527 ;; movement by units | |
528 (define-key global-map 'left 'backward-char-command) | |
442 | 529 (define-key global-map 'right 'forward-char-command) |
428 | 530 (define-key global-map 'up 'previous-line) |
531 (define-key global-map 'down 'next-line) | |
442 | 532 (define-key global-map 'kp-left 'backward-char-command) |
533 (define-key global-map 'kp-right 'forward-char-command) | |
534 (define-key global-map 'kp-up 'previous-line) | |
535 (define-key global-map 'kp-down 'next-line) | |
428 | 536 |
537 ;; movement by pages | |
538 (define-key global-map 'prior 'scroll-down-command) | |
539 (define-key global-map 'next 'scroll-up-command) | |
540 (define-key global-map '(control prior) 'scroll-right) | |
541 (define-key global-map '(control next) 'scroll-left) | |
542 (define-key global-map 'kp-prior 'scroll-down-command) | |
543 (define-key global-map 'kp-next 'scroll-up-command) | |
544 (define-key global-map '(control kp-prior) 'scroll-right) | |
545 (define-key global-map '(control kp-next) 'scroll-left) | |
546 | |
547 ;; movement to the limits | |
442 | 548 (define-key global-map 'home 'beginning-of-line) |
549 (define-key global-map 'end 'end-of-line) | |
428 | 550 (define-key global-map '(control home) 'beginning-of-buffer) |
551 (define-key global-map '(control end) 'end-of-buffer) | |
442 | 552 (define-key global-map 'kp-home 'beginning-of-line) |
553 (define-key global-map 'kp-end 'end-of-line) | |
554 (define-key global-map '(control kp-home) 'beginning-of-buffer) | |
555 (define-key global-map '(control kp-end) 'end-of-buffer) | |
556 | |
557 ;; on which systems do these exist? | |
428 | 558 (define-key global-map 'begin 'beginning-of-line) |
559 (define-key global-map '(control begin) 'beginning-of-buffer) | |
442 | 560 |
561 ;; movement by larger blocks | |
562 (define-key global-map '(control left) 'backward-word) | |
563 (define-key global-map '(control right) 'forward-word) | |
564 (define-key global-map '(control up) 'backward-block-of-lines) | |
565 (define-key global-map '(control down) 'forward-block-of-lines) | |
566 (define-key global-map '(control kp-left) 'backward-word) | |
567 (define-key global-map '(control kp-right) 'forward-word) | |
568 (define-key global-map '(control kp-up) 'backward-block-of-lines) | |
569 (define-key global-map '(control kp-down) 'forward-block-of-lines) | |
570 | |
571 ;; context-sensitive movement | |
572 (define-key global-map '(meta left) 'backward-sexp) | |
573 (define-key global-map '(meta right) 'forward-sexp) | |
574 (define-key global-map '(meta up) 'backward-paragraph) | |
575 (define-key global-map '(meta down) 'forward-paragraph) | |
576 (define-key global-map '(meta control left) 'backward-sentence) | |
577 (define-key global-map '(meta control right) 'forward-sentence) | |
578 (define-key global-map '(meta control up) 'scroll-down-one) | |
579 (define-key global-map '(meta control down) 'scroll-up-one) | |
580 (define-key global-map '(meta control home) 'beginning-of-defun) | |
581 (define-key global-map '(meta control end) 'end-of-defun) | |
582 (define-key global-map '(meta control prior) 'backward-page) | |
583 (define-key global-map '(meta control next) 'forward-page) | |
584 (define-key global-map '(meta kp-left) 'backward-sexp) | |
585 (define-key global-map '(meta kp-right) 'forward-sexp) | |
586 (define-key global-map '(meta kp-up) 'backward-paragraph) | |
587 (define-key global-map '(meta kp-down) 'forward-paragraph) | |
588 (define-key global-map '(meta control kp-left) 'backward-sentence) | |
589 (define-key global-map '(meta control kp-right) 'forward-sentence) | |
590 (define-key global-map '(meta control kp-up) 'scroll-down-one) | |
591 (define-key global-map '(meta control kp-down) 'scroll-up-one) | |
592 (define-key global-map '(meta control kp-home) 'beginning-of-defun) | |
593 (define-key global-map '(meta control kp-end) 'end-of-defun) | |
594 (define-key global-map '(meta control kp-prior) 'backward-page) | |
595 (define-key global-map '(meta control kp-next) 'forward-page) | |
428 | 596 |
597 ;; movement between windows | |
598 (define-key global-map '(control tab) 'other-window) | |
599 (define-key global-map '(control shift tab) 'backward-other-window) | |
600 | |
601 ;; movement in other windows | |
602 (define-key global-map '(meta next) 'scroll-other-window) | |
603 (define-key global-map '(meta prior) 'scroll-other-window-down) | |
604 (define-key global-map '(meta kp-next) 'scroll-other-window) | |
605 (define-key global-map '(meta kp-prior) 'scroll-other-window-down) | |
771 | 606 |
607 ;; movement between buffers | |
608 (global-set-key '(meta shift home) 'switch-to-previous-buffer-in-group) | |
609 (global-set-key '(meta shift end) 'switch-to-next-buffer-in-group) | |
610 (global-set-key '(meta home) 'switch-to-previous-buffer) | |
611 (global-set-key '(meta end) 'switch-to-next-buffer) | |
612 (global-set-key '(meta shift kp-home) 'switch-to-previous-buffer-in-group) | |
613 (global-set-key '(meta shift kp-end) 'switch-to-next-buffer-in-group) | |
614 (global-set-key '(meta kp-home) 'switch-to-previous-buffer) | |
615 (global-set-key '(meta kp-end) 'switch-to-next-buffer) | |
428 | 616 |
442 | 617 ;; the infamous delete key |
618 (define-key global-map 'delete 'backward-or-forward-delete-char) | |
832 | 619 (define-key global-map '(control delete) 'backward-or-forward-kill-word) |
442 | 620 (define-key global-map '(meta delete) 'backward-or-forward-kill-word) |
621 (define-key global-map [(control x) (delete)] | |
622 'backward-or-forward-kill-sentence) | |
4397
9e28067e3083
Bind '(shift delete) to #'kill-primary-selection by default.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4315
diff
changeset
|
623 (define-key global-map '(shift delete) 'kill-primary-selection) |
9e28067e3083
Bind '(shift delete) to #'kill-primary-selection by default.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4315
diff
changeset
|
624 |
442 | 625 (define-key global-map 'kp-delete 'backward-or-forward-delete-char) |
832 | 626 (define-key global-map '(control kp-delete) 'backward-or-forward-kill-word) |
442 | 627 (define-key global-map '(meta kp-delete) 'backward-or-forward-kill-word) |
628 (define-key global-map [(control x) (kp-delete)] | |
629 'backward-or-forward-kill-sentence) | |
630 | |
4397
9e28067e3083
Bind '(shift delete) to #'kill-primary-selection by default.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4315
diff
changeset
|
631 (define-key global-map '(shift kp-delete) 'kill-primary-selection) |
9e28067e3083
Bind '(shift delete) to #'kill-primary-selection by default.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4315
diff
changeset
|
632 |
442 | 633 ;; don't try this one at home, kids. |
634 (define-key global-map '(control meta delete) 'backward-or-forward-kill-sexp) | |
635 (define-key global-map '(control meta kp-delete) 'backward-or-forward-kill-sexp) | |
636 ;; or this one, either, on Linux. | |
637 (define-key global-map '(control meta backspace) 'backward-kill-sexp) | |
638 | |
639 | |
640 ;;; Miscellaneous key bindings | |
641 (define-key global-map 'insert 'overwrite-mode) | |
642 (define-key global-map 'kp-insert 'overwrite-mode) | |
643 (define-key global-map 'again 'repeat-complex-command) | |
428 | 644 (define-key global-map 'redo 'repeat-complex-command) |
645 | |
646 (define-key global-map 'kp-enter [return]) ; do whatever RET does now | |
647 (define-key global-map 'kp-tab [tab]) | |
648 | |
649 (define-key global-map 'undo 'undo) | |
650 (define-key global-map 'help 'help-for-help) | |
651 | |
652 (define-key global-map 'kp-space 'self-insert-command) | |
653 (define-key global-map 'kp-equal 'self-insert-command) | |
654 (define-key global-map 'kp-multiply 'self-insert-command) | |
655 (define-key global-map 'kp-add 'self-insert-command) | |
656 (define-key global-map 'kp-separator 'self-insert-command) | |
657 (define-key global-map 'kp-subtract 'self-insert-command) | |
658 (define-key global-map 'kp-decimal 'self-insert-command) | |
659 (define-key global-map 'kp-divide 'self-insert-command) | |
660 | |
661 (define-key global-map 'kp-0 'self-insert-command) | |
662 (define-key global-map 'kp-1 'self-insert-command) | |
663 (define-key global-map 'kp-2 'self-insert-command) | |
664 (define-key global-map 'kp-3 'self-insert-command) | |
665 (define-key global-map 'kp-4 'self-insert-command) | |
666 (define-key global-map 'kp-5 'self-insert-command) | |
667 (define-key global-map 'kp-6 'self-insert-command) | |
668 (define-key global-map 'kp-7 'self-insert-command) | |
669 (define-key global-map 'kp-8 'self-insert-command) | |
670 (define-key global-map 'kp-9 'self-insert-command) | |
671 | |
1435 | 672 ;(define-key global-map 'select 'function-key-error) |
673 ;(define-key global-map 'print 'function-key-error) | |
428 | 674 (define-key global-map 'execute 'execute-extended-command) |
1435 | 675 ;(define-key global-map 'clearline 'function-key-error) |
428 | 676 (define-key global-map 'insertline 'open-line) |
677 (define-key global-map 'deleteline 'kill-line) | |
1435 | 678 ;(define-key global-map 'insertchar 'function-key-error) |
428 | 679 (define-key global-map 'deletechar 'delete-char) |
680 | |
4315
26ec8d0f3a9c
Bind mouse wheel movements by default,
Aidan Kehoe <kehoea@parhasard.net>
parents:
3547
diff
changeset
|
681 ;; Bind the mouse wheel by default. |
26ec8d0f3a9c
Bind mouse wheel movements by default,
Aidan Kehoe <kehoea@parhasard.net>
parents:
3547
diff
changeset
|
682 (dolist (keyspec '([(mouse-4)] [(shift mouse-4)] [(control mouse-4)] |
26ec8d0f3a9c
Bind mouse wheel movements by default,
Aidan Kehoe <kehoea@parhasard.net>
parents:
3547
diff
changeset
|
683 [(mouse-5)] [(shift mouse-5)] [(control mouse-5)])) |
26ec8d0f3a9c
Bind mouse wheel movements by default,
Aidan Kehoe <kehoea@parhasard.net>
parents:
3547
diff
changeset
|
684 (define-key global-map keyspec |
26ec8d0f3a9c
Bind mouse wheel movements by default,
Aidan Kehoe <kehoea@parhasard.net>
parents:
3547
diff
changeset
|
685 #'(lambda (event) |
26ec8d0f3a9c
Bind mouse wheel movements by default,
Aidan Kehoe <kehoea@parhasard.net>
parents:
3547
diff
changeset
|
686 (interactive "e") |
26ec8d0f3a9c
Bind mouse wheel movements by default,
Aidan Kehoe <kehoea@parhasard.net>
parents:
3547
diff
changeset
|
687 (mwheel-install) |
26ec8d0f3a9c
Bind mouse wheel movements by default,
Aidan Kehoe <kehoea@parhasard.net>
parents:
3547
diff
changeset
|
688 (declare-fboundp (mwheel-scroll event))))) |
428 | 689 ;;; keydefs.el ends here |