[Top][All Lists]

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

Re: writing an own version of setq?

From: Thomas Link
Subject: Re: writing an own version of setq?
Date: Wed, 09 Oct 2002 15:09:52 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020910

OK, calls like (setq-save 'klaus (+ 1 2)) work fine but I'm not really
satisfied because i want to write (setq-save klaus (+ 1 2)). Note the missing
quote! How can i achieve this?

You could possibly replace ,option with (quote ,option) like in:

(defmacro setq-save (option value)
  "Sets OPTION to VALUE if and only if OPTION is not already saved by
  `(and (not (custom-saved-p ,option))
        (set (quote ,option) ,value)))

(setq-save x 1)

Setting the variable with setq or defvar is ok for you?


reply via email to

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