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?

4

1 に答える 1

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)))
于 2013-03-18T20:05:40.280 に答える