Skip to content

Customizable variables

Gracjan Polak edited this page Mar 29, 2016 · 3 revisions

Customizable variables are defined using defcustom in Emacs Lisp. Customizable variables bear significant cost with them:

  1. Customizable variables needs to be documented. Users need to find relevant options they are interested in and understand consequences of changing the default.
  2. Customizable variables needs to be tested. For boolean custom option state space grows twice and requires double the amount of unit tests. For code lacking unit tests it means that bitrot will make the non-default value dysfunctional.
  3. Some customizable variables signal mode of an operation. In that case it is better to use two separate commands or a command prefix C-u.
  4. Users are reluctant to change the default. Users rightfully expect the default to just work.
  5. Users change the value when forced. Users change value when default does not work. If it does not work then why is it the default?

Overall we do not want to use customizable variables due to the cost outlined above. Avoid them at all cost. So when customization variable are okay?

  1. Customization variables with paths to executables. These directly reflect the environment in which haskell-mode runs.
  2. Customization variables reflecting non-functional preferences. Customizing colors is okay, it does not change the bahavior therefore it does not require as much testing.