[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
obscure compilation error with cl-defstruct &aux boa constructor
From: |
Madhu |
Subject: |
obscure compilation error with cl-defstruct &aux boa constructor |
Date: |
Sat, 16 Apr 2022 22:16:18 +0530 |
This is a self-inflicted injury,, but nevertheless here goes:
lisp/emacs-lisp/lisp-mode.el has a struct
#+begin_src emacs lisp
(cl-defstruct (lisp-indent-state
(:constructor nil)
(:constructor lisp-indent-initial-state
(&aux (ppss (lisp-ppss))
(ppss-point (point))
(stack (make-list (1+ (car ppss)) nil)))))
stack ;; Cached indentation, per depth.
ppss
ppss-point)
#+end_src
I had a local patch (suggested by Noam Postavsky) which retained the old
open-paren-in-column-0-is-defun-start behaviour with an overriding
advice on lisp-ppss. This patch modified the args to the
lisp-indent-initial-state constructor to look like this:
#+begin_src emacs_lisp
(&optional (ppss (lisp-ppss))
&aux (ppss-point (point))
(stack (make-list (1+ (car ppss)) nil)))))
#+end_src
Recently this leads to an obscure compilation/bootstrap error.
#+begin_example
Loading textmodes/paragraphs...
Loading progmodes/prog-mode...
Loading /dev/shm/emacs/lisp/emacs-lisp/lisp-mode.el (source)...
Eager macro-expansion failure: (void-variable emacs-lisp-mode-syntax-table)
Eager macro-expansion failure: (void-variable emacs-lisp-mode-syntax-table)
Error: void-variable (emacs-lisp-mode-syntax-table)
mapbacktrace(#[1028 "!!!!B5@!A5!!!" [princ " " prin1 "(" " (" " "
")\n"] 7 "\n\n(fn EVALD FUNC ARGS FLAGS)"])
debug-early-backtrace()
debug-early(error (void-variable emacs-lisp-mode-syntax-table))
byte-code(!##" [emacs-lisp-mode-syntax-table make-syntax-table
modify-syntax-entry 8216 "(’ " 8217 ")‘ "] 5)
(defvar help-mode-syntax-table (byte-code !##"
[emacs-lisp-mode-syntax-table make-syntax-table modify-syntax-entry 8216 "(’ "
8217 ")‘ "] 5) ("/dev/shm/emacs/lisp/help-mode.elc" . 4653))
require(help-mode)
byte-code("#!E\"" [set-advertised-calling-convention cl-prettyexpand
(form) "27.1" require help-mode add-to-list describe-symbol-backends nil
cl-find-class #[771 "!" [cl-describe-type] 5 "\n\n(fn S B F)"]] 5)
cl-subseq((&cl-defs (nil (cl-tag-slot) (stack) (ppss) (ppss-point))
&optional (ppss (lisp-ppss)) &aux (ppss-point (point)) (stack (make-list (1+
(car ppss)) nil))) 0 4)
cl--make-usage-args((&cl-defs (nil (cl-tag-slot) (stack) (ppss)
(ppss-point)) &optional (ppss (lisp-ppss)) &aux (ppss-point (point)) (stack
(make-list (1+ (car ppss)) nil))))
cl--transform-lambda(((&cl-defs (nil (cl-tag-slot) (stack) (ppss)
(ppss-point)) &optional (ppss (lisp-ppss)) &aux (ppss-point (point)) (stack
(make-list (1+ (car ppss)) nil))) "Constructor for objects of type
`lisp-indent-state'." (declare (side-effect-free t)) (record 'lisp-indent-state
stack ppss ppss-point)) lisp-indent-initial-state)
#[642 "B\"BB" [defun cl--transform-lambda] 8
("/dev/shm/emacs/lisp/emacs-lisp/cl-macs.elc" .
6880)](lisp-indent-initial-state (&cl-defs (nil (cl-tag-slot) (stack) (ppss)
(ppss-point)) &optional (ppss (lisp-ppss)) &aux (ppss-point (point)) (stack
(make-list (1+ (car ppss)) nil))) "Constructor for objects of type
`lisp-indent-state'." (declare (side-effect-free t)) (record 'lisp-indent-state
stack ppss ppss-point))
(cl-defun lisp-indent-initial-state (&cl-defs (nil (cl-tag-slot) (stack)
(ppss) (ppss-point)) &optional (ppss (lisp-ppss)) &aux (ppss-point (point))
(stack (make-list (1+ (car ppss)) nil))) "Constructor for objects of type
`lisp-indent-state'." (declare (side-effect-free t)) (record 'lisp-indent-state
stack ppss ppss-point))
eval-buffer(#<buffer *load*> nil
"/dev/shm/emacs/lisp/emacs-lisp/lisp-mode.el" nil t)
load-with-code-conversion("/dev/shm/emacs/lisp/emacs-lisp/lisp-mode.el"
"/dev/shm/emacs/lisp/emacs-lisp/lisp-mode.el" nil nil)
load("emacs-lisp/lisp-mode")
load("loadup.el")
Symbol’s value as variable is void: emacs-lisp-mode-syntax-table
make[1]: *** [Makefile:927: bootstrap-emacs.pdmp] Error 255
make[1]: Leaving directory '/dev/shm/emacs/src'
make: *** [Makefile:469: src] Error 2
#+end_example
The error goes away if I remove the &aux (and thus make all the
arguments optional)
Might this be a bug from a recent change? (I've not looked at the
changes yet, so this is a note to self)
- obscure compilation error with cl-defstruct &aux boa constructor,
Madhu <=