diff options
| author | Dave Love | 2000-02-21 13:50:14 +0000 |
|---|---|---|
| committer | Dave Love | 2000-02-21 13:50:14 +0000 |
| commit | beb0bc361fde072503ffaee5af4165dee10ce426 (patch) | |
| tree | 60887c67afde0b6ce61f4019303b945c6652529d | |
| parent | f0a6c717e27cda12ba60d5afcd01a09d2e8cba67 (diff) | |
| download | emacs-beb0bc361fde072503ffaee5af4165dee10ce426.tar.gz emacs-beb0bc361fde072503ffaee5af4165dee10ce426.zip | |
(Vmouse_position_function): New variable.
(Fmouse_position): Use it.
(syms_of_frame): Install it.
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/frame.c | 24 |
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 @@ | |||
| 1 | 2000-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 | |||
| 1 | 2000-02-20 Gerd Moellmann <gerd@gnu.org> | 9 | 2000-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 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -103,6 +103,7 @@ Lisp_Object Qtitle; | |||
| 103 | 103 | ||
| 104 | Lisp_Object Vterminal_frame; | 104 | Lisp_Object Vterminal_frame; |
| 105 | Lisp_Object Vdefault_frame_alist; | 105 | Lisp_Object Vdefault_frame_alist; |
| 106 | Lisp_Object Vmouse_position_function; | ||
| 106 | 107 | ||
| 107 | static void | 108 | static void |
| 108 | syms_of_frame_1 () | 109 | syms_of_frame_1 () |
| @@ -1375,13 +1376,15 @@ The position is given in character cells, where (0, 0) is the\n\ | |||
| 1375 | upper-left corner.\n\ | 1376 | upper-left corner.\n\ |
| 1376 | If Emacs is running on a mouseless terminal or hasn't been programmed\n\ | 1377 | If Emacs is running on a mouseless terminal or hasn't been programmed\n\ |
| 1377 | to read the mouse position, it returns the selected frame for FRAME\n\ | 1378 | to read the mouse position, it returns the selected frame for FRAME\n\ |
| 1378 | and nil for X and Y.") | 1379 | and nil for X and Y.\n\ |
| 1380 | Runs the abnormal hook `mouse-position-function' with the normal return\n\ | ||
| 1381 | value 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 | ||
| 1411 | DEFUN ("mouse-pixel-position", Fmouse_pixel_position, | 1421 | DEFUN ("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\ | ||
| 2359 | This abnormal hook exists for the benefit of packages like XTerm-mouse\n\ | ||
| 2360 | which 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\ |