]> git.eshelyaron.com Git - emacs.git/commitdiff
Add SYMBOL_FUNC_LEXSPACE
authorAndrea Corallo <akrl@sdf.org>
Fri, 8 May 2020 08:07:21 +0000 (09:07 +0100)
committerAndrea Corallo <akrl@sdf.org>
Fri, 8 May 2020 13:30:13 +0000 (14:30 +0100)
src/lisp.h

index 9e941cba656f0fbe9410a879091a127fcf0818c5..7cbbe44b5a0c2f9c4b99118b928da17af617e300 100644 (file)
@@ -2252,6 +2252,23 @@ SYMBOL_FUNCTION (struct Lisp_Symbol *sym)
   return tmp;
 }
 
+INLINE Lisp_Object
+SYMBOL_FUNC_LEXSPACE (struct Lisp_Symbol *sym)
+{
+  Lisp_Object tmp = symbol_function_1 (sym);
+
+  if (CONSP (tmp)
+      && CONSP (XCDR (tmp))
+      && EQ (XCAR (XCDR (tmp)), Qclosure))
+    {
+      /* Remove the lexspace number in case (n closure () ...) is
+        found.  */
+      eassert (FIXNUMP (XCAR (tmp)));
+      return XCAR (tmp);
+    }
+  return Qnil;
+}
+
 INLINE struct Lisp_Symbol *
 SYMBOL_ALIAS (struct Lisp_Symbol *sym)
 {