aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorMiles Bader2007-12-16 05:08:49 +0000
committerMiles Bader2007-12-16 05:08:49 +0000
commitd29ee6b1a110cf5d170a10317a96acbbd4a1c68b (patch)
tree58f3c40766d8d56de7d2b026c29e198764d910aa /src/keyboard.c
parent7e095e45a3f790e4608c88db9648d248e24901dc (diff)
parent47854a55680b5809811caf72f66ecbe8289c2855 (diff)
downloademacs-d29ee6b1a110cf5d170a10317a96acbbd4a1c68b.tar.gz
emacs-d29ee6b1a110cf5d170a10317a96acbbd4a1c68b.zip
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-300
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c89
1 files changed, 25 insertions, 64 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 6595b7f800d..2230b339f5e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -108,21 +108,6 @@ int interrupt_input_pending;
108#define KBD_BUFFER_SIZE 4096 108#define KBD_BUFFER_SIZE 4096
109#endif /* No X-windows */ 109#endif /* No X-windows */
110 110
111/* Following definition copied from eval.c */
112
113struct backtrace
114 {
115 struct backtrace *next;
116 Lisp_Object *function;
117 Lisp_Object *args; /* Points to vector of args. */
118 int nargs; /* length of vector. If nargs is UNEVALLED,
119 args points to slot holding list of
120 unevalled args */
121 char evalargs;
122 /* Nonzero means call value of debugger when done with this operation. */
123 char debug_on_exit;
124 };
125
126#ifdef MULTI_KBOARD 111#ifdef MULTI_KBOARD
127KBOARD *initial_kboard; 112KBOARD *initial_kboard;
128KBOARD *current_kboard; 113KBOARD *current_kboard;
@@ -175,8 +160,6 @@ extern int minbuf_level;
175 160
176extern int message_enable_multibyte; 161extern int message_enable_multibyte;
177 162
178extern struct backtrace *backtrace_list;
179
180/* If non-nil, the function that implements the display of help. 163/* If non-nil, the function that implements the display of help.
181 It's called with one argument, the help string to display. */ 164 It's called with one argument, the help string to display. */
182 165
@@ -1565,7 +1548,6 @@ command_loop_1 ()
1565 int nonundocount; 1548 int nonundocount;
1566 Lisp_Object keybuf[30]; 1549 Lisp_Object keybuf[30];
1567 int i; 1550 int i;
1568 int no_direct;
1569 int prev_modiff = 0; 1551 int prev_modiff = 0;
1570 struct buffer *prev_buffer = NULL; 1552 struct buffer *prev_buffer = NULL;
1571#if 0 /* This shouldn't be necessary anymore. --lorentey */ 1553#if 0 /* This shouldn't be necessary anymore. --lorentey */
@@ -1625,8 +1607,6 @@ command_loop_1 ()
1625 while (pending_malloc_warning) 1607 while (pending_malloc_warning)
1626 display_malloc_warning (); 1608 display_malloc_warning ();
1627 1609
1628 no_direct = 0;
1629
1630 Vdeactivate_mark = Qnil; 1610 Vdeactivate_mark = Qnil;
1631 1611
1632 /* If minibuffer on and echo area in use, 1612 /* If minibuffer on and echo area in use,
@@ -1787,7 +1767,7 @@ command_loop_1 ()
1787 } 1767 }
1788 else 1768 else
1789 { 1769 {
1790 if (NILP (current_kboard->Vprefix_arg) && ! no_direct) 1770 if (NILP (current_kboard->Vprefix_arg))
1791 { 1771 {
1792 /* In case we jump to directly_done. */ 1772 /* In case we jump to directly_done. */
1793 Vcurrent_prefix_arg = current_kboard->Vprefix_arg; 1773 Vcurrent_prefix_arg = current_kboard->Vprefix_arg;
@@ -5558,41 +5538,32 @@ make_lispy_event (event)
5558 { 5538 {
5559 /* A simple keystroke. */ 5539 /* A simple keystroke. */
5560 case ASCII_KEYSTROKE_EVENT: 5540 case ASCII_KEYSTROKE_EVENT:
5561 {
5562 Lisp_Object lispy_c;
5563 int c = event->code & 0377;
5564 /* Turn ASCII characters into control characters
5565 when proper. */
5566 if (event->modifiers & ctrl_modifier)
5567 c = make_ctrl_char (c);
5568
5569 /* Add in the other modifier bits. We took care of ctrl_modifier
5570 just above, and the shift key was taken care of by the X code,
5571 and applied to control characters by make_ctrl_char. */
5572 c |= (event->modifiers
5573 & (meta_modifier | alt_modifier
5574 | hyper_modifier | super_modifier));
5575 /* Distinguish Shift-SPC from SPC. */
5576 if ((event->code & 0377) == 040
5577 && event->modifiers & shift_modifier)
5578 c |= shift_modifier;
5579 button_down_time = 0;
5580 XSETFASTINT (lispy_c, c);
5581 return lispy_c;
5582 }
5583
5584 case MULTIBYTE_CHAR_KEYSTROKE_EVENT: 5541 case MULTIBYTE_CHAR_KEYSTROKE_EVENT:
5585 { 5542 {
5586 Lisp_Object lispy_c; 5543 Lisp_Object lispy_c;
5587 int c = event->code; 5544 int c = event->code;
5545 if (event->kind == ASCII_KEYSTROKE_EVENT)
5546 {
5547 c &= 0377;
5548 eassert (c == event->code);
5549 /* Turn ASCII characters into control characters
5550 when proper. */
5551 if (event->modifiers & ctrl_modifier)
5552 {
5553 c = make_ctrl_char (c);
5554 event->modifiers &= ~ctrl_modifier;
5555 }
5556 }
5588 5557
5589 /* Add in the other modifier bits. We took care of ctrl_modifier 5558 /* Add in the other modifier bits. The shift key was taken care
5590 just above, and the shift key was taken care of by the X code, 5559 of by the X code. */
5591 and applied to control characters by make_ctrl_char. */
5592 c |= (event->modifiers 5560 c |= (event->modifiers
5593 & (meta_modifier | alt_modifier 5561 & (meta_modifier | alt_modifier
5594 | hyper_modifier | super_modifier | ctrl_modifier)); 5562 | hyper_modifier | super_modifier | ctrl_modifier));
5595 /* What about the `shift' modifier ? */ 5563 /* Distinguish Shift-SPC from SPC. */
5564 if ((event->code) == 040
5565 && event->modifiers & shift_modifier)
5566 c |= shift_modifier;
5596 button_down_time = 0; 5567 button_down_time = 0;
5597 XSETFASTINT (lispy_c, c); 5568 XSETFASTINT (lispy_c, c);
5598 return lispy_c; 5569 return lispy_c;
@@ -9619,7 +9590,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9619 } 9590 }
9620 9591
9621 GROW_RAW_KEYBUF; 9592 GROW_RAW_KEYBUF;
9622 XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key; 9593 ASET (raw_keybuf, raw_keybuf_count++, key);
9623 } 9594 }
9624 9595
9625 /* Clicks in non-text areas get prefixed by the symbol 9596 /* Clicks in non-text areas get prefixed by the symbol
@@ -10401,7 +10372,6 @@ a special event, so ignore the prefix argument and don't clear it. */)
10401 register Lisp_Object final; 10372 register Lisp_Object final;
10402 register Lisp_Object tem; 10373 register Lisp_Object tem;
10403 Lisp_Object prefixarg; 10374 Lisp_Object prefixarg;
10404 struct backtrace backtrace;
10405 extern int debug_on_next_call; 10375 extern int debug_on_next_call;
10406 10376
10407 debug_on_next_call = 0; 10377 debug_on_next_call = 0;
@@ -10467,20 +10437,11 @@ a special event, so ignore the prefix argument and don't clear it. */)
10467 } 10437 }
10468 10438
10469 if (CONSP (final) || SUBRP (final) || COMPILEDP (final)) 10439 if (CONSP (final) || SUBRP (final) || COMPILEDP (final))
10470 { 10440 /* Don't call Fcall_interactively directly because we want to make
10471 backtrace.next = backtrace_list; 10441 sure the backtrace has an entry for `call-interactively'.
10472 backtrace_list = &backtrace; 10442 For the same reason, pass `cmd' rather than `final'. */
10473 backtrace.function = &Qcall_interactively; 10443 return call3 (Qcall_interactively, cmd, record_flag, keys);
10474 backtrace.args = &cmd;
10475 backtrace.nargs = 1;
10476 backtrace.evalargs = 0;
10477 backtrace.debug_on_exit = 0;
10478
10479 tem = Fcall_interactively (cmd, record_flag, keys);
10480 10444
10481 backtrace_list = backtrace.next;
10482 return tem;
10483 }
10484 return Qnil; 10445 return Qnil;
10485} 10446}
10486 10447
@@ -10591,7 +10552,7 @@ give to the command you invoke, if it asks for an argument. */)
10591 bindings = Qnil; 10552 bindings = Qnil;
10592 10553
10593 value = Qnil; 10554 value = Qnil;
10594 GCPRO2 (bindings, value); 10555 GCPRO3 (bindings, value, function);
10595 value = Fcommand_execute (function, Qt, Qnil, Qnil); 10556 value = Fcommand_execute (function, Qt, Qnil, Qnil);
10596 10557
10597 /* If the command has a key binding, print it now. */ 10558 /* If the command has a key binding, print it now. */