aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2017-12-16 12:15:06 +0200
committerEli Zaretskii2017-12-16 12:15:06 +0200
commit78908644131e70f20de28fed08ef4dc2878878a3 (patch)
treeebf19e9d28cd1ae021d90964aafc645e0470d600 /src
parenta1327bbc645efa42f14024785da4fed88aa7ec21 (diff)
downloademacs-78908644131e70f20de28fed08ef4dc2878878a3.tar.gz
emacs-78908644131e70f20de28fed08ef4dc2878878a3.zip
Improve documentation of 'invisible-p'
* doc/lispref/display.texi (Invisible Text): Document the return value of 'invisible-p'. * src/xdisp.c (Finvisible_p): Rename the argument POS. Doc fix. (Bug#29721)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 0a37013c560..7601e26a902 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -25086,19 +25086,25 @@ invisible_prop (Lisp_Object propval, Lisp_Object list)
25086} 25086}
25087 25087
25088DEFUN ("invisible-p", Finvisible_p, Sinvisible_p, 1, 1, 0, 25088DEFUN ("invisible-p", Finvisible_p, Sinvisible_p, 1, 1, 0,
25089 doc: /* Non-nil if the property makes the text invisible. 25089 doc: /* Non-nil if text properties at POS cause text there to be currently invisible.
25090POS-OR-PROP can be a marker or number, in which case it is taken to be 25090POS should be a marker or a buffer position; the value of the `invisible'
25091a position in the current buffer and the value of the `invisible' property 25091property at that position in the current buffer is examined.
25092is checked; or it can be some other value, which is then presumed to be the 25092POS can also be the actual value of the `invisible' text or overlay
25093value of the `invisible' property of the text of interest. 25093property of the text of interest, in which case the value itself is
25094The non-nil value returned can be t for truly invisible text or something 25094examined.
25095else if the text is replaced by an ellipsis. */) 25095
25096 (Lisp_Object pos_or_prop) 25096The non-nil value returned can be t for currently invisible text that is
25097entirely hidden on display, or some other non-nil, non-t value if the
25098text is replaced by an ellipsis.
25099
25100Note that whether text with `invisible' property is actually hidden on
25101display may depend on `buffer-invisibility-spec', which see. */)
25102 (Lisp_Object pos)
25097{ 25103{
25098 Lisp_Object prop 25104 Lisp_Object prop
25099 = (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop) 25105 = (NATNUMP (pos) || MARKERP (pos)
25100 ? Fget_char_property (pos_or_prop, Qinvisible, Qnil) 25106 ? Fget_char_property (pos, Qinvisible, Qnil)
25101 : pos_or_prop); 25107 : pos);
25102 int invis = TEXT_PROP_MEANS_INVISIBLE (prop); 25108 int invis = TEXT_PROP_MEANS_INVISIBLE (prop);
25103 return (invis == 0 ? Qnil 25109 return (invis == 0 ? Qnil
25104 : invis == 1 ? Qt 25110 : invis == 1 ? Qt