4

This is a follow-up question to Emacs Lisp: evaluate variable in alist.. I am trying to set default-frame-alist in my .emacs file. Consider, e.g.

(setq default-frame-alist
      '((auto-lower . nil)
        (auto-raise . nil)
        (height . 41)
        (width . 80)
        (top . 1)
        (left . 1)))

(I have omitted some values) This works fine.. Suppose now I want set the height according to another variable..Say, I stored the integer value 50 in the variable my-height.. How can I set height to the value of my-height ? I have tried

  • (height . my-height)
  • ``(height . ,my-height)`

but neither works.. What am I missing here?

Community
  • 1
  • 1
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174

1 Answers1

8

You need to backquote the whole form:

(setq default-frame-alist
      `((auto-lower . nil)
        (auto-raise . nil)
        (height . ,my-height)
        (width . 80)
        (top . 1)
        (left . 1)))
sds
  • 58,617
  • 29
  • 161
  • 278