From f3c650472c0a6032df881acc62137f92625d68dd Mon Sep 17 00:00:00 2001 From: justbur Date: Tue, 5 Jan 2016 11:26:47 -0500 Subject: [PATCH] transparency: Better version of toggle transparency Before we could get an error if for some reason the user set the alpha parameter to something other than a cons cell. Ref #4388 --- layers/+distribution/spacemacs-base/keybindings.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/layers/+distribution/spacemacs-base/keybindings.el b/layers/+distribution/spacemacs-base/keybindings.el index 86ac9b817..763de49fa 100644 --- a/layers/+distribution/spacemacs-base/keybindings.el +++ b/layers/+distribution/spacemacs-base/keybindings.el @@ -555,12 +555,13 @@ otherwise it is scaled down." "Toggle between transparent or opaque display." (interactive) (let* ((frame (selected-frame)) - (alpha (frame-parameter frame 'alpha))) + (alpha (frame-parameter frame 'alpha)) + (dotfile-setting (cons dotspacemacs-active-transparency + dotspacemacs-inactive-transparency))) (set-frame-parameter frame 'alpha - (if (or (null alpha) (= (cdr-safe alpha) 100)) - (cons dotspacemacs-active-transparency - dotspacemacs-inactive-transparency) + (if (not (equal alpha dotfile-setting)) + dotfile-setting '(100 . 100)))) ;; Immediately enter the micro-state, but also keep toggle ;; accessible from helm-spacemacs