# HG changeset patch # User Stefan Monnier # Date 1188072669 0 # Node ID 652a69b792384c49b5cd8d91646d2e1451c805ad # Parent a25b7156354bbb7329a698a80a6f94810bea7185 (Finvisible_p): New function. (syms_of_xdisp): defsubr it. diff -r a25b7156354b -r 652a69b79238 src/ChangeLog --- a/src/ChangeLog Sat Aug 25 20:07:23 2007 +0000 +++ b/src/ChangeLog Sat Aug 25 20:11:09 2007 +0000 @@ -1,3 +1,8 @@ +2007-08-25 Stefan Monnier + + * xdisp.c (Finvisible_p): New function. + (syms_of_xdisp): defsubr it. + 2007-08-24 Juanma Barranquero * image.c (syms_of_image) : diff -r a25b7156354b -r 652a69b79238 src/xdisp.c --- a/src/xdisp.c Sat Aug 25 20:07:23 2007 +0000 +++ b/src/xdisp.c Sat Aug 25 20:11:09 2007 +0000 @@ -18435,6 +18435,27 @@ 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 @@ 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");