all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Julien Danjou <julien@danjou.info>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: [PATCH 1/2] Add frame-pointer-visible-p
Date: Mon, 18 Oct 2010 14:12:01 +0200	[thread overview]
Message-ID: <sa3wrpf66pa.fsf@cigue.easter-eggs.fr> (raw)
In-Reply-To: <E1P7nME-0001eI-B8@fencepost.gnu.org> (Eli Zaretskii's message of "Mon, 18 Oct 2010 06:54:22 -0400")

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

On Mon, Oct 18 2010, Eli Zaretskii wrote:

>> +@defun 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 non-@code{nil} 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
>> +@code{make-pointer-invisible} 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-frame-pointer-visible-p.patch --]
[-- Type: text/x-diff, Size: 2595 bytes --]

From 19fcdc3161fafefd44037c2ef6743e372a5b4692 Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Thu, 14 Oct 2010 15:53:27 +0200
Subject: [PATCH 1/2] Add frame-pointer-visible-p

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 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
 
+@defun frame-pointer-visible-p &optional frame
+This predicate function returns non-@code{nil} 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 @code{make-pointer-invisible} is set to @code{t}: it
+allows to know if the pointer has been hidden.
+@xref{Mouse Avoidance,,,emacs}.
+@end 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  <julien@danjou.info>
+
+	* frame.c (Fframe_pointer_visible_p): Add
+	`frame-pointer-visible-p' to get the pointer visibility.
+
 2010-10-15  Eli Zaretskii  <eliz@gnu.org>
 
 	* 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);
+}
 
 \f
 /***********************************************************************
@@ -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


[-- Attachment #3: Type: text/plain, Size: 79 bytes --]


-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

  reply	other threads:[~2010-10-18 12:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 14:52 Export pointer visibility Julien Danjou
2010-10-14 14:52 ` [PATCH 1/2] Add frame-pointer-visible-p Julien Danjou
2010-10-17 19:11   ` Stefan Monnier
2010-10-18  9:31     ` Julien Danjou
2010-10-18  9:53       ` Andreas Schwab
2010-10-18 10:05         ` Lennart Borgman
2010-10-18 10:31         ` Eli Zaretskii
2010-10-18 10:54       ` Eli Zaretskii
2010-10-18 12:12         ` Julien Danjou [this message]
2010-10-18 13:05           ` Eli Zaretskii
2010-10-18 21:08           ` Stefan Monnier
2010-10-14 14:52 ` [PATCH 2/2] avoid: ignore mouse when it is hidden Julien Danjou
2010-10-18 14:42   ` Stefan Monnier
2010-10-18 14:47     ` Julien Danjou
2010-10-18 21:10   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sa3wrpf66pa.fsf@cigue.easter-eggs.fr \
    --to=julien@danjou.info \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.