summaryrefslogtreecommitdiff
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2006-09-19 10:19:34 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2006-09-19 10:19:34 +0000
commit08e26e8bfa6ea900b9f213506ec1d053f7e629f4 (patch)
tree1220d4aa0428bfcb6ae062fa97a88d6819769930 /src/keymap.c
parent74686736823c62fd5f64078efff7a854781521ff (diff)
downloademacs-08e26e8bfa6ea900b9f213506ec1d053f7e629f4.tar.gz
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. */
#include <config.h>
#include <stdio.h>
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
@@ -1595,15 +1598,12 @@ specified buffer position instead of point are used.
GCPRO2 (key, position);
- if (NILP (position))
+ if (NILP (position) && VECTORP (key))
{
- Lisp_Object event;
- /* mouse events may have a symbolic prefix indicating the
- scrollbar or mode line */
- if (SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1)
- event = AREF (key, 1);
- else
- event = AREF (key, 0);
+ Lisp_Object event
+ /* mouse events may have a symbolic prefix indicating the
+ scrollbar or mode line */
+ = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0);
/* We are not interested in locations without event data */
@@ -1672,9 +1672,7 @@ specified buffer position instead of point are used.
if (CONSP (position))
{
- Lisp_Object string, window;
-
- window = POSN_WINDOW (position);
+ Lisp_Object string;
/* For a mouse click, get the local text-property keymap
of the place clicked on, rather than point. */