From: Gerd Möllmann Date: Mon, 17 Jul 2023 06:40:02 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/master' into scratch/pkg X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7cc9727d6b0298db267b33d3aebb5f00ec94b56a;p=emacs.git Merge remote-tracking branch 'origin/master' into scratch/pkg --- 7cc9727d6b0298db267b33d3aebb5f00ec94b56a diff --cc src/lisp.h index 80009d08872,99f6858c281..89132e5f51c --- a/src/lisp.h +++ b/src/lisp.h @@@ -806,12 -808,21 +808,12 @@@ INLINE voi help static checking. */ typedef struct { void const *fwdptr; } lispfwd; -/* Interned state of a symbol. */ - -enum symbol_interned -{ - SYMBOL_UNINTERNED, /* not interned anywhere */ - SYMBOL_INTERNED, /* interned but not in initial obarray */ - SYMBOL_INTERNED_IN_INITIAL_OBARRAY /* interned in initial obarray */ -}; - enum symbol_redirect { - SYMBOL_PLAINVAL = 4, - SYMBOL_VARALIAS = 1, - SYMBOL_LOCALIZED = 2, - SYMBOL_FORWARDED = 3 + SYMBOL_PLAINVAL, /* plain var, value is in the `value' field */ + SYMBOL_VARALIAS, /* var alias, value is really in the `alias' symbol */ + SYMBOL_LOCALIZED, /* localized var, value is in the `blv' object */ + SYMBOL_FORWARDED /* forwarding var, value is in `forward' */ }; enum symbol_trapped_write @@@ -829,18 -840,14 +831,11 @@@ struct Lisp_Symbo { bool_bf gcmarkbit : 1; - /* Indicates where the value can be found: - 0 : it's a plain var, the value is in the `value' field. - 1 : it's a varalias, the value is really in the `alias' symbol. - 2 : it's a localized var, the value is in the `blv' object. - 3 : it's a forwarding variable, the value is in `forward'. */ - ENUM_BF (symbol_redirect) redirect : 3; + /* Indicates where the value can be found. */ + ENUM_BF (symbol_redirect) redirect : 2; - /* 0 : normal case, just set the value - 1 : constant, cannot set, e.g. nil, t, :keywords. - 2 : trap the write, call watcher functions. */ ENUM_BF (symbol_trapped_write) trapped_write : 2; - /* Interned state of the symbol. */ - ENUM_BF (symbol_interned) interned : 2; - /* True means that this variable has been explicitly declared special (with `defvar' etc), and shouldn't be lexically bound. */ bool_bf declared_special : 1; diff --cc src/treesit.c index 67b0f4b1810,1f694e47201..26a8ccc7abc --- a/src/treesit.c +++ b/src/treesit.c @@@ -2397,18 -2640,22 +2640,22 @@@ treesit_predicate_match (Lisp_Object ar /* Handles predicate (#pred FN ARG...). Return true if FN returns non-nil; return false otherwise. The arity of FN must match the - number of ARGs */ + number of ARGs. If everything goes fine, don't touch SIGNAL_DATA; + if error occurs, set it to a suitable signal data. */ static bool - treesit_predicate_pred (Lisp_Object args, struct capture_range captures) + treesit_predicate_pred (Lisp_Object args, struct capture_range captures, + Lisp_Object *signal_data) { - if (XFIXNUM (Flength (args)) < 2) - xsignal2 (Qtreesit_query_error, - build_pure_c_string ("Predicate `pred' requires " - "at least two arguments, " - "but was only given"), - Flength (args)); + if (list_length (args) < 2) + { + *signal_data = list2 (build_string ("Predicate `pred' requires " + "at least two arguments, " + "but only got"), + Flength (args)); + return false; + } - Lisp_Object fn = Fintern (XCAR (args), Qnil); + Lisp_Object fn = Fintern (XCAR (args), Qnil, Qnil); Lisp_Object nodes = Qnil; Lisp_Object tail = XCDR (args); FOR_EACH_TAIL (tail)