I added this to my init.el:

  ;; Transparent Emacs   
  ;;(set-frame-parameter (selected-frame) 'alpha '(<active> [<inactive>]))
    (set-frame-parameter (selected-frame) 'alpha '(88 70))
    (add-to-list 'default-frame-alist '(alpha 88 70))

Which make the background of emacs transparent. However when I removed this code from the init.el, the change persists. Why?

  • 3
    Are you using desktop mode? (gnu.org/software/emacs/manual/html_node/emacs/…) or a customisation file? It's possible that theme-related settings are finding their way into the persisted state that those packages save. Commented Sep 3, 2015 at 21:04
  • @StuartHickinbottom: I'm betting that's the answer (desktop). If confirmed, please post it as an answer.
    – Drew
    Commented Sep 3, 2015 at 21:53
  • Do you compile your init files by chance? Commented Sep 4, 2015 at 7:11
  • @Drew -- will do. As the question was a bit open-ended I didn't want to speculate too early! Commented Sep 4, 2015 at 14:06

1 Answer 1


I resolved the issue using:

(set-frame-parameter (selected-frame) 'alpha '(100))
(add-to-list 'default-frame-alist '(alpha 100))

The alpha parameter specifies the opacity of the frame, the second argument specifies the opacity when not full screen.

Instead of using the above transparency setting which will persist I added these to init.el and call with M-x when needed.

(defun transparency-on ()
  "Sets the transparency of the frame window. 0=transparent/100=opaque"
  (set-frame-parameter (selected-frame) 'alpha 70))

(defun transparency-off ()
  (set-frame-parameter (selected-frame) 'alpha 100))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.