;; stack-all (defun jhbd-stack-all () "Puts all the visible windows on current workspace in the shade-stack" (interactive) (let* ((wins (stacking-order)) (len (length wins)) (i 0)) (while (< i len) (let ((w (nth i wins))) (cond ((and (member current-workspace (window-get w 'workspaces)) (not (already-stacked w (get-shade-stack))) (shade-stack-window w)))) (setq i (+ i 1)))))) (defun jhbd-unstack-windows (wins) "" (cond ((not (null wins)) (shade-unstack-window (car wins)) (jhbd-unstack-windows (cdr wins))))) (defvar stack nil) (defun jhbd-extract-stack (s) "Cleans up the shade-stack by removing the positions" (setq s (delete 'empty s)) (cond ((not (null s)) (setq stack (cons (car (car s)) stack)) (jhbd-extract-stack (cdr s)))) stack) (defun jhbd-unstack-all () "Unstacks all of the windows in the shade-stack" (interactive) (setq stack nil) (setq s nil) (jhbd-unstack-windows (reverse (jhbd-extract-stack (get-shade-stack))))) ;; My personal prefs -- uncomment and edit ;(bind-keys global-keymap "A-s" 'jhbd-stack-all) ;(bind-keys global-keymap "A-a" 'jhbd-unstack-all) ;; end stack-all