aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier2006-09-19 10:19:34 +0000
committerStefan Monnier2006-09-19 10:19:34 +0000
commit08e26e8bfa6ea900b9f213506ec1d053f7e629f4 (patch)
tree1220d4aa0428bfcb6ae062fa97a88d6819769930 /src/keymap.c
parent74686736823c62fd5f64078efff7a854781521ff (diff)
downloademacs-08e26e8bfa6ea900b9f213506ec1d053f7e629f4.tar.gz
emacs-08e26e8bfa6ea900b9f213506ec1d053f7e629f4.zip
Include alloca.h if available.
(Fkey_binding): Only use AREF after checking it's a vector. Remove unused var `window'.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 45bcba9a5fc..a6cccfabcbb 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -23,6 +23,9 @@ Boston, MA 02110-1301, USA. */
23 23
24#include <config.h> 24#include <config.h>
25#include <stdio.h> 25#include <stdio.h>
26#if HAVE_ALLOCA_H
27# include <alloca.h>
28#endif
26#include "lisp.h" 29#include "lisp.h"
27#include "commands.h" 30#include "commands.h"
28#include "buffer.h" 31#include "buffer.h"
@@ -1595,15 +1598,12 @@ specified buffer position instead of point are used.
1595 1598
1596 GCPRO2 (key, position); 1599 GCPRO2 (key, position);
1597 1600
1598 if (NILP (position)) 1601 if (NILP (position) && VECTORP (key))
1599 { 1602 {
1600 Lisp_Object event; 1603 Lisp_Object event
1601 /* mouse events may have a symbolic prefix indicating the 1604 /* mouse events may have a symbolic prefix indicating the
1602 scrollbar or mode line */ 1605 scrollbar or mode line */
1603 if (SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1) 1606 = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0);
1604 event = AREF (key, 1);
1605 else
1606 event = AREF (key, 0);
1607 1607
1608 /* We are not interested in locations without event data */ 1608 /* We are not interested in locations without event data */
1609 1609
@@ -1672,9 +1672,7 @@ specified buffer position instead of point are used.
1672 1672
1673 if (CONSP (position)) 1673 if (CONSP (position))
1674 { 1674 {
1675 Lisp_Object string, window; 1675 Lisp_Object string;
1676
1677 window = POSN_WINDOW (position);
1678 1676
1679 /* For a mouse click, get the local text-property keymap 1677 /* For a mouse click, get the local text-property keymap
1680 of the place clicked on, rather than point. */ 1678 of the place clicked on, rather than point. */