emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/keyboard.c


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/src/keyboard.c
Date: Thu, 27 Nov 2003 16:16:27 -0500

Index: emacs/src/keyboard.c
diff -c emacs/src/keyboard.c:1.756 emacs/src/keyboard.c:1.757
*** emacs/src/keyboard.c:1.756  Sat Nov 22 19:09:39 2003
--- emacs/src/keyboard.c        Thu Nov 27 16:16:26 2003
***************
*** 587,592 ****
--- 587,593 ----
  Lisp_Object Qmenu_bar;
  extern Lisp_Object Qleft_margin, Qright_margin;
  extern Lisp_Object Qleft_fringe, Qright_fringe;
+ extern Lisp_Object Qimage;
  
  Lisp_Object recursive_edit_unwind (), command_loop ();
  Lisp_Object Fthis_command_keys ();
***************
*** 4983,4988 ****
--- 4984,4990 ----
        struct window *w = XWINDOW (window);
        Lisp_Object object = Qnil;
        int textpos = -1, rx = -1, ry = -1;
+       int dx = -1, dy = -1;
  
        /* Set event coordinates to window-relative coordinates
         for constructing the Lisp event below.  */
***************
*** 4998,5004 ****
  
          posn = part == ON_MODE_LINE ? Qmode_line : Qheader_line;
          rx = wx, ry = wy;
!         string = mode_line_string (w, &rx, &ry, part, &charpos);
          if (STRINGP (string))
            object = Fcons (string, make_number (charpos));
          if (w == XWINDOW (selected_window))
--- 5000,5006 ----
  
          posn = part == ON_MODE_LINE ? Qmode_line : Qheader_line;
          rx = wx, ry = wy;
!         string = mode_line_string (w, &rx, &ry, &dx, &dy, part, &charpos);
          if (STRINGP (string))
            object = Fcons (string, make_number (charpos));
          if (w == XWINDOW (selected_window))
***************
*** 5010,5015 ****
--- 5012,5018 ----
        {
          posn = Qvertical_line;
          wx = -1;
+         dx = 0;
        }
        else if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN)
        {
***************
*** 5018,5024 ****
          
          posn = (part == ON_LEFT_MARGIN) ? Qleft_margin : Qright_margin;
          rx = wx, ry = wy;
!         string = marginal_area_string (w, &rx, &ry, part, &charpos);
          if (STRINGP (string))
            object = Fcons (string, make_number (charpos));
        }
--- 5021,5027 ----
          
          posn = (part == ON_LEFT_MARGIN) ? Qleft_margin : Qright_margin;
          rx = wx, ry = wy;
!         string = marginal_area_string (w, &rx, &ry, &dx, &dy, part, &charpos);
          if (STRINGP (string))
            object = Fcons (string, make_number (charpos));
        }
