1

In August, I built Emacs 28 and I've been using it ever since. Until last week, when I did the same for v29. Everything seems fine so far. However, I wanted to check something, so I fired up my previous version, 27.2. It won't load properly. First, it puked on a package in my init file, auto-package-update.

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 2) generate-new-buffer(" *temp*" t) apu--read-file-as-string("c:/Users/micha/AppData/Roaming/.emacs.d/.last-package-update-day") apu--read-last-update-day() apu--should-update-packages-p() auto-package-update-maybe() eval-buffer(#<buffer *load*> nil "c:/Users/micha/AppData/Roaming/.emacs.d/init.el" nil t) ; Reading at buffer position 3265 load-with-code-conversion("c:/Users/micha/AppData/Roaming/.emacs.d/init.el" "c:/Users/micha/AppData/Roaming/.emacs.d/init.el" t t) load("c:/Users/micha/AppData/Roaming/.emacs.d/init" noerror nomessage) startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1570fd9>) #f(compiled-function () #<bytecode 0x1570fed>) t) command-line() normal-top-level()

I commented that out. That lead to the error shown below. The backtrace is huge, so I put it at the end of the message. I have a doubt it's useful. The substance of it is (void-function make-closure) when loading flycheck.

Nothing fancy in my build. It's the same for both versions.

Windows 10 Pro build 19043.1237

./configure --without-dbus --with-native-compilation --without-pop --prefix=/c/emacs/

GNU Emacs 28.0.50 (build 1, x86_64-w64-mingw32) of 2021-08-11

GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32) of 2021-10-02

Is native compilation doing this? I don't know anything else that's different pre- and post- upgrade. Even so, not everything in my packages has been recompiled since then. Flycheck was, though: flycheck-20210825.1804.

Not a showstopper, but unexpected, and annoying.

Thanks for any help.

~Backtrace~

