bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37627: Document how to bypass the Easy Customization interface


From: 積丹尼 Dan Jacobson
Subject: bug#37627: Document how to bypass the Easy Customization interface
Date: Sat, 05 Oct 2019 07:55:11 +0800

On (info "(emacs) Easy Customization") we read

...

       To browse and alter settings (both variables and faces), type ‘M-x
    customize’.  This creates a “customization buffer”, which lets you
    navigate through a logically organized list of settings, edit and set
    their values, and save them permanently.

Please add:

    However certain older users are bad at using interfaces to set
    variables and just want to set them the old fashioned way by hand
    with setq in their .emacs file. It gives them more feelings of
    control. For them, please see the final section below.

And to

* Menu:

* Customization Groups::     How settings are classified.
* Browsing Custom::          Browsing and searching for settings.
* Changing a Variable::      How to edit an option’s value and set the option.
* Saving Customizations::    Saving customizations for future Emacs sessions.
* Face Customization::       How to edit the attributes of a face.
* Specific Customization::   Customizing specific settings or groups.
* Custom Themes::            Collections of customization settings.
* Creating Custom Themes::   How to create a new custom theme.

Please add

* Setting via .emacs::      Bypassing the Customization Interface


And in that section say:

Let's say you see in some .el file

    (defvar csv-comment-start nil
      "String that starts a comment line, or nil if no comment syntax.
    Such comment lines are ignored by CSV mode commands.
    This variable is buffer local\; its default value is that of
    `csv-comment-start-default'.  It is set by the function
    `csv-set-comment-start' -- do not set it directly!")

    (make-variable-buffer-local 'csv-comment-start)

    (defcustom csv-comment-start-default "#"
      "String that starts a comment line, or nil if no comment syntax.
    Such comment lines are ignored by CSV mode commands.
    Default value of buffer-local variable `csv-comment-start'.
    Changing this variable does not affect any existing CSV mode buffer."
      :type '(choice (const :tag "None" nil) string)
      :set (lambda (variable value)
             (custom-set-default variable value)
             (setq-default csv-comment-start value)))

And we simply want to set the comment start to nil in our .emacs. But we
are scared by the warning about not setting it directly, and we *do not
want to use the "customization interface" to set it, we just want to set
it in our .emacs with a single setq or whatever line*.

Well no reason for despair. In your .emacs simply do
(setq csv-comment-start-default nil)

So it turns out whenever you see a "defcustom", you can just use setq
to set it in your .emacs, without needing help from the Customization
Interface if you don't want it.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]