Skip to content

Commit

Permalink
Merge pull request #1639 from sammdot/rename-retro
Browse files Browse the repository at this point in the history
Rename 'retrospective' macros to simply 'retro'
  • Loading branch information
sammdot committed Oct 19, 2023
2 parents ef93165 + d712d8d commit 232edd8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
3 changes: 1 addition & 2 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import url(https://fonts.googleapis.com/css?family=Patua+One);
@import url(https://fonts.googleapis.com/css?family=JetBrains+Mono);
@import url(https://fonts.googleapis.com/css2?family=Patua+One&family=JetBrains+Mono:wght@400;700&display=swap);

h1,
h2,
Expand Down
27 changes: 15 additions & 12 deletions doc/translation_language.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,23 @@ Glues the text.
The operators below add or remove spaces between your last stroke and the one
before that.

The names of the operators should say "retroactive", but have remained
"retrospective" for backward compatibility.

:::{plover:operator} {\*?}; =retrospective_insert_space
:::{plover:operator} {*?}; =retro_insert_space; =retrospective_insert_space
Adds a space between the last two strokes. For example, if your dictionary
contained `PER` for 'perfect', `SWAEUGS` for 'situation' and `PER/SWAEUGS` for
'persuasion', you can force Plover to output 'perfect situation' by writing
`{*?}`.

The name `=retrospective_insert_space` is _deprecated_; prefer `=retro_insert_space` instead.

_Suggested outline_: `AFPS` ("**A**dd **SP**a**C**e")
:::

:::{plover:operator} {\*!}; =retrospective_delete_space
:::{plover:operator} {*!}; =retro_delete_space; =retrospective_delete_space
Delete the space between the last two strokes. For example, if you wrote
'basket ball', you could force them together into 'basketball' by writing `{*!}`.

The name `=retrospective_delete_space` is _deprecated_; prefer `=retro_delete_space` instead.

_Suggested outline_: `TK-FPS` ("**D**elete **SP**a**C**e")
:::

Expand Down Expand Up @@ -153,7 +154,7 @@ _Default outline_: `KPA*`
:::
::::

:::{plover:operator} {\*-|}; {:retro_case:cap_first_word}
:::{plover:operator} {*-|}; {:retro_case:cap_first_word}
Capitalizes the first letter of the previous word. This is useful in case you
realize that a word should be capitalized after you've written it. For example,
`cat` + `{*-|}{^ville}` = `Catville`.
Expand All @@ -167,7 +168,7 @@ Forces the next letter to be lowercase, for example `{>}Plover` = `plover`.
_Suggested outline_: `HRO*ER` ("lower")
:::

:::{plover:operator} {\*>}; {:retro_case:lower_first_char}
:::{plover:operator} {*>}; {:retro_case:lower_first_char}
Rewrites the previous word to start with a lowercase letter, for example
`Plover{*>}` = `plover`.

Expand All @@ -180,7 +181,7 @@ Outputs the next word in all capital letters, for example `{<}cat` = `CAT`.
_Suggested outline_: `KPA*L` ("cap all")
:::

:::{plover:operator} {\*<}; {:retro_case:upper_first_word}
:::{plover:operator} {*<}; {:retro_case:upper_first_word}
Rewrites the previous word in all capital letters, for example `cat{*<}` = `CAT`.

_Suggested outline_: `*UPD`
Expand Down Expand Up @@ -281,7 +282,7 @@ Plover has an operator to format the last written number as a currency amount.
The amount is written with either no decimal places or two, and commas are
added every 3 digits.

:::{plover:operator} {\*([prefix]c[suffix])}; {:retro_currency:[prefix]c[suffix]}
:::{plover:operator} {*([prefix]c[suffix])}; {:retro_currency:[prefix]c[suffix]}
Retroactively converts the previously written number into a currency amount.
The number takes the place of the `c` in the format specification.

Expand Down Expand Up @@ -377,17 +378,19 @@ Undoes the last stroke.
_Default outline_: `*`
:::

:::{plover:operator} {\*+}; =repeat_last_stroke
:::{plover:operator} {*+}; =repeat_last_stroke
Sends the last stroke entered. For example, `KAT{*+}{*+}` translates to
`cat cat cat`. Especially useful for repeated keys, such as navigating around
a document.

_Suggested outline_: `#`
:::

:::{plover:operator} {\*}; =toggle_asterisk
:::{plover:operator} {*}; =retro_toggle_asterisk; =retrospective_toggle_asterisk
Toggles the asterisk key on the last stroke entered. For example, `KAT{*}` will
translate as if you wrote `KA*T`.
translate as if you wrote `KA*T`, and `KA*T{*}` will translate as if you wrote `KAT`.

The name `=retrospective_toggle_asterisk` is _deprecated_; prefer `=retro_toggle_asterisk` instead.

_Suggested outline_: `#*`
:::
Expand Down
1 change: 1 addition & 0 deletions news.d/api/1639.new.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Renamed the `=retrospective_*` macros to simply `=retro_*`. The previous names are retained for backwards compatibility, but are now deprecated.
File renamed without changes.
6 changes: 3 additions & 3 deletions plover/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def unescape_translation(translation):


_LEGACY_MACROS_ALIASES = {
'{*}': 'retrospective_toggle_asterisk',
'{*!}': 'retrospective_delete_space',
'{*?}': 'retrospective_insert_space',
'{*}': 'retro_toggle_asterisk',
'{*!}': 'retro_delete_space',
'{*?}': 'retro_insert_space',
'{*+}': 'repeat_last_stroke',
}

Expand Down
9 changes: 6 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ plover.machine =
TX Bolt = plover.machine.txbolt:TxBolt
plover.macro =
repeat_last_stroke = plover.macro.repeat:last_stroke
retrospective_delete_space = plover.macro.retrospective:delete_space
retrospective_insert_space = plover.macro.retrospective:insert_space
retrospective_toggle_asterisk = plover.macro.retrospective:toggle_asterisk
retro_delete_space = plover.macro.retro:delete_space
retro_insert_space = plover.macro.retro:insert_space
retro_toggle_asterisk = plover.macro.retro:toggle_asterisk
retrospective_delete_space = plover.macro.retro:delete_space
retrospective_insert_space = plover.macro.retro:insert_space
retrospective_toggle_asterisk = plover.macro.retro:toggle_asterisk
undo = plover.macro.undo:undo
plover.meta =
attach = plover.meta.attach:meta_attach
Expand Down

0 comments on commit 232edd8

Please sign in to comment.