emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117281: * lisp/mouse.el (mouse-posn-property): Igno


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r117281: * lisp/mouse.el (mouse-posn-property): Ignore buffer position info when the
Date: Fri, 06 Jun 2014 02:35:24 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117281
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2014-06-05 22:35:17 -0400
message:
  * lisp/mouse.el (mouse-posn-property): Ignore buffer position info when the
  even happened elsewhere.
  * src/keyboard.c (make_lispy_position): Don't include a buffer position in
  mode/header-line mouse events.
modified:
  lisp/mouse.el                  mouse.el-20091113204419-o5vbwnq5f7feedwu-123
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
=== modified file 'lisp/mouse.el'
--- a/lisp/mouse.el     2014-06-02 00:18:22 +0000
+++ b/lisp/mouse.el     2014-06-06 02:35:17 +0000
@@ -684,10 +684,11 @@
            (str (posn-string pos)))
        (or (and str
                 (get-text-property (cdr str) property (car str)))
-            ;; FIXME: mouse clicks on the mode-line come with a position in
-            ;; (nth 5).  Maybe we should change the C code instead so that
-            ;; mouse-clicks don't include a position there!
-           (and pt (not (memq (posn-area pos) '(mode-line header-line)))
+            ;; Mouse clicks in the fringe come with a position in
+            ;; (nth 5).  This is useful but is not exactly where we clicked, so
+            ;; don't look up that position's properties!
+           (and pt (not (memq (posn-area pos) '(left-fringe right-fringe
+                                                 left-margin right-margin)))
                 (get-char-property pt property w))))
     (get-char-property pos property)))
 

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-06-06 02:22:40 +0000
+++ b/src/ChangeLog     2014-06-06 02:35:17 +0000
@@ -1,5 +1,8 @@
 2014-06-06  Stefan Monnier  <address@hidden>
 
+       * keyboard.c (make_lispy_position): Don't include a buffer position in
+       mode/header-line mouse events.
+
        * keyboard.c (read_char): Handle (t . <event>) in the second use of
        Vunread_command_events (bug#17650).
 

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2014-06-06 02:22:40 +0000
+++ b/src/keyboard.c    2014-06-06 02:35:17 +0000
@@ -2465,7 +2465,7 @@
         inside universal-argument.  */
 
       if (CONSP (c) && EQ (XCAR (c), Qt))
-         c = XCDR (c);
+       c = XCDR (c);
       else
        reread = true;
 
@@ -5228,7 +5228,7 @@
       /* It's a click in window WINDOW at frame coordinates (X,Y)  */
       struct window *w = XWINDOW (window);
       Lisp_Object string_info = Qnil;
-      ptrdiff_t textpos = -1;
+      ptrdiff_t textpos = 0;
       int col = -1, row = -1;
       int dx  = -1, dy  = -1;
       int width = -1, height = -1;
@@ -5263,9 +5263,7 @@
                                     &object, &dx, &dy, &width, &height);
          if (STRINGP (string))
            string_info = Fcons (string, make_number (charpos));
-         textpos = (w == XWINDOW (selected_window)
-                    && current_buffer == XBUFFER (w->contents))
-           ? PT : marker_position (w->pointm);
+         textpos = -1;
 
          xret = wx;
          yret = wy;
@@ -5333,7 +5331,7 @@
       /* For clicks in the text area, fringes, or margins, call
         buffer_posn_from_coords to extract TEXTPOS, the buffer
         position nearest to the click.  */
-      if (textpos < 0)
+      if (!textpos)
        {
          Lisp_Object string2, object2 = Qnil;
          struct display_pos p;
@@ -5384,15 +5382,15 @@
        }
 #endif
 
-      /* Object info */
+      /* Object info.  */
       extra_info
        = list3 (object,
                 Fcons (make_number (dx), make_number (dy)),
                 Fcons (make_number (width), make_number (height)));
 
-      /* String info */
+      /* String info.  */
       extra_info = Fcons (string_info,
-                         Fcons (make_number (textpos),
+                         Fcons (textpos < 0 ? Qnil : make_number (textpos),
                                 Fcons (Fcons (make_number (col),
                                               make_number (row)),
                                        extra_info)));


reply via email to

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