* Elisp newbie: Getting the value from a variable
@ 2002-12-18 10:30 Fredrik Oberg
2002-12-18 12:28 ` Thomas Link
0 siblings, 1 reply; 2+ messages in thread
From: Fredrik Oberg @ 2002-12-18 10:30 UTC (permalink / raw)
In my .emacs I assign a variable a value which should be the height of
the default frame:
(setq my-frame-height 70)
Then I can view it's value by doing
(message "Size %d" my-frame-height)
But when trying to use it fails. I have the following in my .emacs:
(setq default-frame-alist
'((menu-bar-lines . 1)
(top . 5)
(left . 100)
(width . 100)
(height . my-frame-height)
(cursor-color . "white")
(cursor-type . box)
(foreground-color . "black")
(background-color . "white")
(font . "-*-Courier New-normal-r-*-*-11-82-96-96-c-*-iso8859-1")
)
)
When starting emacs, the height is ignored. When I check out the
variable default-frame-alist it has the following value:
((tool-bar-lines . 0)
(menu-bar-lines . 1)
(top . 5)
(left . 100)
(width . 100)
(height . my-frame-height)
(cursor-color . "white")
(cursor-type . box)
(foreground-color . "black")
(background-color . "white")
(font . "-*-Courier New-normal-r-*-*-11-82-96-96-c-*-iso8859-1"))
my-frame-height is underlined and when I click it, its value (70) is
shown. To me it looks like I must "derefer" the variable in some way.
Is this correct? As a newbie on elisp I have no clue on how to do
that. Can somebody help me find out how to solve this?
Many thanks in advance
/Fredrik
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Elisp newbie: Getting the value from a variable
2002-12-18 10:30 Elisp newbie: Getting the value from a variable Fredrik Oberg
@ 2002-12-18 12:28 ` Thomas Link
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Link @ 2002-12-18 12:28 UTC (permalink / raw)
> (setq default-frame-alist
> '((menu-bar-lines . 1)
> (top . 5)
> (left . 100)
> (width . 100)
> (height . my-frame-height)
> (cursor-color . "white")
> (cursor-type . box)
> (foreground-color . "black")
> (background-color . "white")
> (font . "-*-Courier New-normal-r-*-*-11-82-96-96-c-*-iso8859-1")
> )
> )
You have to use a backquote (see C-h C-f backquote):
(setq default-frame-alist `(... (height . ,my-frame-height) ...)
Ciao,
Thomas.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-18 12:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-18 10:30 Elisp newbie: Getting the value from a variable Fredrik Oberg
2002-12-18 12:28 ` Thomas Link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).