0

I sometimes explore customisable variables in Custom-mode to get a structured overview, before manually setting them with setq-default in my .emacs. Can I make Custom-mode show the Lisp names of the variables/faces in addition to the having access to the TUI widgets?

It looks like these:

custom-variable-default-form custom-face-default-form

can be set to edit for widgets and lisp for lisp names. However:

  1. You cannot show both. In particular, choices are not listed in lisp mode, and choices are often not listed in the description, and xref-find-definitions fails to go to the source.
  2. They do not take priority over defcustom's :custom-form. In practice this doesn't seem likely to be an issue. My Emacs Lisp is not great, but maybe adding advice to e.g. custom-variable-value-create can override this.
  • Not sure what you're asking, but if you haven't already, take a look at user options custom-unlispify-tag-names, custom-unlispify-remove-prefixes, and custom-unlispify-menu-entries. – Drew Oct 19 '16 at 15:02
  • I think the settings I mentioned ultimate result in a decision to call or not call these functions. The question is how to display the lisp name/value and still have access to the controls in the Customize TUI. – Sam Brightman Oct 19 '16 at 16:03
  • I still don't understand. What do you mean by "still have access to the controls in the Customize UI"? Have you tried customizing one or more of those options (they are variables, not functions)? M-x customize-option. – Drew Oct 19 '16 at 21:45
  • You know the interactive TUI of customize? It offers various widgets, which can helpfully display things like valid choices for a variable. This is useful for exploring options. If you enable lisp-style names and editing, the controls are no longer present. I want to both: a) be able to use the controls; b) see the lisp names for later programmatic use of these variables. – Sam Brightman Oct 19 '16 at 22:02
  • Changing which of those options makes it impossible for you to use those widgets? Describe the problem. I use Customize all the time, and I have nil as the value of custom-unlispify-tag-names, for instance. So far, your description of the problem is not clear, to me at least. Consider adding a screenshot, if you cannot describe it with words? – Drew Oct 19 '16 at 22:56
2

I'm assuming that you are using the Custom interface to find variables you might want to change and to try out the possible values, but that once you have settled on a value, then you want to use setq in you init file instead of saving the value from the Custom interface.

You have done this in Custom:

[v] Mode Require Final Newline: [Value Menu] Ask each time
 [State]: modified
 Whether to add a newline at end of file, in certain major modes. [more]

and now you want to use setq to do the same.

The problem you appear to have is that Mode Require Final Newline isn't a variable and Ask each time isn't a proper value for whatever the variable may be. And that you don't know how to "translate" the things you see to what you have to put into your init file.

In order to see mode-require-final-newline instead of Mode Require Final Newline you have to (setq custom-unlispify-tag-names nil). You cannot do this on the fly. Alternatively you can manually replace every space with a dash and downcase everything. That gives you the correct result for most (but not all) variables.

And in order to see 'ask instead of Ask each time you have to first click on State > Set for Current Session and then on State > Show Saved Lisp Expression.

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.