Skip to content

Commit

Permalink
Change all references of micro-state in codebase to transient-state
Browse files Browse the repository at this point in the history
  • Loading branch information
balajisivaraman authored and syl20bnr committed Feb 1, 2016
1 parent 62337a3 commit 2b1ed60
Show file tree
Hide file tree
Showing 26 changed files with 185 additions and 185 deletions.
4 changes: 2 additions & 2 deletions core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ auto-save the file in-place, `cache' to auto-save the file to another
file stored in the cache directory and `nil' to disable auto-saving.
Default value is `cache'.")

(defvar dotspacemacs-enable-paste-micro-state t
"If non nil the paste micro-state is enabled. While enabled pressing `p`
(defvar dotspacemacs-enable-paste-transient-state t
"If non nil the paste transient-state is enabled. While enabled pressing `p`
several times cycle between the kill ring content.'")

(defvar dotspacemacs-which-key-delay 0.4
Expand Down
28 changes: 14 additions & 14 deletions doc/CONVENTIONS.org
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- [[Reserved prefix][Reserved prefix]]
- [[User prefix][User prefix]]
- [[Major mode prefix][Major mode prefix]]
- [[Micro-state][Micro-state]]
- [[Transient-state][Transient-state]]
- [[Evilified buffers][Evilified buffers]]
- [[Navigation][Navigation]]
- [[n and N][n and N]]
Expand Down Expand Up @@ -54,7 +54,7 @@ Variables follow these conventions:
A package is initialized in a function with name =<layer>/init-xxx= where:
- =<layer>= is the layer name
- =xxx= is the package name

** Use-package
- Always use =progn= when a code block requires multiple lines for =:init= or
=:config= keywords.
Expand All @@ -73,14 +73,14 @@ user.
~SPC m~ is reserved for the current major mode. Three keys bindings are not an
issue (ie. ~SPC m h d~) since ~SPC m~ can be accessed via ~,~.

*** Micro-state
Whenever possible a micro-state should be enabled with ~M-SPC~ and ~s-M-SPC~. We
*** Transient-state
Whenever possible a transient-state should be enabled with ~M-SPC~ and ~s-M-SPC~. We
need the latter bindings on OS X since ~M-SPC~ is used by the OS for spotlight.

For instance micro-states dedicated to special buffers like =helm= or =ido=
For instance transient-states dedicated to special buffers like =helm= or =ido=
buffers are good candidates to be put on ~M-SPC~ and ~s-M-SPC~.

It is recommended to add ~q~ to leave the micro-state.
It is recommended to add ~q~ to leave the transient-state.

** Evilified buffers
/Evilifying/ a buffer is to set the =evilified state= as the default
Expand All @@ -89,7 +89,7 @@ state for the major mode of the buffer.
The =evilified state= is derived from the =emacs state= and modify the
map to:
- add ~hjkl~ navigation
- add scrolling feature on ~C-f~, ~C-b~, ~C-d~ and ~C-u~
- add scrolling feature on ~C-f~, ~C-b~, ~C-d~ and ~C-u~
- ~G~ and ~gg~ to go to the end and beginning of the buffer
- add incremental search with ~/~, ~n~ and ~N~
- enabling =evil-ex= on ~:~
Expand All @@ -116,10 +116,10 @@ is displayed in =*Messages*=.
To be consistent with the Vim way, ~n~ and ~N~ are favored over Emacs ~n~ and
~p~.

Ideally a micro-state should be provided to smooth the navigation
experience. A micro-state allows to repeat key bindings without entering
each time the prefix commands. More info on micro-states in the
[[file:DOCUMENTATION.org::Micro-states][documentation]].
Ideally a transient-state should be provided to smooth the navigation
experience. A transient-state allows to repeat key bindings without entering
each time the prefix commands. More info on transient-states in the
[[file:DOCUMENTATION.org::Transient-states][documentation]].

*** Code Navigation
The prefix for going to something is ~SPC m g~.
Expand Down Expand Up @@ -231,7 +231,7 @@ The base prefix for debugging commands is ~SPC d~.
| ~m d s~ | step |

Notes:
- Ideally a micro-state for breakpoint navigation should be provided.
- Ideally a transient-state for breakpoint navigation should be provided.
- If there is no toggle breakpoint function, then it should be implemented at
the spacemacs level and ideally the function should be proposed as a patch
upstream (major mode repository).
Expand Down Expand Up @@ -361,6 +361,6 @@ Spacemacs provides an example layer =README.org= file in
- At the end of each header node, there should be an empty line
- Note: Many layer =READMEs= do not follow this convention yet. Please fix
them if you can.

- To keep things readable only mention the prefix ~SPC~ when documenting
key bindings, you don't need to mention ~M-m~.
key bindings, you don't need to mention ~M-m~.
138 changes: 69 additions & 69 deletions doc/DOCUMENTATION.org

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions doc/VIMUSERS.org
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [[Terms][Terms]]
- [[Modes vs. States][Modes vs. States]]
- [[Layers][Layers]]
- [[Micro-states][Micro-states]]
- [[Transient-states][Transient-states]]
- [[Keybinding conventions][Keybinding conventions]]
- [[Running commands][Running commands]]
- [[Buffer and window management][Buffer and window management]]
Expand Down Expand Up @@ -83,17 +83,17 @@ about what packages to install, and instead worry about what features you want.
More information on layers can be found in the [[./VIMUSERS.org#customization][customization]] section and in the
[[./DOCUMENTATION.org#configuration-layers][documentation]]. There is also a more in-depth guide on writing layers [[file:LAYERS.org][here]].

*** Micro-states
Spacemacs provides a special functionality called micro-states. Micro-states
*** Transient-states
Spacemacs provides a special functionality called transient-states. Transient-states
allow similar commands to be run in succession without repeatedly pressing the
~<Leader>~ key. Micro-states are usually triggered by using a keybinding with the
~<Leader>~ key. Transient-states are usually triggered by using a keybinding with the
following pattern: ~<Leader> <group> .~ where group is the category the
micro-state falls under. When in a micro-state you will see documentation at the
bottom of your window. To exit a micro-state press ~q~.
transient-state falls under. When in a transient-state you will see documentation at the
bottom of your window. To exit a transient-state press ~q~.

#+CAPTION: Micro-state documentation window
#+CAPTION: Transient-state documentation window

[[file:img/spacemacs-scale-micro-state.png]]
[[file:img/spacemacs-scale-transient-state.png]]

** Keybinding conventions
Spacemacs uses ~SPC~ as its ~<Leader>~ key. This document will use ~SPC~ to refer to
Expand Down Expand Up @@ -130,7 +130,7 @@ are located under the ~SPC b~ prefix.
| ~SPC b d~ or ~:bdelete~ | Kill current buffer. |
| ~SPC b k~ | Search for a buffer to kill. |
| ~SPC b K~ | Kill all buffers except the current buffer. |
| ~SPC b .~ | Buffer micro-state. |
| ~SPC b .~ | Buffer transient-state. |

**** Special buffers
By default Emacs creates a lot of buffers that most people will never need, like
Expand All @@ -147,7 +147,7 @@ once. All window keybindings are under the ~SPC w~ prefix.
| ~SPC w s~ or ~:split~ | Opens a horizontal split below. |
| ~SPC w h/j/k/l~ | Navigate among windows. |
| ~SPC w H/J/K/L~ | Move the current window. |
| ~SPC w .~ | Window micro-state. |
| ~SPC w .~ | Window transient-state. |

** Files
All file commands in Spacemacs are available under the ~SPC f~ prefix.
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
14 changes: 7 additions & 7 deletions layers/+completion/spacemacs-helm/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@

(defun spacemacs//helm-cleanup ()
"Cleanup some helm related states when quitting."
;; deactivate any running transient map (micro-state)
;; deactivate any running transient map (transient-state)
(setq overriding-terminal-local-map nil))
(add-hook 'helm-cleanup-hook 'spacemacs//helm-cleanup)

(defface spacemacs-helm-navigation-ms-face
`((t :background ,(face-attribute 'error :foreground)
:foreground "black"))
"Face for helm heder when helm micro-state is activated."
"Face for helm heder when helm transient-state is activated."
:group 'spacemacs))

:config
Expand Down Expand Up @@ -419,7 +419,7 @@ ARG non nil means Vim like movements."
(helm-ag-edit))))

