0

I am setting up my ERC client to connect to my ZNC IRC proxy server, and I am following this Emacs wiki. At the following step:

;; Configure
M-x customize-group znc RET

I am in the Emacs customize menu where I enter my ZNC server information, but this information is only saved for the current session, and I have to re-enter for every session.

Here is the menu, with a warning at the top indicating that I cannot save my custom settings:

enter image description here

I try to save with C-x C-s, but I get the following message in the mini buffer: Saving settings from "emacs -q" would overwrite existing customizations. This doesn't make sense to me because I am not starting Emacs with a -q flag. I am using the default Emacs desktop file from my Ubuntu installation, which loads my .emac.d/init.el file.

I tried investigating this Emacs wiki page, where it says: Customize stores saved values (for future sessions) in the property saved-value, but I'm not sure how to set this value, or where to begin with setting variables inside the Customize code. Any suggestions?

The only other hint I have is that clicking on State > Show Saved Lisp Expression at the bottom of the page, reveals my values as follows:

'(("irc.lukeswart.net" 5005 nil
   ((irc\.freenode\.net "zncuser" "foo"))))

Update

Thank you for the tips, it led me to discover the underlying problem and eventually fix it.

The problem was in my Ubuntu desktop file, saved under ~/.local/share/applications/emacs24.desktop. Under this file, Emacs was starting with emacs -q --load ~/path/to/my/init.el. I initially missed this desktop file because I was checking under /usr/share/applications/emacs24.desktop. Anyway, here is the code that Customize adds to my init.el, although this should not be added manually:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(markdown-command "/usr/bin/pandoc")
 '(znc-servers (quote (("irc.lukeswart.net" 5005 nil ((irc\.freenode\.net "zncuser" "foo")))))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
  • 1
    The error message you see comes from the function custom-file; it means that the value of user-init-file seems to be nil. What is the value of user-init-file in your setup? – Constantine Nov 27 '14 at 1:13
  • Yes, the value user-init-file was nil. It turned out to be a problem with my desktop file after all, explained in my updated question. – modulitos Nov 27 '14 at 2:49
2

If you started Emacs normally, so that it read your init file, then yes, Customize should let you save any changes you make. If it does not, then that sounds like a bug.

If you did not start Emacs using switch q or Q (or equivalent, which means not to read your init file), and if you tried to save Customize settings and Emacs gave you that error message, then that is a bug, I think.

Please use M-x report-emacs-bug, describing just what you did so that the Emacs developers can reproduce the problem.

  • I was looking at the wrong desktop file, where I was actually running emacs -q --load /path/to/my/init.el. Thanks for helping me diagnose the problem. – modulitos Nov 27 '14 at 2:56

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.