aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2014-06-05 22:35:17 -0400
committerStefan Monnier2014-06-05 22:35:17 -0400
commit631de55bc19931ca2d778e8399697921228902a8 (patch)
tree70d957dfc083c83272435459c80fb364094772f3 /src
parent79b0d21638cce19216607a89b6470b1e72a028b8 (diff)
downloademacs-631de55bc19931ca2d778e8399697921228902a8.tar.gz
emacs-631de55bc19931ca2d778e8399697921228902a8.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/keyboard.c16
2 files changed, 10 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a56a0a27d92..06847a72de3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12014-06-06 Stefan Monnier <monnier@iro.umontreal.ca> 12014-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * keyboard.c (make_lispy_position): Don't include a buffer position in
4 mode/header-line mouse events.
5
3 * keyboard.c (read_char): Handle (t . <event>) in the second use of 6 * keyboard.c (read_char): Handle (t . <event>) in the second use of
4 Vunread_command_events (bug#17650). 7 Vunread_command_events (bug#17650).
5 8
diff --git a/src/keyboard.c b/src/keyboard.c
index c9cd222b110..568c8203c7f 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2465,7 +2465,7 @@ read_char (int commandflag, Lisp_Object map,
2465 inside universal-argument. */ 2465 inside universal-argument. */
2466 2466
2467 if (CONSP (c) && EQ (XCAR (c), Qt)) 2467 if (CONSP (c) && EQ (XCAR (c), Qt))
2468 c = XCDR (c); 2468 c = XCDR (c);
2469 else 2469 else
2470 reread = true; 2470 reread = true;
2471 2471
@@ -5228,7 +5228,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5228 /* It's a click in window WINDOW at frame coordinates (X,Y) */ 5228 /* It's a click in window WINDOW at frame coordinates (X,Y) */
5229 struct window *w = XWINDOW (window); 5229 struct window *w = XWINDOW (window);
5230 Lisp_Object string_info = Qnil; 5230 Lisp_Object string_info = Qnil;
5231 ptrdiff_t textpos = -1; 5231 ptrdiff_t textpos = 0;
5232 int col = -1, row = -1; 5232 int col = -1, row = -1;
5233 int dx = -1, dy = -1; 5233 int dx = -1, dy = -1;
5234 int width = -1, height = -1; 5234 int width = -1, height = -1;
@@ -5263,9 +5263,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5263 &object, &dx, &dy, &width, &height); 5263 &object, &dx, &dy, &width, &height);
5264 if (STRINGP (string)) 5264 if (STRINGP (string))
5265 string_info = Fcons (string, make_number (charpos)); 5265 string_info = Fcons (string, make_number (charpos));
5266 textpos = (w == XWINDOW (selected_window) 5266 textpos = -1;
5267 && current_buffer == XBUFFER (w->contents))
5268 ? PT : marker_position (w->pointm);
5269 5267
5270 xret = wx; 5268 xret = wx;
5271 yret = wy; 5269 yret = wy;
@@ -5333,7 +5331,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5333 /* For clicks in the text area, fringes, or margins, call 5331 /* For clicks in the text area, fringes, or margins, call
5334 buffer_posn_from_coords to extract TEXTPOS, the buffer 5332 buffer_posn_from_coords to extract TEXTPOS, the buffer
5335 position nearest to the click. */ 5333 position nearest to the click. */
5336 if (textpos < 0) 5334 if (!textpos)
5337 { 5335 {
5338 Lisp_Object string2, object2 = Qnil; 5336 Lisp_Object string2, object2 = Qnil;
5339 struct display_pos p; 5337 struct display_pos p;
@@ -5384,15 +5382,15 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y,
5384 } 5382 }
5385#endif 5383#endif
5386 5384
5387 /* Object info */ 5385 /* Object info. */
5388 extra_info 5386 extra_info
5389 = list3 (object, 5387 = list3 (object,
5390 Fcons (make_number (dx), make_number (dy)), 5388 Fcons (make_number (dx), make_number (dy)),
5391 Fcons (make_number (width), make_number (height))); 5389 Fcons (make_number (width), make_number (height)));
5392 5390
5393 /* String info */ 5391 /* String info. */
5394 extra_info = Fcons (string_info, 5392 extra_info = Fcons (string_info,
5395 Fcons (make_number (textpos), 5393 Fcons (textpos < 0 ? Qnil : make_number (textpos),
5396 Fcons (Fcons (make_number (col), 5394 Fcons (Fcons (make_number (col),
5397 make_number (row)), 5395 make_number (row)),
5398 extra_info))); 5396 extra_info)));