From e60c4e15efd282dfd4cf94af1eff96f540fe586a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 25 Aug 2007 20:11:09 +0000 Subject: (Finvisible_p): New function. (syms_of_xdisp): defsubr it. --- src/xdisp.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/xdisp.c') diff --git a/src/xdisp.c b/src/xdisp.c index b1a837b799..da33b05c4c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18435,6 +18435,27 @@ invisible_p (propval, list) return 0; } +DEFUN ("invisible-p", Finvisible_p, Sinvisible_p, 1, 1, 0, + doc: /* Non-nil if the property makes the text invisible. +POS-OR-PROP can be a marker or number, in which case it is taken to be +a position in the current buffer and the value of the `invisible' property +is checked; or it can be some other value, which is then presumed to be the +value of the `invisible' property of the text of interest. +The non-nil value returned can be t for truly invisible text or something +else if the text is replaced by an ellipsis. */) + (pos_or_prop) + Lisp_Object pos_or_prop; +{ + Lisp_Object prop = + (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop)) + ? Fget_char_property (pos_or_prop, Qinvisible, Qnil) + : pos_or_prop; + int invis = TEXT_PROP_MEANS_INVISIBLE (prop); + return (invis == 0 ? Qnil + : invis == 1 ? Qt + : make_number (invis)); +} + /* Calculate a width or height in pixels from a specification using the following elements: @@ -23806,6 +23827,7 @@ syms_of_xdisp () defsubr (&Slookup_image_map); #endif defsubr (&Sformat_mode_line); + defsubr (&Sinvisible_p); staticpro (&Qmenu_bar_update_hook); Qmenu_bar_update_hook = intern ("menu-bar-update-hook"); -- cgit v1.2.3 From 7f59302aef3e384cfca55b03490a1542060e821c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 25 Aug 2007 23:50:16 +0000 Subject: Syntactic cleanup. --- src/xdisp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/xdisp.c') diff --git a/src/xdisp.c b/src/xdisp.c index da33b05c4c..d22c9a53bc 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -18446,10 +18446,10 @@ else if the text is replaced by an ellipsis. */) (pos_or_prop) Lisp_Object pos_or_prop; { - Lisp_Object prop = - (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop)) - ? Fget_char_property (pos_or_prop, Qinvisible, Qnil) - : pos_or_prop; + Lisp_Object prop + = (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop) + ? Fget_char_property (pos_or_prop, Qinvisible, Qnil) + : pos_or_prop); int invis = TEXT_PROP_MEANS_INVISIBLE (prop); return (invis == 0 ? Qnil : invis == 1 ? Qt -- cgit v1.2.3