diff options
Diffstat (limited to 'src/xdisp.c')
| -rw-r--r-- | src/xdisp.c | 22 |
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 | ||
| 18438 | DEFUN ("invisible-p", Finvisible_p, Sinvisible_p, 1, 1, 0, | ||
| 18439 | doc: /* Non-nil if the property makes the text invisible. | ||
| 18440 | POS-OR-PROP can be a marker or number, in which case it is taken to be | ||
| 18441 | a position in the current buffer and the value of the `invisible' property | ||
| 18442 | is checked; or it can be some other value, which is then presumed to be the | ||
| 18443 | value of the `invisible' property of the text of interest. | ||
| 18444 | The non-nil value returned can be t for truly invisible text or something | ||
| 18445 | else 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"); |