0

I am currently trying to use chemacs on my computer, following the instructions given on github, but I do not seem to be able to make it work properly.

My goal would be to be able to use both Emacs 24.5.1 and spacemacs using Emacs 26.3, and chemacs seemed to be the only solution for doing this in a sensible way. I am using Ubuntu 16.04, and both versions of emacs were installed today.

So I did what the instruction on github were saying: I first cloned the repository into my home file. Here is the result I got:

(base) giovanni@giovanni-UX510UXK:~$ git clone https://github.com/plexus/chemacs.git
Cloning into 'chemacs'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 116 (delta 3), reused 7 (delta 2), pack-reused 105
Receiving objects: 100% (116/116), 41.23 KiB | 39.00 KiB/s, done.
Resolving deltas: 100% (37/37), done.
Checking connectivity... done.
(base) giovanni@giovanni-UX510UXK:~$ cd chemacs
(base) giovanni@giovanni-UX510UXK:~/chemacs$ ./install.sh
OK  Creating symlink ~/.emacs -> /home/giovanni/chemacs/./.emacs

Now, when I try to run emacs 24.5.1, I get the following message

Warning (initialization): An error occurred while loading `/home/giovanni/.emacs':

Symbol's function definition is void: alist-get

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

The message is the same even if I use the command emacs --with-profile default. This makes me suspect that emacs 24.5.1 is too old for chemacs (although I did not find this mentioned in anything that I found online). Now, I should probably say that emacs seems to work, but I do not know exactly what this error means and how I should try to solve the issue. When I tried to run emacs with the -debug-init option, this is the message I got:

Debugger entered--Lisp error: (void-function alist-get)
  (alist-get key (chemacs-get-emacs-profile chemacs-current-emacs-profile) default)
  chemacs-emacs-profile-key(user-emacs-directory)
  (file-name-as-directory (chemacs-emacs-profile-key (quote user-emacs-directory)))
  (let* ((emacs-directory (file-name-as-directory (chemacs-emacs-profile-key (quote user-emacs-directory)))) (init-file (expand-file-name "init.el" emacs-directory)) (custom-file- (chemacs-emacs-profile-key (quote custom-file) init-file)) (server-name- (chemacs-emacs-profile-key (quote server-name)))) (setq user-emacs-directory emacs-directory) (if server-name- (progn (setq server-name server-name-))) (mapcar (function (lambda (env) (setenv (car env) (cdr env)))) (chemacs-emacs-profile-key (quote env))) (if (chemacs-emacs-profile-key (quote straight-p)) (progn (chemacs-load-straight))) (load init-file) (if (not custom-file) (progn (setq custom-file custom-file-) (if (equal custom-file init-file) nil (load custom-file)))))
  chemacs-load-profile("default")
  (if args (let ((s (split-string (car args) "="))) (cond ((equal (car args) "--with-profile") (add-to-list (quote command-switch-alist) (quote ("--with-profile" lambda (_) (pop command-line-args-left)))) (chemacs-load-profile (cadr args))) ((equal (car s) "--with-profile") (add-to-list (quote command-switch-alist) (cons (car args) (quote (lambda ...)))) (chemacs-load-profile (mapconcat (quote identity) (cdr s) "="))) (t (chemacs-check-command-line-args (cdr args))))) (chemacs-load-profile (chemacs-detect-default-profile)))
  chemacs-check-command-line-args(nil)
  (cond ((equal (car args) "--with-profile") (add-to-list (quote command-switch-alist) (quote ("--with-profile" lambda (_) (pop command-line-args-left)))) (chemacs-load-profile (cadr args))) ((equal (car s) "--with-profile") (add-to-list (quote command-switch-alist) (cons (car args) (quote (lambda (_))))) (chemacs-load-profile (mapconcat (quote identity) (cdr s) "="))) (t (chemacs-check-command-line-args (cdr args))))
  (let ((s (split-string (car args) "="))) (cond ((equal (car args) "--with-profile") (add-to-list (quote command-switch-alist) (quote ("--with-profile" lambda (_) (pop command-line-args-left)))) (chemacs-load-profile (cadr args))) ((equal (car s) "--with-profile") (add-to-list (quote command-switch-alist) (cons (car args) (quote (lambda (_))))) (chemacs-load-profile (mapconcat (quote identity) (cdr s) "="))) (t (chemacs-check-command-line-args (cdr args)))))
  (if args (let ((s (split-string (car args) "="))) (cond ((equal (car args) "--with-profile") (add-to-list (quote command-switch-alist) (quote ("--with-profile" lambda (_) (pop command-line-args-left)))) (chemacs-load-profile (cadr args))) ((equal (car s) "--with-profile") (add-to-list (quote command-switch-alist) (cons (car args) (quote (lambda ...)))) (chemacs-load-profile (mapconcat (quote identity) (cdr s) "="))) (t (chemacs-check-command-line-args (cdr args))))) (chemacs-load-profile (chemacs-detect-default-profile)))
  chemacs-check-command-line-args(("emacs"))
  eval-buffer(#<buffer  *load*> nil "/home/giovanni/.emacs" nil t)  ; Reading at buffer position 7047
  load-with-code-conversion("/home/giovanni/.emacs" "/home/giovanni/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "\205\262

Again, I don't exactly know what is going on here. Any hint is really appreciated.

Finally, I would like to apologize for such a long post containing questions that may well be very trivial. In my defense, I can say that I am fairly new to all of this (also, I might have messed up with the tags; apologies for that as well).

2
  • 1
    Please stick to one question – Stefan Nov 1 '20 at 19:39
  • Thanks. I've deleted the second part of the post. – Leo163 Nov 1 '20 at 20:10
1

alist-get was added in Emacs-25, so indeed the code of chemacs seems to require a version more recent than Emacs-24.5. You'll likely get better information by asking directly the chemacs maintainers. Maybe they do want to support older Emacs versions and it's a simple error (it's easy to replace uses of alist-get with something else).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.