Alex Vong (2017-07-04 16:16 +0800) wrote: [...] > Is there an intermediate approch? Is is possible for Emacs to signal a > warning when the required features are not found, but still continue > loading the rest of the config?
If you wish to have a message in *Messages* buffer, you can do it like this: (unless (require 'foo nil t) (message "Error during loading 'foo'!!!")) or like this: (with-demoted-errors "%S" (require 'foo)) If you want to have a warning in a pop-up buffer, then: (unless (require 'foo nil t) (display-warning 'oops "Error during loading 'foo'!!!")) [...] > Thanks for the suggestion! It turns out setting NIX_STATE_DIR to > "/usr/local/var/guix/" and making "~/.config/guix/latest" pointing to > "~/scm/guix/" completely resolves the problem. So now only a oneliner is > required: > > (require 'guix-autoloads '() t) Actually, why do you need this line at all? Such autoloads should be loaded automatically. Do you also require autoloads of other emacs packages? Do you use Emacs from Guix or from your operating system (not GuixSD)? > Do you think it is a bug that Emacs-Guix does not set > `guix-state-directory' correctly? I'm not sure what you mean. It sets this variable to "/var/guix" by default (or to NIX_STATE_DIR if you use it). If you use Guix with a non-standard state directory, how can Emacs-Guix define it? BTW, don't you have problems using "/usr/local/var" as the state directory? If you use guix from a git checkout, I think it is a standard practice to configure it with "--localstatedir=/var". It is even mentioned in the manual a couple of times: (info "(guix) Building from Git") (info "(guix) Requirements") -- Alex