Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs lisp evaluate variable in alist

Tags:

emacs

lisp

elisp

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?

like image 288
Håkon Hægland Avatar asked Feb 17 '23 03:02

Håkon Hægland


1 Answers

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)))
like image 183
sds Avatar answered Feb 27 '23 15:02

sds