I load a package that defines a list of radio stations with defvar

(defvar default-list '((station1) (station2)))

I want to redefine this list after loading the package (I am using require) because a lot of the stations are defunct.

1 Answer 1

(setq default-list  '((station1) (station99) (stationABC))) ; Redefine.


(add-to-list 'default-list '(station23)) ; Add a station.

Take a look at C-h i, Emacs Lisp Intro. See also the Elisp manual, node Setting Variables.

You can also use setq or your own defvar before that defvar in the package is evaluated. That will prevent the package's defvar from taking effect. See the Elisp manual, node Defining Variables.

  • That's what I tried, so in this case the code is not being executed perhaps. or maybe it's being executed before the package defines the defvar (but that doesn't make sense). I'll try putting it somewhere else then. Jun 16, 2016 at 13:15
  • 1
    I figured it out and used this method. EMMS had cached the defunct streams as personal bookmarks (and was updating the variable at runtime). I deleted that directory and now it works properly. Jun 16, 2016 at 13:32

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.