Emacs 如何设置自定义变量

Emacs 如何设置自定义变量,emacs,elisp,Emacs,Elisp,有 以及我在source中看到的设置: (defcustom cperl-indent-parens-as-block nil "*Non-nil means that non-block ()-, {}- and []-groups are indented as blocks, but for trailing \",\" inside the group, which won't increase indentation. One should tune up `cperl-close

以及我在source中看到的设置:

(defcustom cperl-indent-parens-as-block nil
  "*Non-nil means that non-block ()-, {}- and []-groups are indented as blocks,
but for trailing \",\" inside the group, which won't increase indentation.
One should tune up `cperl-close-paren-offset' as well."
  :type 'boolean
  :group 'cperl-indentation-details)

我试图使用
(自定义设置变量(cperl indent parens作为块t))
,但这不起作用,因此如何将其更改为
t
作为全局设置?

该函数称为
…-变量

(custom-set-variables '(cperl-indent-parens-as-block t))
或者您可以只使用
setq
,因为变量没有定义setter:

(setq cperl-indent-parens-as-block t)
方法是M-x自定义变量cperl indent parens as block

这将显示一个包含可能值等的漂亮菜单,然后将这些值添加到
init.el
(或
emacs.el
)中