[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] Add frame-pointer-visible-p
From: |
Julien Danjou |
Subject: |
Re: [PATCH 1/2] Add frame-pointer-visible-p |
Date: |
Mon, 18 Oct 2010 14:12:01 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
On Mon, Oct 18 2010, Eli Zaretskii wrote:
>> address@hidden frame-pointer-visible-p &opt frame
> ^^^^
> "&optional"
Fixed.
>> +This function return the current visibility status of the mouse
> ^^^^^^
> "returns". But it is better to rephrase along the lines suggested by
> Andreas:
>
> This predicate function returns address@hidden if the mouse pointer
> displayed on @var{frame} is visible; otherwise it returns
> @code{nil}. @var{frame} omitted or @code{nil} means the selected
> frame. This is useful when ...
Updated.
>> +pointer in @var{frame}. This is useful when
>> address@hidden is set to @code{t}: it allows to know if
>
> It is a good idea to have here a cross-reference to where
> make-pointer-invisible is described (in the Emacs User Manual).
Ah, now you want me to learn Texinfo. ;) I've added a @xref, hoping
that's what you meant.
> Your entry should be at the top of the file.
Fixed.
Thanks for the review Eli.
>From 19fcdc3161fafefd44037c2ef6743e372a5b4692 Mon Sep 17 00:00:00 2001
From: Julien Danjou <address@hidden>
Date: Thu, 14 Oct 2010 15:53:27 +0200
Subject: [PATCH 1/2] Add frame-pointer-visible-p
Signed-off-by: Julien Danjou <address@hidden>
---
doc/lispref/frames.texi | 9 +++++++++
src/ChangeLog | 5 +++++
src/frame.c | 16 ++++++++++++++++
3 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index d27010d..709a495 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1748,6 +1748,15 @@ If @var{frame} is not visible, this function does
nothing. The return
value is not significant.
@end defun
address@hidden frame-pointer-visible-p &optional frame
+This predicate function returns address@hidden if the mouse pointer
+displayed on @var{frame} is visible; otherwise it returns @code{nil}.
address@hidden omitted or @code{nil} means the selected frame. This is
+useful when @code{make-pointer-invisible} is set to @code{t}: it
+allows to know if the pointer has been hidden.
address@hidden Avoidance,,,emacs}.
address@hidden defun
+
@need 3000
@node Pop-Up Menus
diff --git a/src/ChangeLog b/src/ChangeLog
index da344a4..f57bc43 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-18 Julien Danjou <address@hidden>
+
+ * frame.c (Fframe_pointer_visible_p): Add
+ `frame-pointer-visible-p' to get the pointer visibility.
+
2010-10-15 Eli Zaretskii <address@hidden>
* unexcoff.c (make_hdr): Fix prototype according to changes in
diff --git a/src/frame.c b/src/frame.c
index 04cc1ca..8a52883 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4314,6 +4314,21 @@ frame_make_pointer_visible (void)
}
}
+DEFUN ("frame-pointer-visible-p", Fframe_pointer_visible_p,
+ Sframe_pointer_visible_p, 0, 1, 0,
+ doc: /* Returns t if the mouse pointer displayed on FRAME is visible.
+Otherwise it returns nil. FRAME omitted or nil means the
+selected frame. This is useful when `make-pointer-invisible' is
+set. */)
+ (Lisp_Object frame)
+{
+ if (NILP (frame))
+ frame = selected_frame;
+
+ CHECK_FRAME (frame);
+
+ return (XFRAME (frame)->pointer_invisible ? Qnil : Qt);
+}
/***********************************************************************
@@ -4623,6 +4638,7 @@ automatically. See also `mouse-autoselect-window'. */);
defsubr (&Sset_frame_width);
defsubr (&Sset_frame_size);
defsubr (&Sset_frame_position);
+ defsubr (&Sframe_pointer_visible_p);
#ifdef HAVE_WINDOW_SYSTEM
defsubr (&Sx_get_resource);
--
1.7.1
--
Julien Danjou
// ᐰ <address@hidden> http://julien.danjou.info
- Re: [PATCH 2/2] avoid: ignore mouse when it is hidden, (continued)