***************
*** 5026,5044 ****
        {
          posn = (part == ON_LEFT_FRINGE) ? Qleft_fringe : Qright_fringe;
          rx = 0;
        }
  
        if (textpos < 0)
        {
          Lisp_Object string;
          struct display_pos p;
          wx = max (WINDOW_LEFT_MARGIN_WIDTH (w), wx);
!         buffer_posn_from_coords (w, &wx, &wy, &string, &p);
          textpos = CHARPOS (p.pos);
!         if (rx < 0)
!           rx = wx;
!         if (ry < 0)
!           ry = wy;
  
          if (NILP (posn))
            {
--- 5029,5057 ----
        {
          posn = (part == ON_LEFT_FRINGE) ? Qleft_fringe : Qright_fringe;
          rx = 0;
+         dx = wx;
+         if (part == ON_RIGHT_FRINGE)
+           dx -= (window_box_width (w, LEFT_MARGIN_AREA)
+                  + window_box_width (w, TEXT_AREA)
+                  + (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
+                     ? window_box_width (w, RIGHT_MARGIN_AREA)
+                     : 0));
+         else if (!WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w))
+           dx -= window_box_width (w, LEFT_MARGIN_AREA);
        }
  
        if (textpos < 0)
        {
          Lisp_Object string;
          struct display_pos p;
+         int dx2, dy2;
          wx = max (WINDOW_LEFT_MARGIN_WIDTH (w), wx);
!         buffer_posn_from_coords (w, &wx, &wy, &dx2, &dy2, &string, &p);
          textpos = CHARPOS (p.pos);
!         if (rx < 0) rx = wx;
!         if (ry < 0) ry = wy;
!         if (dx < 0) dx = dx2;
!         if (dy < 0) dy = dy2;
  
          if (NILP (posn))
            {
***************
*** 5046,5051 ****
--- 5059,5066 ----
              if (STRINGP (string))
                object = Fcons (string,
                                make_number (CHARPOS (p.string_pos)));
+             else if (CONSP (string) && EQ (XCAR (string), Qimage))
+               object = string;
            }
        }
  
***************
*** 5053,5059 ****
                          Fcons (make_number (textpos),
                                 Fcons (Fcons (make_number (rx),
                                               make_number (ry)),
!                                       Qnil)));
      }
    else if (f != 0)
      {
--- 5068,5076 ----
                          Fcons (make_number (textpos),
                                 Fcons (Fcons (make_number (rx),
                                               make_number (ry)),
!                                       Fcons (Fcons (make_number (dx),
!                                                     make_number (dy)),
!                                              Qnil))));
      }
    else if (f != 0)
      {
***************
*** 8813,8818 ****
--- 8830,8836 ----
        if (EVENT_HAS_PARAMETERS (key))
        {
          Lisp_Object kind;
+         Lisp_Object string;
  
          kind = EVENT_HEAD_KIND (EVENT_HEAD (key));
          if (EQ (kind, Qmouse_click))
***************
*** 8929,8939 ****
  
                  /* If on a mode line string with a local keymap,
                     reconsider the key sequence with that keymap.  */
!                 if (CONSP (POSN_STRING (EVENT_START (key))))
                    {
!                     Lisp_Object string, pos, map, map2;
  
-                     string = POSN_STRING (EVENT_START (key));
                      pos = XCDR (string);
                      string = XCAR (string);
                        if (XINT (pos) >= 0
--- 8947,8957 ----
  
                  /* If on a mode line string with a local keymap,
                     reconsider the key sequence with that keymap.  */
!                 if (string = POSN_STRING (EVENT_START (key)),
!                     (CONSP (string) && STRINGP (XCAR (string))))
                    {
!                     Lisp_Object pos, map, map2;
  
                      pos = XCDR (string);
                      string = XCAR (string);
                        if (XINT (pos) >= 0
***************
*** 8952,8967 ****
  
                  goto replay_key;
                }
!             else if (CONSP (POSN_STRING (EVENT_START (key)))
!                      && NILP (from_string))
                {
                  /* For a click on a string, i.e. overlay string or a
                     string displayed via the `display' property,
                     consider `local-map' and `keymap' properties of
                     that string.  */
!                 Lisp_Object string, pos, map, map2;
  
-                 string = POSN_STRING (EVENT_START (key));
                  pos = XCDR (string);
                  string = XCAR (string);
                  if (XINT (pos) >= 0
--- 8970,8985 ----
  
                  goto replay_key;
                }
!             else if (NILP (from_string)
!                      && (string = POSN_STRING (EVENT_START (key)),
!                          (CONSP (string) && STRINGP (XCAR (string)))))
                {
                  /* For a click on a string, i.e. overlay string or a
                     string displayed via the `display' property,
                     consider `local-map' and `keymap' properties of
                     that string.  */
!                 Lisp_Object pos, map, map2;
  
                  pos = XCDR (string);
                  string = XCAR (string);
                  if (XINT (pos) >= 0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]