chiark / gitweb /
el/dot-emacs.el: Fix phase-separation bug.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 24 May 2020 03:24:07 +0000 (04:24 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 24 May 2020 03:25:35 +0000 (04:25 +0100)
Previously, the macro would expect the parent style to exist at
expansion time, which works at the REPL, but not in the byte compiler.
Instead, expand to code to handle inheritance at runtime.

el/dot-emacs.el

index 8ca49a5c741981d937d87e753047d6ef14a3e3c0..75e39a505f236e09099747543d76918fbd538710 100644 (file)
@@ -2001,12 +2001,11 @@ (cl-defmacro mdw-define-c-style (name (&optional parent) &rest assocs)
         (func (intern (concat "mdw-define-c-style/" name-string))))
     `(progn
        (setq ,var
-            ',(if (null parent)
-                  assocs
-                (let ((parent-list (symbol-value
-                                    (intern (concat "mdw-c-style/"
-                                                    (symbol-name parent))))))
-                  (mdw-merge-style-alists assocs parent-list))))
+            ,(if (null parent)
+                 `',assocs
+               (let ((parent-list (intern (concat "mdw-c-style/"
+                                                  (symbol-name parent)))))
+                 `(mdw-merge-style-alists ',assocs ,parent-list))))
        (defun ,func () (c-add-style ,name-string ,var))
        (and (featurep 'cc-mode) (,func))
        (add-hook 'mdw-define-c-styles-hook ',func)