Call new micro-state a transient state

This commit is contained in:
justbur 2016-01-19 21:55:38 -05:00 committed by syl20bnr
parent 154cfeea19
commit e97af03ff7
14 changed files with 118 additions and 91 deletions

View File

@ -134,10 +134,6 @@ used."
"Return the name of the micro-state function."
(intern (format "spacemacs/%S-micro-state" name)))
(defun spacemacs//micro-state-body-func-name (name)
"Return the name of the micro-state function."
(intern (format "spacemacs/%S-micro-state/body" name)))
(defun spacemacs//micro-state-auto-execute (bindings)
"Auto execute the binding corresponding to `this-command-keys'."
`(let* ((key (substring (this-command-keys)
@ -269,48 +265,58 @@ pressed)."
(delete-window corelv-wnd)
(kill-buffer buf))))
(defmacro spacemacs|add-micro-state-bindings (micro-state-name &rest bindings)
"Add bindings to MICRO-STATE. Bindings take the same form as
they do in `spacemacs|define-micro-state-2'."
;; Transient states (based on hydras)
(defmacro spacemacs|add-transient-state-bindings (transient-state &rest bindings)
"Add bindings to TRANSIENT-STATE. Bindings take the same form as
they do in `spacemacs|define-transient-state'."
(declare (indent 1))
(let ((add-bindings
(intern (format "spacemacs-%s-micro-state-additional-bindings"
micro-state-name))))
(intern (format "spacemacs-%s-transient-state-additional-bindings"
transient-state))))
`(progn
(defvar ,add-bindings nil
,(format "Additional bindings for the %s micro-state"
,(format "Additional bindings for the %s transient state"
micro-state-name))
(dolist (binding ',bindings)
(push binding ,add-bindings)))))
(defface spacemacs-micro-state-title-face
'((t :inherit header-line))
"Face for title of micro states.")
(defun spacemacs//transient-state-func-name (name)
"Return the name of the transient state function."
(intern (format "spacemacs/%S-transient-state" name)))
(defmacro spacemacs|define-micro-state-2 (name &rest props)
"Define a micro-state called NAME.
(defun spacemacs//transient-state-body-func-name (name)
"Return the name of the transient state function."
(intern (format "spacemacs/%S-transient-state/body" name)))
(defface spacemacs-transient-state-title-face
'((t :inherit header-line))
"Face for title of transient states.")
(defmacro spacemacs|define-transient-state (name &rest props)
"Define a transient state called NAME.
NAME is a symbol.
Available PROPS:
`:on-enter SEXP'
Evaluate SEXP when the micro-state is switched on.
Evaluate SEXP when the transient state is switched on.
`:on-exit SEXP'
Evaluate SEXP when leaving the micro-state.
Evaluate SEXP when leaving the transient state.
`:doc STRING or SEXP'
A docstring supported by `defhydra'.
`:title STRING'
Provide a title in the header of the micro-state
Provide a title in the header of the transient state
`:columns INTEGER'
Automatically generate :doc with this many number of columns.
`:hint BOOLEAN'
Whether to automatically add hints to the docstring. Default is nil.
`:foreign-keys SYMBOL'
What to do when keys not bound in the micro-state are entered. This
can be nil (default), which means to exit the micro-state, warn,
What to do when keys not bound in the transient state are entered. This
can be nil (default), which means to exit the transient state, warn,
which means to not exit but warn the user that the key is not part
of the micro-state, or run, which means to try to run the key binding
of the transient state, or run, which means to try to run the key binding
without exiting.
`:entry-binding MAP KEY'
Key binding to use for entering the micro-state.
Key binding to use for entering the transient state.
`:bindings EXPRESSIONS'
One or several EXPRESSIONS with the form
(STRING1 SYMBOL1 DOCSTRING
@ -319,17 +325,17 @@ Available PROPS:
- STRING1 is a key to be bound to the function or key map SYMBOL1.
- DOCSTRING is a STRING or an SEXP that evaluates to a string
- :exit SYMBOL or SEXP, if non nil then pressing this key will
leave the micro-state (default is nil).
leave the transient state (default is nil).
Important note: due to inner working of transient-maps in Emacs
the `:exit' keyword is evaluate *before* the actual execution
of the bound command.
All properties supported by `spacemacs//create-key-binding-form' can be
used."
(declare (indent 1))
(let* ((func (spacemacs//micro-state-func-name name))
(body-func (spacemacs//micro-state-body-func-name name))
(let* ((func (spacemacs//transient-state-func-name name))
(body-func (spacemacs//transient-state-body-func-name name))
(entry-binding (spacemacs/mplist-get props :entry-binding))
(add-bindings (intern (format "spacemacs-%s-micro-state-additional-bindings"
(add-bindings (intern (format "spacemacs-%s-transient-state-additional-bindings"
name)))
(bindings (append (spacemacs/mplist-get props :bindings)
(when (and (boundp add-bindings)
@ -358,7 +364,7 @@ used."
(setq ,hint-var
(list 'concat
(propertize ,title
'face 'spacemacs-micro-state-title-face)
'face 'spacemacs-transient-state-title-face)
"\n" ,hint-var)))
,@bindkeys)))

View File

@ -470,7 +470,7 @@ ARG non nil means Vim like movements."
(call-interactively 'helm-select-action)
(spacemacs//helm-navigation-ms-set-face))
(spacemacs|define-micro-state-2 helm-navigation
(spacemacs|define-transient-state helm-navigation
;; TODO: Figure out what to do with this docstring
:doc (concat (spacemacs//helm-navigation-ms-full-doc))
:foreign-keys run
@ -504,9 +504,9 @@ ARG non nil means Vim like movements."
("T" helm-toggle-all-marks)
("v" helm-execute-persistent-action))
(define-key helm-map (kbd "M-SPC")
'spacemacs/helm-navigation-micro-state/body)
'spacemacs/helm-navigation-transient-state/body)
(define-key helm-map (kbd "s-M-SPC")
'spacemacs/helm-navigation-micro-state/body)
'spacemacs/helm-navigation-transient-state/body)
;; Swap default TAB and C-z commands.
;; For GUI.

View File

@ -371,14 +371,15 @@
;; Buffer micro state
(spacemacs|define-micro-state-2 buffer
(spacemacs|define-transient-state buffer
:title "Buffer Selection Transient State"
:bindings
("n" spacemacs/next-useful-buffer "next")
("N" spacemacs/previous-useful-buffer "previous")
("p" spacemacs/previous-useful-buffer "previous")
("K" kill-this-buffer "kill")
("q" nil "quit" :exit t))
(spacemacs/set-leader-keys "b." 'spacemacs/buffer-micro-state/body)
(spacemacs/set-leader-keys "b." 'spacemacs/buffer-transient-state/body)
;; end of Buffer micro state
@ -404,7 +405,8 @@
(interactive "p")
(enlarge-window delta t))
(spacemacs|define-micro-state-2 window-manipulation
(spacemacs|define-transient-state window-manipulation
:title "Window Manipulation Transient State"
:doc
"
Select^^^^ Move^^^^ Split^^ Resize^^ Other^^
@ -463,7 +465,7 @@ Select^^^^ Move^^^^ Split^^ Resize^^
("V" split-window-right-and-focus)
("w" other-window))
(spacemacs/set-leader-keys "w."
'spacemacs/window-manipulation-micro-state/body)
'spacemacs/window-manipulation-transient-state/body)
;; end of Window Manipulation Micro State
@ -495,7 +497,8 @@ otherwise it is scaled down."
(interactive)
(spacemacs/scale-up-or-down-font-size 0))
(spacemacs|define-micro-state-2 scale-font
(spacemacs|define-transient-state scale-font
:title "Font Scaling Transient State"
:doc "\n[_+_/_=_] scale up [_-_] scale down [_0_] reset font [_q_] quit"
:bindings
("+" spacemacs/scale-up-font)
@ -503,7 +506,7 @@ otherwise it is scaled down."
("-" spacemacs/scale-down-font)
("0" spacemacs/reset-font-size)
("q" nil :exit t))
(spacemacs/set-leader-keys "zx" 'spacemacs/scale-font-micro-state/body)
(spacemacs/set-leader-keys "zx" 'spacemacs/scale-font-transient-state/body)
;; end of Text Manipulation Micro State
@ -540,13 +543,14 @@ otherwise it is scaled down."
(set-frame-parameter (selected-frame) 'alpha
(cons decreased-alpha decreased-alpha)))))
(spacemacs|define-micro-state-2 scale-transparency
(spacemacs|define-transient-state scale-transparency
:title "Frame Transparency Transient State"
:bindings
("+" spacemacs/increase-transparency "increase")
("-" spacemacs/decrease-transparency "decrease")
("T" spacemacs/toggle-transparency "toggle")
("q" nil "quit" :exit t))
(spacemacs/set-leader-keys "TT"
'spacemacs/scale-transparency-micro-state/spacemacs/toggle-transparency)
'spacemacs/scale-transparency-transient-state/spacemacs/toggle-transparency)
;; end of Transparency Micro State

View File

@ -323,7 +323,8 @@ Example: (evil-map visual \"<\" \"<gv\")"
(evil-next-visual-line)
(let ((recenter-redisplay nil))
(recenter nil)))
(spacemacs|define-micro-state-2 scroll
(spacemacs|define-transient-state scroll
:title "Scrolling Transient State"
:bindings
("," evil-scroll-page-up "page up")
("." evil-scroll-page-down "page down")
@ -331,13 +332,14 @@ Example: (evil-map visual \"<\" \"<gv\")"
("<" spacemacs/scroll-half-page-up "half page up")
(">" spacemacs/scroll-half-page-down "half page down"))
(spacemacs/set-leader-keys
"n," 'spacemacs/scroll-micro-state/evil-scroll-page-up
"n." 'spacemacs/scroll-micro-state/evil-scroll-page-down
"n<" 'spacemacs/scroll-micro-state/spacemacs/scroll-half-page-up
"n>" 'spacemacs/scroll-micro-state/spacemacs/scroll-half-page-down)
"n," 'spacemacs/scroll-transient-state/evil-scroll-page-up
"n." 'spacemacs/scroll-transient-state/evil-scroll-page-down
"n<" 'spacemacs/scroll-transient-state/spacemacs/scroll-half-page-up
"n>" 'spacemacs/scroll-transient-state/spacemacs/scroll-half-page-down)
;; pasting micro-state
(spacemacs|define-micro-state-2 paste
(spacemacs|define-transient-state paste
:title "Pasting Transient State"
:doc "\n[%s(length kill-ring-yank-pointer)/%s(length kill-ring)] \
[_J_/_K_] cycles through yanked text, [_p_/_P_] pastes the same text above or \
below. Anything else exits."
@ -347,8 +349,8 @@ below. Anything else exits."
("p" evil-paste-after)
("P" evil-paste-before))
(when dotspacemacs-enable-paste-micro-state
(define-key evil-normal-state-map "p" 'spacemacs/paste-micro-state/evil-paste-after)
(define-key evil-normal-state-map "P" 'spacemacs/paste-micro-state/evil-paste-before))
(define-key evil-normal-state-map "p" 'spacemacs/paste-transient-state/evil-paste-after)
(define-key evil-normal-state-map "P" 'spacemacs/paste-transient-state/evil-paste-before))
;; define text objects
(defmacro spacemacs|define-text-object (key name start end)
@ -687,7 +689,8 @@ below. Anything else exits."
[v] open in a new vertical split
[q] quit")
(spacemacs|define-micro-state-2 ido-navigation
(spacemacs|define-transient-state ido-navigation
:title "ido Transient State"
:foreign-keys run
:on-enter (spacemacs//ido-navigation-ms-on-enter)
:on-exit (spacemacs//ido-navigation-ms-on-exit)
@ -980,8 +983,8 @@ below. Anything else exits."
("spacemacs/toggle-hybrid-mode" . "hybrid (hybrid-mode)")
("spacemacs/toggle-holy-mode" . "emacs (holy-mode)")
("evil-lisp-state-\\(.+\\)" . "\\1")
("\\(.+\\)-micro-state/\\(.+\\)" . "\\2")
("\\(.+\\)-micro-state/body" . "\\1-micro-state"))))
("\\(.+\\)-transient-state/\\(.+\\)" . "\\2")
("\\(.+\\)-transient-state/body" . "\\1-micro-state"))))
(dolist (nd new-descriptions)
;; ensure the target matches the whole string
(push (cons (concat "\\`" (car nd) "\\'") (cdr nd))

View File

@ -205,7 +205,7 @@
(if spacemacs-last-ahs-highlight-p
(progn (goto-char (nth 1 spacemacs-last-ahs-highlight-p))
(spacemacs/ahs-highlight-now-wrapper)
(spacemacs/symbol-highlight-micro-state/body))
(spacemacs/symbol-highlight-transient-state/body))
(message "No symbol has been searched for now.")))
(defun spacemacs/integrate-evil-search (forward)
@ -281,14 +281,14 @@
(spacemacs/ahs-highlight-now-wrapper)
(when (configuration-layer/package-usedp 'evil-jumper)
(evil-set-jump))
(spacemacs/symbol-highlight-micro-state/body)
(spacemacs/symbol-highlight-transient-state/body)
(ahs-forward))
(progn
(spacemacs/integrate-evil-search nil)
(spacemacs/ahs-highlight-now-wrapper)
(when (configuration-layer/package-usedp 'evil-jumper)
(evil-set-jump))
(spacemacs/symbol-highlight-micro-state/body)
(spacemacs/symbol-highlight-transient-state/body)
(ahs-backward))))
(with-eval-after-load 'evil
@ -302,7 +302,7 @@
(interactive)
(spacemacs/ahs-highlight-now-wrapper)
(setq spacemacs-last-ahs-highlight-p (ahs-highlight-p))
(spacemacs/symbol-highlight-micro-state/body)
(spacemacs/symbol-highlight-transient-state/body)
(spacemacs/integrate-evil-search nil))
(defun spacemacs//ahs-ms-on-exit ()
@ -362,7 +362,8 @@
(evil-iedit-state/iedit-mode)
(ahs-edit-mode t)))
(spacemacs|define-micro-state-2 symbol-highlight
(spacemacs|define-transient-state symbol-highlight
:title "Symbol Highlight Transient State"
:doc "
%s(symbol-highlight-doc) [_n_] forward [_N_ or p] backward [_R_] restart [_e_] iedit [_b_] search buffers
%s(make-string (length (symbol-highlight-doc)) 32) [_d_/_D_] fwd/bwd definition [_r_] change range [_/_] search proj [_f_] search files"
@ -386,7 +387,7 @@
(interactive)
(spacemacs/ahs-highlight-now-wrapper)
(setq spacemacs-last-ahs-highlight-p (ahs-highlight-p))
(spacemacs/symbol-highlight-micro-state/body)
(spacemacs/symbol-highlight-transient-state/body)
(spacemacs/integrate-evil-search nil)))))
(defun spacemacs/init-avy ()
@ -666,16 +667,17 @@
(use-package evil-numbers
:config
(progn
(spacemacs|define-micro-state-2 evil-numbers
(spacemacs|define-transient-state evil-numbers
:title "Evil Numbers Transient State"
:doc "\n[_+_/_=_] increase number [_-_] decrease"
:bindings
("+" evil-numbers/inc-at-pt)
("=" evil-numbers/inc-at-pt)
("-" evil-numbers/dec-at-pt))
(spacemacs/set-leader-keys
"n+" 'spacemacs/evil-numbers-micro-state/evil-numbers/inc-at-pt
"n=" 'spacemacs/evil-numbers-micro-state/evil-numbers/inc-at-pt
"n-" 'spacemacs/evil-numbers-micro-state/evil-numbers/dec-at-pt))))
"n+" 'spacemacs/evil-numbers-transient-state/evil-numbers/inc-at-pt
"n=" 'spacemacs/evil-numbers-transient-state/evil-numbers/inc-at-pt
"n-" 'spacemacs/evil-numbers-transient-state/evil-numbers/dec-at-pt))))
(defun spacemacs/init-evil-search-highlight-persist ()
(use-package evil-search-highlight-persist
@ -1183,13 +1185,14 @@ on whether the spacemacs-ivy layer is used or not, with
(use-package move-text
:defer t
:init
(spacemacs|define-micro-state-2 move-text
(spacemacs|define-transient-state move-text
:title "Move Text Transient State"
:bindings
("J" move-text-down "move down")
("K" move-text-up "move up"))
(spacemacs/set-leader-keys
"xJ" 'spacemacs/move-text-micro-state/move-text-down
"xK" 'spacemacs/move-text-micro-state/move-text-up)))
"xJ" 'spacemacs/move-text-transient-state/move-text-down
"xK" 'spacemacs/move-text-transient-state/move-text-up)))
(defun spacemacs/init-neotree ()
(use-package neotree
@ -1622,7 +1625,8 @@ on whether the spacemacs-ivy layer is used or not, with
zoom-frm-in)
:init
(progn
(spacemacs|define-micro-state-2 zoom-frm
(spacemacs|define-transient-state zoom-frm
:title "Zoom Frame Transient State"
:doc "
[_+_/_=_] zoom frame in [_-_] zoom frame out [_0_] reset zoom [_q_] quit"
:bindings
@ -1631,7 +1635,7 @@ on whether the spacemacs-ivy layer is used or not, with
("-" spacemacs/zoom-frm-out)
("0" spacemacs/zoom-frm-unzoom)
("q" nil :exit t))
(spacemacs/set-leader-keys "zf" 'spacemacs/zoom-frm-micro-state/body)
(spacemacs/set-leader-keys "zf" 'spacemacs/zoom-frm-transient-state/body)
(defun spacemacs//zoom-frm-powerline-reset ()
(when (fboundp 'powerline-reset)

View File

@ -200,7 +200,8 @@
;; installation instructions
(add-hook 'erc-view-log-mode-hook 'turn-on-auto-revert-tail-mode)
(spacemacs|define-micro-state-2 erc-log
(spacemacs|define-transient-state erc-log
:title "ERC Log Transient State"
:doc (concat
"\n[_r_] to reload the log file"
"[_>_], [_<_] to go to the next/prev mention")
@ -209,7 +210,7 @@
(">" erc-view-log-next-mention)
("<" erc-view-log-previous-mention))
(spacemacs/set-leader-keys-for-major-mode 'erc-mode
"." 'spacemacs/erc-log-micro-state/body))))
"." 'spacemacs/erc-log-transient-state/body))))
(defun erc/init-erc-image ()
(use-package erc-image

View File

@ -37,15 +37,16 @@
(agda2-highlight-record-face . font-lock-type-face)))
:config
(progn
(spacemacs|define-micro-state-2 goal-navigation
(spacemacs|define-transient-state goal-navigation
:title "Goal Navigation Transient State"
:doc "\n[_f_] next [_b_] previous [_q_] quit"
:bindings
("f" agda2-next-goal)
("b" agda2-previous-goal)
("q" nil :exit t))
(spacemacs/set-leader-keys-for-major-mode 'agda2-mode
"f" 'spacemacs/goal-navigation-micro-state/agda2-next-goal
"b" 'spacemacs/goal-navigation-micro-state/agda2-previous-goal)
"f" 'spacemacs/goal-navigation-transient-state/agda2-next-goal
"b" 'spacemacs/goal-navigation-transient-state/agda2-previous-goal)
(spacemacs/set-leader-keys-for-major-mode 'agda2-mode
"?" 'agda2-show-goals

View File

@ -107,7 +107,8 @@
:init
(progn
(evil-define-key 'normal macrostep-keymap "q" 'macrostep-collapse-all)
(spacemacs|define-micro-state-2 macrostep
(spacemacs|define-transient-state macrostep
:title "MacroStep Transient State"
:doc "\n[_e_] expand [_c_] collapse [_n_/_N_] next/previous [_q_] quit"
:foreign-keys run
:bindings
@ -117,7 +118,7 @@
("N" macrostep-prev-macro)
("q" macrostep-collapse-all :exit t))
(spacemacs/set-leader-keys-for-major-mode 'emacs-lisp-mode
"dm" 'spacemacs/macrostep-micro-state/body))))
"dm" 'spacemacs/macrostep-transient-state/body))))
(defun emacs-lisp/post-init-evil ()
(add-hook 'emacs-lisp-mode-hook

View File

@ -222,7 +222,8 @@
;; (setq spacemacs--web-mode-ms-doc-toggle
;; (logxor spacemacs--web-mode-ms-doc-toggle 1)))
(spacemacs|define-micro-state-2 web-mode
(spacemacs|define-transient-state web-mode
:title "Web-mode Transient State"
:columns 4
:foreign-keys run
:bindings
@ -243,7 +244,7 @@
("q" nil "quit" :exit t)
("<escape>" nil nil :exit t))
(spacemacs/set-leader-keys-for-major-mode 'web-mode
"." 'spacemacs/web-mode-micro-state/body))
"." 'spacemacs/web-mode-transient-state/body))
:mode
(("\\.phtml\\'" . web-mode)

View File

@ -125,7 +125,8 @@
(define-key ein:notebook-multilang-mode-map (kbd "M-j") 'ein:worksheet-move-cell-down)
(define-key ein:notebook-multilang-mode-map (kbd "M-k") 'ein:worksheet-move-cell-up)
(spacemacs|define-micro-state-2 ipython-notebook
(spacemacs|define-transient-state ipython-notebook
:title "iPython Notebook Transient State"
:doc (concat (spacemacs//ipython-notebook-ms-doc))
:bindings
("q" nil :exit t)

View File

@ -57,15 +57,16 @@
(defun git/init-git-timemachine ()
(use-package git-timemachine
:defer t
:commands spacemacs/time-machine-micro-state/body
:commands spacemacs/time-machine-transient-state/body
:init
(spacemacs/set-leader-keys
"gt" 'spacemacs/time-machine-micro-state/body)
"gt" 'spacemacs/time-machine-transient-state/body)
:config
(progn
(spacemacs|define-micro-state-2 time-machine
(spacemacs|define-transient-state time-machine
:title "Git Timemachine Transient State"
:doc "
[_p_/_N_] previous [_n_] next [_c_] current [_Y_] copy hash [_q_] quit"
:on-enter (let (golden-ratio-mode)
@ -127,7 +128,7 @@
(spacemacs/declare-prefix "gd" "diff")
(spacemacs/set-leader-keys
"gA" 'magit-cherry-pick-popup
"gb" 'spacemacs/git-blame-micro-state/body
"gb" 'spacemacs/git-blame-transient-state/body
"gc" 'magit-commit-popup
"gC" 'magit-checkout
"gd" 'magit-diff-popup
@ -145,7 +146,8 @@
"gS" 'magit-stage-file
"gU" 'magit-unstage-file)
(spacemacs|define-micro-state-2 git-blame
(spacemacs|define-transient-state git-blame
:title "Git Blame Transient State"
:doc (concat "Press [_b_] again to blame further in the history, "
"[_q_] to go up or quit.")
:on-enter (let (golden-ratio-mode)

View File

@ -9,7 +9,8 @@
;;
;;; License: GPLv3
(spacemacs|define-micro-state-2 vcs
(spacemacs|define-transient-state vcs
:title "VCS Transient State"
:doc "
Hunk Commands^^^^^^ Magit Commands
----------------------------^^^^^^ ------------------------------------------
@ -37,5 +38,5 @@
("h" version-control/show-hunk)
("t" spacemacs/toggle-version-control-margin)
("q" nil :exit t))
(spacemacs/set-leader-keys "g." 'spacemacs/vcs-micro-state/body)
(spacemacs/set-leader-keys "g." 'spacemacs/vcs-transient-state/body)

View File

@ -59,7 +59,8 @@
"[n] next, [p/N] previous, [TAB] back and forth, [c] close, "
"[r] rename"))))))
(spacemacs|define-micro-state-2 workspaces
(spacemacs|define-transient-state workspaces
:title "Workspaces Transient State"
:doc (concat (spacemacs//workspaces-ms-documentation))
:bindings
("0" eyebrowse-switch-to-window-config-0)
@ -86,4 +87,4 @@
;; The layouts layer defines this keybinding inside a microstate
;; thus this is only needed if that layer is not used
(unless (configuration-layer/layer-usedp 'spacemacs-layouts)
(spacemacs/set-leader-keys "lw" 'spacemacs/workspaces-micro-state/body)))))
(spacemacs/set-leader-keys "lw" 'spacemacs/workspaces-transient-state/body)))))

View File

@ -114,7 +114,8 @@
(when (equal 1 spacemacs--layouts-ms-doc-toggle)
spacemacs--layouts-ms-documentation))))
(spacemacs|define-micro-state-2 layouts
(spacemacs|define-transient-state layouts
:title "Layouts Transient State"
:doc (concat (spacemacs//layouts-ms-doc))
:bindings
;; need to exit in case number doesn't exist
@ -153,7 +154,7 @@
("w" spacemacs/layout-workspaces-micro-state :exit t)
("x" spacemacs/layouts-ms-kill)
("X" spacemacs/layouts-ms-kill-other :exit t))
(spacemacs/set-leader-keys "l" 'spacemacs/layouts-micro-state/body)
(spacemacs/set-leader-keys "l" 'spacemacs/layouts-transient-state/body)
(defun spacemacs/layout-switch-by-pos (pos)
"Switch to perspective of position POS."
@ -174,7 +175,7 @@
,(format "Switch to layout %s." i)
(interactive)
(spacemacs/layout-switch-by-pos ,(if (eq 0 i) 9 (1- i)))
(spacemacs/layouts-micro-state/body))))
(spacemacs/layouts-transient-state/body))))
(defun spacemacs/layout-goto-default ()
"Go to `dotspacemacs-default-layout-name` layout"
@ -186,7 +187,7 @@
"Rename a layout and get back to the perspectives micro-state."
(interactive)
(call-interactively 'persp-rename)
(spacemacs/layouts-micro-state/body))
(spacemacs/layouts-transient-state/body))
(defun spacemacs/layouts-ms-close ()
"Kill current perspective"
@ -196,7 +197,7 @@
(defun spacemacs/layouts-ms-close-other ()
(interactive)
(call-interactively 'spacemacs/helm-persp-close)
(spacemacs/layouts-micro-state/body))
(spacemacs/layouts-transient-state/body))
(defun spacemacs/layouts-ms-kill ()
"Kill current perspective"
@ -206,7 +207,7 @@
(defun spacemacs/layouts-ms-kill-other ()
(interactive)
(call-interactively 'spacemacs/helm-persp-kill)
(spacemacs/layouts-micro-state/body))
(spacemacs/layouts-transient-state/body))
(defun spacemacs/layouts-ms-last ()
"Switch to the last active perspective"
@ -269,7 +270,7 @@ Available PROPS:
"Update the custom-perspectives microstate and then activate it."
(interactive)
(spacemacs//update-custom-layouts)
(spacemacs/custom-layouts-micro-state/body))
(spacemacs/custom-layouts-transient-state/body))
(defun spacemacs//custom-layouts-ms-documentation ()
"Return the docstring for the custom perspectives micro-state."
@ -291,7 +292,7 @@ format so they are supported by the
(name (cdr custom-persp))
(func-name (spacemacs//custom-layout-func-name name)))
(push (list binding func-name) bindings)))
(eval `(spacemacs|define-micro-state-2 custom-layouts
(eval `(spacemacs|define-transient-state custom-layouts
:doc (concat (spacemacs//custom-layouts-ms-documentation))
:bindings
,@bindings))))