0

I am using Emacs on a macOS Monterey 12.5 (M1 hardware). This is my config file.

I am trying to install a package called clj-refactor for Clojure development.

Following the instructions on the official documentation:

1 - I executed:

M-x package-install clj-refactor

2 - Emacs asked:

Directory ‘/System/Volumes/Data/home/pedro/.dotfiles/.emacs.d/’ does not exist; create? (y or n)

I replied with y. Then, the mini-buffer echoed:

files--ensure-directory: Creating directory: Operation not supported, /System/Volumes/Data/home/pedro

Obs.: I must highlight that I usually do the installation via use-package declaration, as you see on the init file. Since clj-rafactor does not mention it on the official documentation and since I also failed to do it with use-package (see commented out code on my init file), I decided to simply follow the standard installation which did not work out...

Obs. 2: This problem seems to be related to this previous problem.

How to fix this?

1 Answer 1

1

This problem was totally related to the previous problem.

I only found this after having written most part of the question. Hence, I decided to answer it and leave it as content that could help other people.

This class problem originated from the process of bringing an Emacs init file from an old machine (running Linux-based NixOS and with .dotfiles being used) to a new macOS machine (which does not use .dotfiles on the file hierarchy).

Thus, changing my init file from:

(setq custom-file (locate-user-emacs-file "/home/pedro/.dotfiles/.emacs.d/custom-vars.el"))

To:

(setq custom-file (locate-user-emacs-file "/home/pedro/.emacs.d/custom-vars.el"))

Solved the problem.

Also, I tweaked the config file to include comments about the problem:

;; Avoid custom variables from Emacs, since this is a handcrafted file
;; Move them to a different file. There is macOS and a nixOS version
;; macOS
(setq custom-file (locate-user-emacs-file "/home/pedro/.emacs.d/custom-vars.el")) 
;; nixOS config
;;(setq custom-file (locate-user-emacs-file "/home/pedro/.dotfiles/.emacs.d/custom-vars.el"))

(load custom-file 'noerror 'nomessage)

Finally, I successfully installed the package with:

;; Install of clj-refactor
(use-package clj-refactor
  :ensure t)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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