Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
nriley authored Oct 12, 2024
2 parents 068b386 + 02db7ce commit 4585cec
Show file tree
Hide file tree
Showing 90 changed files with 2,409 additions and 859 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ __pycache__
/settings
.vscode/settings.json
.DS_Store
.bak
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.0
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/Lucas-C/pre-commit-hooks
Expand Down
55 changes: 40 additions & 15 deletions BREAKING_CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
This file lists known changes to `community` that are likely to have broken existing
functionality. The file is sorted by date with the newest entries up the top.
This file lists known changes to `community` that are likely to have
broken existing functionality. The file is sorted by date with the
newest entries up the top.

Be aware there may be some difference between the date in this file and when the change was
applied given the delay between changes being submitted and the time they were reviewed
and merged.
Be aware there may be some difference between the date in this file
and when the change was applied given the delay between changes being
submitted and the time they were reviewed and merged.

---
* 2024-05-30 Deprecate 'drop down <user.number_small>' in favor of overridable 'choose' helper
* 2024-01-27 Deprecate '<user.number_string>' command without a spoken prefix like `numb`.
See `numbers.talon` and `numbers_unprefixed.talon.` If in the future you want to still use
unprefixed numbers, you will need to comment out the
`tag(): user.prefixed_numbers` line in your `settings.talon` file.
* 2023-06-06 Deprecate `go ` command for VSCode. Use 'bar marks' instead.
* 2024-09-07 Removed `get_list_from_csv` from `user_settings.py`. Please
use the new `track_csv_list` decorator, which leverages Talon's
`talon.watch` API for robustness on Talon launch.
* 2024-09-07 If you've updated `community` since 2024-08-31, you may
need to replace `host:` with `hostname:` in the header of
`core/system_paths-<hostname>.talon-list` due to an issue with
automatic conversion from CSV (#1268).
* 2024-07-31 Remove commands `"command mode"`, `"dictation mode"` from
custom user modes. Note that if you have any custom modes where you
want these commands you could add that mode to the context of
`command_and_dictation_mode.talon` or copying the command to one of
your custom files.
* 2024-07-30 Deprecate `lend` and `bend` commands in favor of `go line
end | tail` and `go line start | head`.
* 2024-07-28 Removed the following user namespace actions in favor of
the new action/modifier grammar.
https://github.com/talonhub/community/blob/37a8ebde90c8120a0b52555030988d4f54e65159/core/edit/edit.talon#L3
cut_word, copy_word, paste_word
cut_all, copy_all, paste_all, delete_all
copy_line, paste_line
cut_line_start, copy_line_start, paste_line_start, delete_line_start
cut_line_end, copy_line_end, paste_line_end, delete_line_end
* 2024-05-30 Deprecate 'drop down <user.number_small>' in favor of
overridable 'choose' helper
* 2024-01-27 Deprecate '<user.number_string>' command without a spoken
prefix like `numb`. See `numbers.talon` and
`numbers_unprefixed.talon.` If in the future you want to still use
unprefixed numbers, you will need to comment out the
`tag(): user.prefixed_numbers` line in your `settings.talon` file.
* 2023-06-06 Deprecate `go` command for VSCode. Use 'bar marks' instead.
* 2023-02-04 Deprecate `murder` command for i3wm. Use 'win kill' instead.
* 2022-12-11 Deprecate user.insert_with_history. Just use `user.add_phrase_to_history(text);
insert(text)` instead. See #939.
* 2022-10-01 Large refactoring of code base that moves many files into new locations. No
other backwards-incompatible changes included.
* 2022-12-11 Deprecate user.insert_with_history. Just use
`user.add_phrase_to_history(text); insert(text)` instead. See #939.
* 2022-10-01 Large refactoring of code base that moves many files into
new locations. No other backwards-incompatible changes included.
204 changes: 111 additions & 93 deletions README.md

Large diffs are not rendered by default.

13 changes: 4 additions & 9 deletions apps/emacs/emacs_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ def emacs_command_short_form(command_name: str) -> Optional[str]:
return emacs_commands.get(command_name, Command(command_name)).short


def load_csv():
filepath = Path(__file__).parents[0] / "emacs_commands.csv"
with resource.open(filepath) as f:
rows = list(csv.reader(f))
@resource.watch("emacs_commands.csv")
def load_commands(f):
rows = list(csv.reader(f))
# Check headers
assert rows[0] == ["Command", " Key binding", " Short form", " Spoken form"]

Expand All @@ -46,7 +45,7 @@ def load_csv():
continue
if len(row) > 4:
print(
f'"{filepath}": More than four values in row: {row}. '
f"emacs_commands.csv: More than four values in row: {row}. "
+ " Ignoring the extras"
)
name, keys, short, spoken = (
Expand All @@ -70,7 +69,3 @@ def load_csv():
if c.spoken:
command_list[c.spoken] = c.name
ctx.lists["self.emacs_command"] = command_list


# TODO: register on change to file!
app.register("ready", load_csv)
26 changes: 0 additions & 26 deletions apps/git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,6 @@
mod.list("git_command", desc="Git commands.")
mod.list("git_argument", desc="Command-line git options and arguments.")

dirpath = Path(__file__).parent
arguments_csv_path = str(dirpath / "git_arguments.csv")
commands_csv_path = str(dirpath / "git_commands.csv")


def make_list(path):
with resource.open(path, "r") as f:
rows = list(csv.reader(f))
mapping = {}
# ignore header row
for row in rows[1:]:
if len(row) == 0:
continue
if len(row) == 1:
row = row[0], row[0]
if len(row) > 2:
print("{path!r}: More than two values in row: {row}. Ignoring the extras.")
output, spoken_form = row[:2]
spoken_form = spoken_form.strip()
mapping[spoken_form] = output
return mapping


ctx.lists["self.git_argument"] = make_list(arguments_csv_path)
ctx.lists["self.git_command"] = make_list(commands_csv_path)


@mod.capture(rule="{user.git_argument}+")
def git_arguments(m) -> str:
Expand Down
69 changes: 69 additions & 0 deletions apps/git/git_argument.talon-list
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
list: user.git_argument
-
abort: --abort
all: --all
allow empty: --allow-empty
amend: --amend
cached: --cached
cashed: --cached
color words: --color-words
colour words: --color-words
continue: --continue
copy: --copy
create: --create
delete: --delete
detach: --detach
dir diff: --dir-diff
directory diff: --dir-diff
dry run: --dry-run
edit: --edit
fast forward only: --ff-only
force: --force
force create: --force-create
force with lease: --force-with-lease
global: --global
global: --global
hard: --hard
ignore case: --ignore-case
include untracked: --include-untracked
interactive: --interactive
keep index: --keep-index
list: --list
local: --local
mixed: --mixed
move: --move
no edit: --no-edit
no keep index: --no-keep-index
no rebase: --no-rebase
no track: --no-track
no verify: --no-verify
orphan: --orphan
patch: --patch
prune: --prune
quiet: --quiet
quit: --quit
rebase: --rebase
remote: --remote
set up stream: --set-upstream
set up stream to: --set-upstream-to
short: --short
short stat: --shortstat
skip: --skip
soft: --soft
staged: --staged
stat: --stat
system: --system
track: --track
update: --update
verbose: --verbose
branch: -b
combined: -c
deep: -d
very verbose: -vv
HEAD
main
master
origin
upstream
origin main: origin/main
origin master: origin/master
68 changes: 0 additions & 68 deletions apps/git/git_arguments.csv

This file was deleted.

31 changes: 16 additions & 15 deletions apps/git/git_commands.csv → apps/git/git_command.talon-list
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
Subcommand, Spoken form (optional)
list: user.git_command
-
add
archive
bisect
blame
branch
checkout
cherry-pick, cherry pick
cherry pick: cherry-pick
clean
clone
commit
config
diff
difftool, diff tool
diff tool: difftool
fetch
gc
grep
help
init, in it
in it: init
log
ls-files, ls files
ls files: ls-files
merge
mergetool, merge tool
mv, move
merge tool: mergetool
move: mv
pull
push
range-diff, range diff
range diff: range-diff
rebase
reflog,ref log
ref log: reflog
remote
remote add
remote remove
remote rename
remote set-url, remote set url
remote set-url, remote set you are el
remote set url: remote set-url
remote set you are el: remote set-url
remote show
rerere
rerere diff
rerere status
reset
restore
revert
rm, remove
shortlog,short log
remove: rm
short log: shortlog
show
sparse-checkout,sparse checkout
sparse checkout: sparse-checkout
stash
stash apply
stash list
Expand All @@ -54,7 +55,7 @@ stash save
status
submodule
submodule add
submodule init, submodule in it
submodule in it: submodule init
submodule status
submodule update
switch
Expand Down
19 changes: 19 additions & 0 deletions apps/talon/talon_repl/talon_repl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from talon import Context, Module

mod = Module()
mod.apps.talon_repl = r"""
win.title: /Talon - REPL/
win.title: /.talon\/bin\/repl/
"""

ctx = Context()
ctx.matches = r"""
app: talon_repl
not tag: user.code_language_forced
"""


@ctx.action_class("code")
class CodeActions:
def language():
return "python"
4 changes: 2 additions & 2 deletions apps/talon/talon_repl/talon_repl.talon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
win.title: /repl/
win.title: /Talon - REPL/
app: talon_repl
-
tag(): user.talon_python
tag(): user.readline

# uncomment user.talon_populate_lists tag to activate talon-specific lists of actions, scopes, modes etcetera.
# Do not enable this tag with dragon, as it will be unusable.
Expand Down
Loading

0 comments on commit 4585cec

Please sign in to comment.