unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37627: Document how to bypass the Easy Customization interface
@ 2019-10-04 23:55 積丹尼 Dan Jacobson
  2019-10-05  7:15 ` Eli Zaretskii
  2019-10-05 13:21 ` Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2019-10-04 23:55 UTC (permalink / raw)
  To: 37627

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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-07  6:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 23:55 bug#37627: Document how to bypass the Easy Customization interface 積丹尼 Dan Jacobson
2019-10-05  7:15 ` Eli Zaretskii
2019-10-05 13:21 ` Richard Stallman
2019-10-05 15:10   ` 積丹尼 Dan Jacobson
2019-10-05 16:01     ` Eli Zaretskii
2019-10-07  6:55       ` 積丹尼 Dan Jacobson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).