Debugger entered--Lisp error: (void-function make-closure) make-closure(#f(compiled-function (checker) #<bytecode 0x28fe115>) nil) flycheck-define-command-checker(ada-gnat "An Ada syntax checker using GNAT.\n\nUses the GNAT compiler from GCC. See URL\n'https://www.adacore.com/community/'." :command ("gnatmake" "-c" "-f" "-u" "-gnatf" "-gnatef" "-D" temporary-directory (option-list "-gnat" flycheck-gnat-warnings concat) (option-list "-I" flycheck-gnat-include-path concat) (option "-gnat" flycheck-gnat-language-standard concat) (eval flycheck-gnat-args) source) :error-patterns ((error line-start (message "In file included from") " " (file-name) ":" line ":" column ":" line-end) (info line-start (file-name) ":" line ":" column ": note: " (message) line-end) (warning line-start (file-name) ":" line ":" column ": warning: " (message) line-end) (error line-start (file-name) ":" line ":" column ": " (message) line-end)) :modes ada-mode :next-checkers nil :standard-input nil :working-directory nil) byte-code("\300\301\302\303#\300\301\304\305#\306\307\310\311\312DD\313\314\315\316\317\320\321\322\323&\13\210\324\307\325\"\210\306\326\310\311\327DD\330\314\315\320\331\332\333\322\334&\13\210\324\326\325\"\210\306\335\310\311\336DD\337\314\315\320\340\332\341\322\342&\13\210\324\335\325\"\210\306\343\310\311\344DD\345\314\315\320\346\332\333\322\347&\13\210\324\343\325\"\210\306\350\310\311\351DD\352\320\353\314\354\316\317&\11\210\355\325\356\357\360\361\362\363\364\365\366\367\366\370\366&\16\210\306\371\310\311\372DD\373\320\353\314\354\316\317&\11\210\355\374\375\357\376\361\377\363\201@\0\365\366\367\317\370\366&\16\210\306\201A\0\310\311\201B\0DD\201C\0\320\353\314\354\316\317&\11\210\355\201D\0\201E\0\357\201F\0\361\201G\0\363\201@\0\365\366\367\317\370\366&\16\207" [function-put flycheck-define-checker lisp-indent-function 1 doc-string-elt 2 custom-declare-variable flycheck-gnat-args funcall function #f(compiled-function () #<bytecode 0x2900b59>) "A list of additional command line arguments.\n\nThe value of this variable is a list of strings with additional\ncommand line arguments.\n\nThis variable is an option for the following syntax checkers:\n\n - 'ada-gnat'" :group flycheck-options :risky t :type (repeat (string :tag "Argument")) :package-version (flycheck . "0.20") flycheck-register-option-var ada-gnat flycheck-gnat-include-path #f(compiled-function () #<bytecode 0x2900b69>) "A list of include directories for GNAT.\n\nThe value of this variable is a list of strings, where each\nstring is a directory to add to the include path of gcc.\nRelative paths are relative to the file being checked.\n\nThis variable is an option for the following syntax checkers:\n\n - 'ada-gnat'" (repeat (directory :tag "Include directory")) :safe flycheck-string-list-p (flycheck . "0.20") flycheck-gnat-language-standard #f(compiled-function () #<bytecode 0x2900b79>) "The language standard to use in GNAT.\n\nThe value of this variable is either a string denoting a language\nstandard, or nil, to use the default standard. When non-nil, pass\nthe language standard via the '-std' option.\n\nThis variable is an option for the following syntax checkers:\n\n - 'ada-gnat'" (choice (const :tag "Default standard" nil) (string :tag "Language standard")) flycheck-string-or-nil-p (flycheck . "0.20") flycheck-gnat-warnings #f(compiled-function () #<bytecode 0x2900b89>) "A list of additional Ada warnings to enable in GNAT.\n\nThe value of this variable is a list of strings, where each\nstring is the name of a warning category to enable. By default,\nmost optional warnings are recommended, as in '-gnata'.\n\nRefer to Info Node '(gnat_ugn_unw)Warning Message Control' for\nmore information about GNAT warnings.\n\nThis variable is an option for the following syntax checkers:\n\n - 'ada-gnat'" (repeat :tag "Warnings" (string :tag "Warning name")) (flycheck . "0.20") flycheck-ada-gnat-executable #f(compiled-function () #<bytecode 0x2900b99>) "The executable of the ada-gnat syntax checker.\n\nEither a string containing the name or the path of the\nexecutable, or nil to use the default executable from the syntax\nchecker declaration.\n\nThe default executable is \"gnatmake\"." (choice (const :tag "Default executable" nil) (string :tag "Name or path")) flycheck-executables flycheck-define-command-checker "An Ada syntax checker using GNAT.\n\nUses the GNAT compiler from GCC. See URL\n'https://www.adacore.com/community/'." :command ("gnatmake" "-c" "-f" "-u" "-gnatf" "-gnatef" "-D" temporary-directory (option-list "-gnat" flycheck-gnat-warnings concat) (option-list "-I" flycheck-gnat-include-path concat) (option "-gnat" flycheck-gnat-language-standard concat) (eval flycheck-gnat-args) source) :error-patterns ((error line-start (message "In file included from") " " (file-name) ":" line ":" column ":" line-end) (info line-start (file-name) ":" line ":" column ": note: " (message) line-end) (warning line-start (file-name) ":" line ":" column ": warning: " (message) line-end) (error line-start (file-name) ":" line ":" column ": " (message) line-end)) :modes ada-mode :next-checkers nil :standard-input :working-directory flycheck-asciidoc-executable #f(compiled-function () #<bytecode 0x2900ba9>) "The executable of the asciidoc syntax checker.\n\nEither a string containing the name or the path of the\nexecutable, or nil to use the default executable from the syntax\nchecker declaration.\n\nThe default executable is \"asciidoc\"." asciidoc "A AsciiDoc syntax checker using the AsciiDoc compiler.\n\nSee URL 'http://www.methods.co.nz/asciidoc'." ("asciidoc" "-o" null-device "-") ((error line-start "asciidoc: ERROR: <stdin>: Line " line ": " (message) line-end) (warning line-start "asciidoc: WARNING: <stdin>: Line " line ": " (message) line-end) (info line-start "asciidoc: DEPRECATED: <stdin>: Line " line ": " (message) line-end)) adoc-mode flycheck-asciidoctor-executable #f(compiled-function () #<bytecode 0x2900bb9>) "The executable of the asciidoctor syntax checker.\n\nEither a string containing the name or the path of the\nexecutable, or nil to use the default executable from the syntax\nchecker declaration.\n\nThe default executable is \"asciidoctor\"." asciidoctor "An AsciiDoc syntax checker using the Asciidoctor compiler.\n\nSee URL 'http://asciidoctor.org'." ("asciidoctor" "-o" null-device "-") ((error line-start "asciidoctor: ERROR: <stdin>: Line " line ": " (message) line-end) (warning line-start "asciidoctor: WARNING: <stdin>: Line " line ": " (message) line-end))] 17) require(flycheck nil t) byte-code("\3011z\0\302 \303\304\305\"\210\306\307\310\311#\204\36\0\312\313\314\315\307\"\316#\202V\0\302 \303\304\317\"\210\32011\0\321\322\323\"0\2027\0\10\324\2\"\262\1\325\326\302 \4\"!\211\327V\203N\0\303\330\317\3#\266\2\202T\0\303\331\317\"\266\2\262\1\325\326\302 \4\"!\211\327V\203m\0\303\330\305\3#\266\2\202s\0\303\331\305\"\266\2\262\0010\210\202\200\0\10\332\2\"\266\2\333\334!\210\335\334!\210\321\336\337\"\207" [use-package--warning98 (debug error) current-time message "%s..." "Loading package flycheck" require flycheck nil t display-warning use-package format "Cannot load %s" :error "Configuring package flycheck" (debug error) add-hook after-init-hook global-flycheck-mode :config float-time time-subtract 0.1 "%s...done (%.3fs)" "%s...done" :catch global-font-lock-mode 1 show-paren-mode write-file-functions time-stamp] 8) load("~/.emacs.d/.emacs-config/.emacs-config.elc") (cond ((not (file-newer-than-file-p config-main-source config-main-compiled)) (load config-main-compiled) (message "**************Loaded precompiled main file**************")) ((file-newer-than-file-p config-main-source config-main-compiled) (byte-compile-file config-main-source) (load config-main-compiled) (message "**************Compiled and loaded main file**************")) (t (message "**************Main file not found, not loaded**************"))) eval-buffer(#<buffer *load*> nil "c:/Users/micha/AppData/Roaming/.emacs.d/init.el" nil t) ; Reading at buffer position 7132 load-with-code-conversion("c:/Users/micha/AppData/Roaming/.emacs.d/init.el" "c:/Users/micha/AppData/Roaming/.emacs.d/init.el" t t) load("c:/Users/micha/AppData/Roaming/.emacs.d/init" noerror nomessage) startup--load-user-init-file(#f(compiled-function () #<bytecode 0x15857e1>) #f(compiled-function () #<bytecode 0x15857f5>) t) command-line() normal-top-level()

naugiedoggie
  • 334
  • 1
  • 8
  • 1
    I think you need to force a byte re-compilation of yr installed packages. – Fran Burstall Oct 06 '21 at 17:15
  • 1
    Yes, you almost always get into trouble when going from one version of Emacs to another unless you re–byte–compile everything. – db48x Oct 06 '21 at 20:54
  • 2
    Byte code is generally forwards-compatible, so you should be able to use .elc files which were compiled in Emacs 27 under Emacs 28 (e.g. when upgrading Emacs); but the reverse is not true -- if you compile elisp in Emacs 28 and try to use those .elc files in Emacs 27 you can expect problems. – phils Oct 06 '21 at 22:28
  • Okay, thanks @phils. It seemed a likely cause, but I didn't know for sure. Issue possibly compounded by the new "native compilation" method. If I want to use v27, I guess I'll have to give it its own home directory for init. – naugiedoggie Oct 07 '21 at 00:15
  • @naugiedoggie , I would suggest that you use the package **Chemacs 2** and move your different settings to different dictionaries depending on which version you run. See [Chemacs 2 GitHub](https://githib.com/plexus/chemacs2.git) – Anders Jan 25 '23 at 21:14

1 Answers1

0

If you want to run different versions on Emacs, you might want to consider to use different config directories depending on version. In newer Emacs (v 28 I think) there are a switch to set user-emacs-directory to point to different directories for different versions.

If you don't have new enough Emacs, you can install the package Chemacs 2, which can have different user-emacs-directory depending on version. Useful for different set ups and different versions of Emacs.

You must install Chemacs 2 in ~/.emacs.d/ and you can't have a ~/.emacs{,.el,.elc} file. Just move old .emacs.d/ to a new directory, and then use that as default emacs configuration. Then you can select others with the switch --with-profile to Emacs.

So start with move all init files, except ~/.config/emacs out of the way for Chemacs 2, in a way that we still can use the old default.

[ -f ~/.emacs -o -f ~/.emacs.el ] && mkdir ~/old && mv ~/.emacs{,.el.elc} ~/old
[ -d ~/.emacs.d ] && mv ~/.emacs.d ~/.emacs.default
git clone https://github.com/plexus/chemacs2.git ~/.emacs.d

Then create a file that Chemacs 2 reads and select which confiuration to use. If not set, it will use the configuration which is called default.

So, create the file ~/.emacs-profiles.el with at least one default name and then as many as you like for other configurations.

cat >.emacs-profiles.el <<EOF
;; Default when no --with-profile switch to emacs (or `default`).
(("default" . ((user-emacs-directory . "~/.emacs.default")))
 ;; When start emacs with `emacs --with-profile config`
 ("config" . ((user-emacs-directory . "~/.config/emacs")))

And now it will work like before, and if you add --with-profile config you will use the configurations under ~/.config/emacs.

For more information, pleases look at Chemacs 2 GitHub page. There there are more examples, like selecting different settings like Space Emacs, Doom Emacs and Crafted Emacs.

Anders
  • 103
  • 2