From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Klaus Berndl Newsgroups: gmane.emacs.help Subject: writing an own version of setq? Date: 09 Oct 2002 12:34:12 +0200 Organization: sd&m AG, Muenchen, Germany Sender: help-gnu-emacs-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1034160481 16108 127.0.0.1 (9 Oct 2002 10:48:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 9 Oct 2002 10:48:01 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17zENk-0004Bg-00 for ; Wed, 09 Oct 2002 12:48:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17zEH9-0006Pi-00; Wed, 09 Oct 2002 06:41:11 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!newsfeed.mathworks.com!oleane.net!oleane!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!news.sdm.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: sachrang.muc.sdm.de Original-X-Trace: solti3.muc.sdm.de 1034159652 14464 193.102.181.147 (9 Oct 2002 10:34:12 GMT) Original-X-Complaints-To: usenet@news.sdm.de Original-NNTP-Posting-Date: 9 Oct 2002 10:34:12 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:105859 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2406 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2406 I have written the code below to give me a save setq which only sets the new value if the symbol is not already saved via customize: ,---- | (defmacro custom-saved-p (option) | "Return only not nil if OPTION is a defcustom-option and has a saved | value. " | `(and (get ,option 'custom-type) | (get ,option 'saved-value))) | | (defmacro setq-save (option value) | "Sets OPTION to VALUE if and only if OPTION is not already saved by | customize." | `(and (not (custom-saved-p ,option)) | (set ,option ,value))) `---- 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? (I know, for a complete setq-save i have to add the semantic for many symbol-value-pairs like in the *setq* but this should not be a big problem...) many thanks in advance! Klaus -- Klaus Berndl mailto: klaus.berndl@sdm.de sd&m AG http://www.sdm.de software design & management Thomas-Dehler-Str. 27, 81737 München, Germany Tel +49 89 63812-392, Fax -220