(defun spacemacs//helm-navigation-ms-on-enter ()
"Initialization of helm micro-state."
"Initialization of helm transient-state."
;; faces
(spacemacs//helm-navigation-ms-set-face)
(setq spacemacs--helm-navigation-ms-face-cookie-minibuffer
Expand All @@ -428,15 +428,15 @@ ARG non nil means Vim like movements."
'spacemacs-helm-navigation-ms-face)))

(defun spacemacs//helm-navigation-ms-set-face ()
"Set the face for helm header in helm navigation micro-state"
"Set the face for helm header in helm navigation transient-state"
(with-helm-window
(setq spacemacs--helm-navigation-ms-face-cookie-header
(face-remap-add-relative
'helm-header
'spacemacs-helm-navigation-ms-face))))

(defun spacemacs//helm-navigation-ms-on-exit ()
"Action to perform when exiting helm micro-state."
"Action to perform when exiting helm transient-state."
(with-helm-window
(face-remap-remove-relative
spacemacs--helm-navigation-ms-face-cookie-header))
Expand All @@ -452,7 +452,7 @@ ARG non nil means Vim like movements."
(intern)
(helm-select-nth-action ,(1- n))))))

(defun spacemacs/helm-micro-state-select-action ()
(defun spacemacs/helm-transient-state-select-action ()
(interactive)
(call-interactively 'helm-select-action)
(spacemacs//helm-navigation-ms-set-face))
Expand Down Expand Up @@ -481,7 +481,7 @@ ARG non nil means Vim like movements."
("TAB" helm-select-action :exit t)
("<RET>" helm-maybe-exit-minibuffer :exit t)
;; ("?" nil :doc (spacemacs//helm-navigation-ms-full-doc))
("a" spacemacs/helm-micro-state-select-action)
("a" spacemacs/helm-transient-state-select-action)
("e" spacemacs/helm-edit)
("g" helm-beginning-of-buffer)
("G" helm-end-of-buffer)
Expand Down
18 changes: 9 additions & 9 deletions layers/+distribution/spacemacs-base/keybindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@
(evil-define-key 'insert comint-mode-map [down] 'comint-next-input))

;; ---------------------------------------------------------------------------
;; Micro-states
;; Transient-states
;; ---------------------------------------------------------------------------

;; Buffer micro state
;; Buffer transient state

(spacemacs|define-transient-state buffer
:title "Buffer Selection Transient State"
Expand All @@ -382,9 +382,9 @@
("q" nil "quit" :exit t))
(spacemacs/set-leader-keys "b." 'spacemacs/buffer-transient-state/body)

;; end of Buffer micro state
;; end of Buffer transient state

;; Window Manipulation Micro State
;; Window Manipulation Transient State

(defun spacemacs/shrink-window-horizontally (delta)
"Wrap `spacemacs/shrink-window-horizontally'."
Expand Down Expand Up @@ -468,9 +468,9 @@ Select^^^^ Move^^^^ Split^^ Resize^^
(spacemacs/set-leader-keys "w."
'spacemacs/window-manipulation-transient-state/body)

;; end of Window Manipulation Micro State
;; end of Window Manipulation Transient State

;; text Manipulation Micro State
;; text Manipulation Transient State

(defun spacemacs/scale-up-or-down-font-size (direction)
"Scale the font. If DIRECTION is positive or zero the font is scaled up,
Expand Down Expand Up @@ -509,9 +509,9 @@ otherwise it is scaled down."
("q" nil :exit t))
(spacemacs/set-leader-keys "zx" 'spacemacs/scale-font-transient-state/body)

;; end of Text Manipulation Micro State
;; end of Text Manipulation Transient State

;; Transparency micro-state
;; Transparency transient-state

(defun spacemacs/toggle-transparency ()
"Toggle between transparent or opaque display."
Expand Down Expand Up @@ -554,4 +554,4 @@ otherwise it is scaled down."
(spacemacs/set-leader-keys "TT"
'spacemacs/scale-transparency-transient-state/spacemacs/toggle-transparency)

;; end of Transparency Micro State
;; end of Transparency Transient State
24 changes: 12 additions & 12 deletions layers/+distribution/spacemacs-base/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Example: (evil-map visual \"<\" \"<gv\")"
(define-key evil-normal-state-map
(kbd "gd") 'spacemacs/evil-smart-goto-definition)

;; scrolling micro state
;; scrolling transient state
(defun spacemacs/scroll-half-page-up ()
"Scroll half a page up while keeping cursor in middle of page."
(interactive)
Expand Down Expand Up @@ -340,7 +340,7 @@ Example: (evil-map visual \"<\" \"<gv\")"
"n<" 'spacemacs/scroll-transient-state/spacemacs/scroll-half-page-up
"n>" 'spacemacs/scroll-transient-state/spacemacs/scroll-half-page-down)

;; pasting micro-state
;; pasting transient-state
(spacemacs|define-transient-state paste
:title "Pasting Transient State"
:doc "\n[%s(length kill-ring-yank-pointer)/%s(length kill-ring)] \
Expand All @@ -351,7 +351,7 @@ below. Anything else exits."
("K" evil-paste-pop-next)
("p" evil-paste-after)
("P" evil-paste-before))
(when dotspacemacs-enable-paste-micro-state
(when dotspacemacs-enable-paste-transient-state
(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))

Expand Down Expand Up @@ -554,7 +554,7 @@ below. Anything else exits."
"Setup the minibuffer."
;; Since ido is implemented in a while loop where each
;; iteration setup a whole new minibuffer, we have to keep
;; track of any activated ido navigation micro-state and force
;; track of any activated ido navigation transient-state and force
;; the reactivation at each iteration.
(when spacemacs--ido-navigation-ms-enabled
(spacemacs/ido-navigation-micro-state)))
Expand All @@ -564,7 +564,7 @@ below. Anything else exits."
(when spacemacs--ido-navigation-ms-face-cookie-minibuffer
(face-remap-remove-relative
spacemacs--ido-navigation-ms-face-cookie-minibuffer))
;; be sure to wipe any previous micro-state flag
;; be sure to wipe any previous transient-state flag
(setq spacemacs--ido-navigation-ms-enabled nil)
;; overwrite the key bindings for ido vertical mode only
(define-key ido-completion-map (kbd "C-<return>") 'ido-select-text)
Expand Down Expand Up @@ -594,7 +594,7 @@ below. Anything else exits."
(define-key ido-completion-map (kbd "<down>") 'ido-next-match)
(define-key ido-completion-map (kbd "<left>") 'ido-delete-backward-updir)
(define-key ido-completion-map (kbd "<right>") 'ido-exit-minibuffer)
;; initiate micro-state
;; initiate transient-state
(define-key ido-completion-map (kbd "M-SPC") 'spacemacs/ido-navigation-micro-state)
(define-key ido-completion-map (kbd "s-M-SPC") 'spacemacs/ido-navigation-micro-state)
)
Expand Down Expand Up @@ -647,7 +647,7 @@ below. Anything else exits."
result))

(defvar spacemacs--ido-navigation-ms-enabled nil
"Flag which is non nil when ido navigation micro-state is enabled.")
"Flag which is non nil when ido navigation transient-state is enabled.")

(defvar spacemacs--ido-navigation-ms-face-cookie-minibuffer nil
"Cookie pointing to the local face remapping.")
Expand All @@ -656,28 +656,28 @@ below. Anything else exits."
`((t :background ,(face-attribute 'error :foreground)
:foreground "black"
:weight bold))
"Face for ido minibuffer prompt when ido micro-state is activated."
"Face for ido minibuffer prompt when ido transient-state is activated."
:group 'spacemacs)

(defun spacemacs//ido-navigation-ms-set-face ()
"Set faces for ido navigation micro-state."
"Set faces for ido navigation transient-state."
(setq spacemacs--ido-navigation-ms-face-cookie-minibuffer
(face-remap-add-relative
'minibuffer-prompt
'spacemacs-ido-navigation-ms-face)))

(defun spacemacs//ido-navigation-ms-on-enter ()
"Initialization of ido micro-state."
"Initialization of ido transient-state."
(setq spacemacs--ido-navigation-ms-enabled t)
(spacemacs//ido-navigation-ms-set-face))

(defun spacemacs//ido-navigation-ms-on-exit ()
"Action to perform when exiting ido micro-state."
"Action to perform when exiting ido transient-state."
(face-remap-remove-relative
spacemacs--ido-navigation-ms-face-cookie-minibuffer))

(defun spacemacs//ido-navigation-ms-full-doc ()
"Full documentation for ido navigation micro-state."
"Full documentation for ido navigation transient-state."
"
[?] display this help
[e] enter dired
Expand Down
2 changes: 1 addition & 1 deletion layers/+distribution/spacemacs/packages-backup.el
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
"sh" 'spacemacs/symbol-highlight
"sH" 'spacemacs/goto-last-searched-ahs-symbol)

;; micro-state to easily jump from a highlighted symbol to the others
;; transient-state to easily jump from a highlighted symbol to the others
(dolist (sym '(ahs-forward
ahs-forward-definition
ahs-backward
Expand Down
4 changes: 2 additions & 2 deletions layers/+lang/agda/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ All Agda specific bindings are prefixed with the major-mode leader
| ~SPC m ,~ | Shows the type of the goal at point and the currect context. |
| ~SPC m .~ | Shows the context, the goal and the given expression's inferred type. |
| ~SPC m a~ | Simple proof search. |
| ~SPC m b~ | Go to the previous goal, if any and activate goal-navigation micro-state. |
| ~SPC m b~ | Go to the previous goal, if any and activate goal-navigation transient-state. |
| ~SPC m c~ | Refine the pattern variables given in the goal. |
| ~SPC m d~ | Infers the type of the given expression. |
| ~SPC m e~ | Show the context of the goal at point. |
| ~SPC m f~ | Go to the next goal, if any and activate goal-navigation micro-state. |
| ~SPC m f~ | Go to the next goal, if any and activate goal-navigation transient-state. |
| ~SPC m h~ | Compute the type of a hypothetical helper function. |
| ~SPC m l~ | Load current buffer. |
| ~SPC m n~ | Computes the normal form of the given expression, using the scope of the current goal or, if point is not in a goal, the top-level scope. |
Expand Down
2 changes: 1 addition & 1 deletion layers/+lang/emacs-lisp/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ As this state works the same for all files, the documentation is in global
| ~SPC m ,~ | toggle =lisp state= |
| ~SPC m t b~ | run tests of current buffer |
| ~SPC m t q~ | run =ert= |
| ~SPC m d m~ | open [[https://github.com/joddie/macrostep][macrostep]] micro-state |
| ~SPC m d m~ | open [[https://github.com/joddie/macrostep][macrostep]] transient-state |

** srefactor
The [[file:../../semantic/README.org][semantic]] layer should be installed for these key bindings to become active.
Expand Down
Loading

0 comments on commit 2b1ed60

Please sign in to comment.