Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Haskell variables don't retain their customization #1043

Closed
hvr opened this issue Dec 30, 2015 · 7 comments
Closed

Custom Haskell variables don't retain their customization #1043

hvr opened this issue Dec 30, 2015 · 7 comments

Comments

@hvr
Copy link
Member

hvr commented Dec 30, 2015

Experienced on haskell-mode-20151226.750/Emacs 24.5.1

After having customized a few indentation related custom variables via M-x customize-mode, I end up with the following init.el file:

(require 'package)
(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.
 '(haskell-indentation-ifte-offset 4)
 '(haskell-indentation-layout-offset 4)
 '(haskell-indentation-left-offset 4)
 '(package-archives
   (quote
    (("gnu" . "http://elpa.gnu.org/packages/")
     ("melpa" . "http://melpa.org/packages/")))))

However, when restarting emacs with this init.el file those variables still show their default 2-value, and customize-variable tells me that the variable's state is

Hide Haskell Indentation Layout Offset: 2                                         
   [ State ]: CHANGED outside Customize.
   Extra indentation to add before expressions in a Haskell layout list.
Groups: [Haskell Indentation]
@hvr
Copy link
Member Author

hvr commented Dec 30, 2015

I notice there's entries such as

(defvar haskell-indentation-layout-offset 2 "\
Extra indentation to add before expressions in a Haskell layout list.")

(custom-autoload 'haskell-indentation-layout-offset "haskell-indentation" t)

in haskell-mode-autoloads.el... is that supposed to be in there?

@gracjan
Copy link
Contributor

gracjan commented Jan 3, 2016

I've checked just a moment ago and it works for me.

Do you use spacemacs?

@hvr
Copy link
Member Author

hvr commented Jan 3, 2016

I don't use spacemacs, no...

I just tried on a new fresh account on a Ubuntu 14.04 VM and was able to reproduce there as well, steps I took:

  • Install Emacs
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty

$ sudo apt-get install emacs
...

$ dpkg -l emacs24
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version          Architecture     Description
+++-=======================-================-================-====================================================
ii  emacs24                 24.3+1-2ubuntu1  amd64            GNU Emacs editor (with GTK+ user interface)
  • Then I created a ${HOME}/emacs.d/init.el with the content from this issue description and started up emacs24
  • M-x package-list-packages, selected haskell-mode for install, and executed; then exited Emacs, and restarted again
  • Went into customize interface via M-x customize-group haskell-indentation, and the 3 settings from the description were valued with "2" rather than "4" and had the state CHANGED outside Customize.

I currently suspect this is an autoloads-related issue/bug

@hvr hvr mentioned this issue Jan 3, 2016
2 tasks
@hvr
Copy link
Member Author

hvr commented Jan 3, 2016

Here's an interesting discussion regarding autoloading defcustoms: https://lists.gnu.org/archive/html/help-gnu-emacs/2007-06/msg00216.html

@hvr
Copy link
Member Author

hvr commented Jan 3, 2016

Here's another discussion pointing out that autoloaded variables are indeed a mistake in most cases: http://comments.gmane.org/gmane.emacs.devel/176796

@gracjan
Copy link
Contributor

gracjan commented Jan 3, 2016

@hvr: so we have learned by the way that you are tehe only person on this planet that tried to change the defaults :)

@hvr
Copy link
Member Author

hvr commented Jan 3, 2016

so we have learned by the way that you are tehe only person on this planet that tried to change the defaults :)

...or maybe just the only one who bothered to get to the bottom of it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants