From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 1/2] Add frame-pointer-visible-p Date: Mon, 18 Oct 2010 14:12:01 +0200 Message-ID: References: <1287067949-23750-1-git-send-email-julien@danjou.info> <1287067949-23750-2-git-send-email-julien@danjou.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1287403941 21075 80.91.229.12 (18 Oct 2010 12:12:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Oct 2010 12:12:21 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 18 14:12:19 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P7oZe-0008WJ-Up for ged-emacs-devel@m.gmane.org; Mon, 18 Oct 2010 14:12:19 +0200 Original-Received: from localhost ([127.0.0.1]:51432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7oZe-0007aE-7Q for ged-emacs-devel@m.gmane.org; Mon, 18 Oct 2010 08:12:18 -0400 Original-Received: from [140.186.70.92] (port=49282 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7oZU-0007Z9-RW for emacs-devel@gnu.org; Mon, 18 Oct 2010 08:12:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7oZT-0003Ne-Nn for emacs-devel@gnu.org; Mon, 18 Oct 2010 08:12:08 -0400 Original-Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]:53115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P7oZR-0003NJ-3A; Mon, 18 Oct 2010 08:12:06 -0400 Original-Received: from cigue.easter-eggs.fr (cigue.easter-eggs.fr [10.0.0.33]) by rose.easter-eggs.fr (Postfix) with ESMTPS id DD92714290; Mon, 18 Oct 2010 14:11:58 +0200 (CEST) Original-Received: from jdanjou by cigue.easter-eggs.fr with local (Exim 4.72) (envelope-from ) id 1P7oZN-0005eG-Bq; Mon, 18 Oct 2010 14:12:01 +0200 Mail-Followup-To: Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org In-Reply-To: (Eli Zaretskii's message of "Mon, 18 Oct 2010 06:54:22 -0400") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131802 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-frame-pointer-visible-p.patch >From 19fcdc3161fafefd44037c2ef6743e372a5b4692 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 14 Oct 2010 15:53:27 +0200 Subject: [PATCH 1/2] Add frame-pointer-visible-p Signed-off-by: Julien Danjou --- 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 + + * frame.c (Fframe_pointer_visible_p): Add + `frame-pointer-visible-p' to get the pointer visibility. + 2010-10-15 Eli Zaretskii * 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info --=-=-=--