Emacs setq before loading

When setting up Emacs, do I set the appropriate variable before downloading the package or after?

i.e.,

(setq some-variable some-value)
(require 'some-package)

or

(require 'some-package)
(setq some-variable some-value)

It seems to me that most of the time they work, unless some packages explicitly require init after loading. I'm right?

+4
source share
2 answers

If the variable is a custom option, do this before downloading the package. The package contains defcustom, which defines the parameter, but defcustomwill not set the value if the variable already has a value (for example, from yours setq).

, , , defvar. defvar, defcustom, .

, . , .

, , IMO , ( , ), setq .

  • , custom-set-variables customize-set-variable (.. , ). , defcustom, , "" ( ). defcustom , .

    setq , ​​ , , , , , .

  • , , , , setq (.. defvar).

: "", . custom-file ( , ), Customize , ( customize-set-variable .)

, custom-file . , , , custom-file (, ).

+4

, . .

, , python-shell-interpreter *Python* - *Python*. *Python* , .

. . , .

, .emacs, , docs ( Emacs , Emacs ).

, , . Emacs , / . ( ) , reset ( nil mode-reinit).

, Gnus, (gnus-group-exit), , ...

, Emacs - , /, , .

.emacs, ( Emacs ;, Cygwin : INFOPATH env var):

;; Assume that cygwin-mount already activated.
(when (featurep 'cygwin-mount)
  (setenv "INFOPATH" "/usr/share/info/:~/usr/share/info/:")
  ;; Redefine path-separator to UNIX to update Info-directory-list.
  (let ( (path-separator ":") )
    (require 'info)
    (info-initialize)
    ))
+1

Source: https://habr.com/ru/post/1535380/


All Articles