aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/frame.c24
2 files changed, 28 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 01a86c89df1..4a2c8d946b2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12000-02-21 Dave Love <fx@gnu.org>
2
3 * frame.c (Vmouse_position_function): New variable.
4 (Fmouse_position): Use it.
5 (syms_of_frame): Install it.
6
7 * charset.c (find_charset_in_str): Fix use of `c' instead of `c1'.
8
12000-02-20 Gerd Moellmann <gerd@gnu.org> 92000-02-20 Gerd Moellmann <gerd@gnu.org>
2 10
3 * fileio.c (Finsert_file_contents): Unbind the binding of 11 * fileio.c (Finsert_file_contents): Unbind the binding of
diff --git a/src/frame.c b/src/frame.c
index d356e6fcba0..7e74113af44 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,5 +1,5 @@
1/* Generic frame functions. 1/* Generic frame functions.
2 Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation. 2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -103,6 +103,7 @@ Lisp_Object Qtitle;
103 103
104Lisp_Object Vterminal_frame; 104Lisp_Object Vterminal_frame;
105Lisp_Object Vdefault_frame_alist; 105Lisp_Object Vdefault_frame_alist;
106Lisp_Object Vmouse_position_function;
106 107
107static void 108static void
108syms_of_frame_1 () 109syms_of_frame_1 ()
@@ -1375,13 +1376,15 @@ The position is given in character cells, where (0, 0) is the\n\
1375upper-left corner.\n\ 1376upper-left corner.\n\
1376If Emacs is running on a mouseless terminal or hasn't been programmed\n\ 1377If Emacs is running on a mouseless terminal or hasn't been programmed\n\
1377to read the mouse position, it returns the selected frame for FRAME\n\ 1378to read the mouse position, it returns the selected frame for FRAME\n\
1378and nil for X and Y.") 1379and nil for X and Y.\n\
1380Runs the abnormal hook `mouse-position-function' with the normal return\n\
1381value as argument.")
1379 () 1382 ()
1380{ 1383{
1381 FRAME_PTR f; 1384 FRAME_PTR f;
1382 Lisp_Object lispy_dummy; 1385 Lisp_Object lispy_dummy;
1383 enum scroll_bar_part party_dummy; 1386 enum scroll_bar_part party_dummy;
1384 Lisp_Object x, y; 1387 Lisp_Object x, y, retval;
1385 int col, row; 1388 int col, row;
1386 unsigned long long_dummy; 1389 unsigned long long_dummy;
1387 1390
@@ -1405,7 +1408,14 @@ and nil for X and Y.")
1405 } 1408 }
1406#endif 1409#endif
1407 XSETFRAME (lispy_dummy, f); 1410 XSETFRAME (lispy_dummy, f);
1408 return Fcons (lispy_dummy, Fcons (x, y)); 1411 retval = Fcons (lispy_dummy, Fcons (x, y));
1412 if (!NILP (Vmouse_position_function))
1413 {
1414 struct gcpro gcpro1, gcpro2;
1415 GCPRO2 (x, y);
1416 RETURN_UNGCPRO (call1 (Vmouse_position_function, retval));
1417 }
1418 return retval;
1409} 1419}
1410 1420
1411DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 1421DEFUN ("mouse-pixel-position", Fmouse_pixel_position,
@@ -2344,6 +2354,12 @@ syms_of_frame ()
2344 "Non-nil if all of emacs is iconified and frame updates are not needed."); 2354 "Non-nil if all of emacs is iconified and frame updates are not needed.");
2345 Vemacs_iconified = Qnil; 2355 Vemacs_iconified = Qnil;
2346 2356
2357 DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function,
2358 "If non-nil, function applied to the normal result of `mouse-position'.\n\
2359This abnormal hook exists for the benefit of packages like XTerm-mouse\n\
2360which need to do mouse handling at the Lisp level.");
2361 Vmouse_position_function = Qnil;
2362
2347 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, 2363 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
2348 "Minibufferless frames use this frame's minibuffer.\n\ 2364 "Minibufferless frames use this frame's minibuffer.\n\
2349\n\ 2365\n\