help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Dynamic setting of custom vars?


From: Per Abrahamsen
Subject: Re: Dynamic setting of custom vars?
Date: Tue, 25 Mar 2003 18:08:26 +0100
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (sparc-sun-solaris2.8)

Greg Fenton <greg.fenton.NO.SPAM@ianywhere.com> writes:

> Is what I'm doing at all possible?  Is there a better way (should I
> simply avoid custom-set-variables)?

Avoiding custom-set-variables for system dependent variables are by far
the easiest solution.  I recommend that.

Another solutions would set custom-file depending on the system
setting.  Then all customize variables will in effect be system
dependent.  For some, this may be the best solution.

A third solution would be

  (cond ((string-match "my-laptop" (downcase (system-name)))
         (setq glf-height 60))
        ((string-match "my-linux-box" (downcase (system-name)))
         (setq glf-height 80)))
  
  (custom-set-variables
    '(default-frame-alist (list '(width . 81) (cons 'height glf-height)))
    '(initial-frame-alist (list '(width . 81) (cons 'height glf-height))))

I.e. instead of using quote, build the list.

I don't recomment this, since if you customize the value later, you
lose the information.  So you can just as well use setq, which is
simpler, and allows Customize to warn youif you try to change it.



reply via email to

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