]> git.eshelyaron.com Git - emacs.git/commitdiff
Include alloca.h if available.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 19 Sep 2006 10:19:34 +0000 (10:19 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 19 Sep 2006 10:19:34 +0000 (10:19 +0000)
(Fkey_binding): Only use AREF after checking it's a vector.
Remove unused var `window'.

src/ChangeLog
src/keymap.c

index 17258fff1b84c75869b8f4df564a839d5f22fda0..cb76b7864991652bccff88a5bd6b28ebf60b6f3f 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * keymap.c: Include alloca.h if available.
+       (Fkey_binding): Only use AREF after checking it's a vector.
+       Remove unused var `window'.
+
 2006-09-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * emacs.c (shut_down_emacs) [!subprocesses]: Don't set
index 45bcba9a5fc99b1a9ef85d3e63b1a795f07e381b..a6cccfabcbb16e99e122ffb23ee54faf1c5abc6c 100644 (file)
@@ -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.  */