aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorStefan Monnier2007-08-25 20:11:09 +0000
committerStefan Monnier2007-08-25 20:11:09 +0000
commite60c4e15efd282dfd4cf94af1eff96f540fe586a (patch)
treec1e07e482c5204b92c8ce135b2f2d029180a4df9 /src/xdisp.c
parent3a44b2ae7a16ee3cb5b5f706d6e80c53c801a7f2 (diff)
downloademacs-e60c4e15efd282dfd4cf94af1eff96f540fe586a.tar.gz
emacs-e60c4e15efd282dfd4cf94af1eff96f540fe586a.zip
(Finvisible_p): New function.
(syms_of_xdisp): defsubr it.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index b1a837b799a..da33b05c4c5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18435,6 +18435,27 @@ invisible_p (propval, list)
18435 return 0; 18435 return 0;
18436} 18436}
18437 18437
18438DEFUN ("invisible-p", Finvisible_p, Sinvisible_p, 1, 1, 0,
18439 doc: /* Non-nil if the property makes the text invisible.
18440POS-OR-PROP can be a marker or number, in which case it is taken to be
18441a position in the current buffer and the value of the `invisible' property
18442is checked; or it can be some other value, which is then presumed to be the
18443value of the `invisible' property of the text of interest.
18444The non-nil value returned can be t for truly invisible text or something
18445else if the text is replaced by an ellipsis. */)
18446 (pos_or_prop)
18447 Lisp_Object pos_or_prop;
18448{
18449 Lisp_Object prop =
18450 (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop))
18451 ? Fget_char_property (pos_or_prop, Qinvisible, Qnil)
18452 : pos_or_prop;
18453 int invis = TEXT_PROP_MEANS_INVISIBLE (prop);
18454 return (invis == 0 ? Qnil
18455 : invis == 1 ? Qt
18456 : make_number (invis));
18457}
18458
18438/* Calculate a width or height in pixels from a specification using 18459/* Calculate a width or height in pixels from a specification using
18439 the following elements: 18460 the following elements:
18440 18461
@@ -23806,6 +23827,7 @@ syms_of_xdisp ()
23806 defsubr (&Slookup_image_map); 23827 defsubr (&Slookup_image_map);
23807#endif 23828#endif
23808 defsubr (&Sformat_mode_line); 23829 defsubr (&Sformat_mode_line);
23830 defsubr (&Sinvisible_p);
23809 23831
23810 staticpro (&Qmenu_bar_update_hook); 23832 staticpro (&Qmenu_bar_update_hook);
23811 Qmenu_bar_update_hook = intern ("menu-bar-update-hook"); 23833 Qmenu_bar_update_hook = intern ("menu-bar-update-hook");