From 14609012e3bac5debc2c45a976f36a779dcd1a08 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 19 Mar 1995 18:48:15 +0000 Subject: [PATCH] (invisible_p, invisible_ellipsis_p): Handle list as invisible property value. --- src/xdisp.c | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index f9e8491ca4e5..7ef95dfcd63d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3838,6 +3838,8 @@ display_string (w, vpos, string, length, hpos, truncate, /* This is like a combination of memq and assq. Return 1 if PROPVAL appears as an element of LIST or as the car of an element of LIST. + If PROPVAL is a list, compare each element against LIST + in that way, and return 1 if any element of PROPVAL is found in LIST. Otherwise return 0. This function cannot quit. */ @@ -3846,21 +3848,40 @@ invisible_p (propval, list) register Lisp_Object propval; Lisp_Object list; { - register Lisp_Object tail; - for (tail = list; CONSP (tail); tail = Fcdr (tail)) + register Lisp_Object tail, proptail; + for (tail = list; CONSP (tail); tail = XCONS (tail)->cdr) { register Lisp_Object tem; - tem = Fcar (tail); + tem = XCONS (tail)->car; if (EQ (propval, tem)) return 1; if (CONSP (tem) && EQ (propval, XCONS (tem)->car)) return 1; } + if (CONSP (propval)) + for (proptail = propval; CONSP (proptail); + proptail = XCONS (proptail)->cdr) + { + Lisp_Object propelt; + propelt = XCONS (proptail)->car; + for (tail = list; CONSP (tail); tail = XCONS (tail)->cdr) + { + register Lisp_Object tem; + tem = XCONS (tail)->car; + if (EQ (propelt, tem)) + return 1; + if (CONSP (tem) && EQ (propelt, XCONS (tem)->car)) + return 1; + } + } return 0; } /* Return 1 if PROPVAL appears as the car of an element of LIST and the cdr of that element is non-nil. + If PROPVAL is a list, check each element of PROPVAL in that way, + and the first time some element is found, + return 1 if the cdr of that element is non-nil. Otherwise return 0. This function cannot quit. */ @@ -3869,14 +3890,28 @@ invisible_ellipsis_p (propval, list) register Lisp_Object propval; Lisp_Object list; { - register Lisp_Object tail; - for (tail = list; CONSP (tail); tail = Fcdr (tail)) + register Lisp_Object tail, proptail; + for (tail = list; CONSP (tail); tail = XCONS (tail)->cdr) { register Lisp_Object tem; - tem = Fcar (tail); + tem = XCONS (tail)->car; if (CONSP (tem) && EQ (propval, XCONS (tem)->car)) return ! NILP (XCONS (tem)->cdr); } + if (CONSP (propval)) + for (proptail = propval; CONSP (proptail); + proptail = XCONS (proptail)->cdr) + { + Lisp_Object propelt; + propelt = XCONS (proptail)->car; + for (tail = list; CONSP (tail); tail = XCONS (tail)->cdr) + { + register Lisp_Object tem; + tem = XCONS (tail)->car; + if (CONSP (tem) && EQ (propelt, XCONS (tem)->car)) + return ! NILP (XCONS (tem)->cdr); + } + } return 0; }