cacamacs 0.0.4__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cacamacs/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """cacamacs — a small terminal text editor. See `ccm --help`."""
cacamacs/__main__.py ADDED
@@ -0,0 +1,40 @@
1
+ """Entry point for the `cacamacs` and `ccm` console scripts."""
2
+ import os
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ _BUNDLE = Path(__file__).resolve().parent / "_bundle"
7
+
8
+
9
+ def _layout():
10
+ """(executable, extensions_dir) — the Windows bundle is flat, the others are
11
+ bin/ + lib/ + share/."""
12
+ win = _BUNDLE / "ccm.exe"
13
+ if win.exists():
14
+ return win, _BUNDLE / "extensions"
15
+ return _BUNDLE / "bin" / "ccm", _BUNDLE / "share" / "ccm" / "extensions"
16
+
17
+
18
+ def main() -> int:
19
+ exe, extensions = _layout()
20
+ if not exe.exists():
21
+ sys.exit(f"ccm: bundled binary is missing from {_BUNDLE} "
22
+ f"(broken install — try reinstalling)")
23
+
24
+ env = dict(os.environ)
25
+ # setdefault, not assignment: an explicit CCM_BUILTIN_EXTENSIONS is how a
26
+ # user points ccm at their own grammars, and it must still win.
27
+ if extensions.is_dir():
28
+ env.setdefault("CCM_BUILTIN_EXTENSIONS", str(extensions))
29
+
30
+ argv = [str(exe), *sys.argv[1:]]
31
+ if os.name == "nt":
32
+ # execve on Windows returns control to the shell immediately, which
33
+ # would hand a live TUI a prompt it is fighting for; spawn and wait.
34
+ import subprocess
35
+ return subprocess.run(argv, env=env).returncode
36
+ os.execve(exe, argv, env) # no return
37
+
38
+
39
+ if __name__ == "__main__":
40
+ sys.exit(main())
@@ -0,0 +1,30 @@
1
+ # cacamacs colour theme — copy to ~/.ccm/theme
2
+ #
3
+ # Syntax: key = colour (everything after a " #" is a comment)
4
+ #
5
+ # Colours may be names (the 16 below), HTML hex (#rrggbb / #rgb), or rgb(r,g,b).
6
+ # cacamacs renders the editor itself in up to 4096 colours (its presenter bypasses
7
+ # libcaca's 16-colour output), so "background = #301934" is a real dark purple.
8
+ # On a plain 16-colour terminal each colour falls back to the nearest of 16.
9
+ #
10
+ # names: run ./demo.sh colors colour range: run ./demo.sh truecolor
11
+ #
12
+ # Names: black red green yellow brown blue magenta(=purple) cyan white
13
+ # gray/lightgray darkgray(=brightblack)
14
+ # lightred lightgreen lightblue lightcyan lightmagenta brightyellow
15
+ # (light* also spell as bright*)
16
+
17
+ # editor surface (hex -> real colours via the presenter)
18
+ background = #1e1a2e # a dark purple
19
+ foreground = #d0d0e0
20
+ current_line = #2a2440 # highlight on the caret's line
21
+ selection_fg = black
22
+ selection_bg = #4a4a80
23
+
24
+ # code colourization (syntax styles)
25
+ comment = #6a7a6a
26
+ string = #98c878
27
+ number = #80d0d0
28
+ keyword = #c890f0
29
+ bracket = #e0e0a0
30
+ operator = #b0b0c0
Binary file
@@ -0,0 +1,27 @@
1
+ {
2
+ // A standard VSCode language-configuration.json. cacamacs reads the parts it
3
+ // can colourize from: comment delimiters, brackets and auto-closing quotes.
4
+ "comments": {
5
+ "lineComment": "//",
6
+ "blockComment": ["/*", "*/"]
7
+ },
8
+ "brackets": [
9
+ ["{", "}"],
10
+ ["[", "]"],
11
+ ["(", ")"]
12
+ ],
13
+ "autoClosingPairs": [
14
+ { "open": "{", "close": "}" },
15
+ { "open": "[", "close": "]" },
16
+ { "open": "(", "close": ")" },
17
+ { "open": "\"", "close": "\"", "notIn": ["string"] },
18
+ { "open": "'", "close": "'", "notIn": ["string", "comment"] }
19
+ ],
20
+ "surroundingPairs": [
21
+ ["{", "}"],
22
+ ["[", "]"],
23
+ ["(", ")"],
24
+ ["\"", "\""],
25
+ ["'", "'"]
26
+ ]
27
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "c-lang",
3
+ "displayName": "C/C++ Language Basics",
4
+ "version": "0.0.1",
5
+ "engines": { "cacamacs": "*" },
6
+ "contributes": {
7
+ "languages": [
8
+ {
9
+ "id": "c",
10
+ "aliases": ["C"],
11
+ "extensions": [".c", ".h"],
12
+ "configuration": "./language-configuration.json"
13
+ },
14
+ {
15
+ "id": "cpp",
16
+ "aliases": ["C++", "Cpp"],
17
+ "extensions": [".cpp", ".cc", ".hpp"],
18
+ "configuration": "./language-configuration.json"
19
+ }
20
+ ],
21
+ "grammars": [
22
+ {
23
+ "language": "c",
24
+ "scopeName": "source.c",
25
+ "path": "./syntaxes/c.tmLanguage.json"
26
+ }
27
+ ]
28
+ }
29
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "scopeName": "source.c",
3
+ "name": "C",
4
+ "patterns": [
5
+ { "include": "#comments" },
6
+ { "include": "#keywords" },
7
+ { "include": "#types" },
8
+ { "include": "#strings" },
9
+ { "include": "#numbers" },
10
+ { "include": "#preprocessor" }
11
+ ],
12
+ "repository": {
13
+ "comments": {
14
+ "patterns": [
15
+ { "name": "comment.line.double-slash.c", "match": "//.*$" },
16
+ { "name": "comment.block.c", "begin": "/\\*", "end": "\\*/" }
17
+ ]
18
+ },
19
+ "keywords": {
20
+ "name": "keyword.control.c",
21
+ "match": "\\b(if|else|for|while|do|switch|case|default|break|continue|return|goto|sizeof|typedef|struct|union|enum)\\b"
22
+ },
23
+ "types": {
24
+ "name": "storage.type.c",
25
+ "match": "\\b(void|char|short|int|long|float|double|signed|unsigned|const|static|extern|register|volatile|inline|bool|size_t)\\b"
26
+ },
27
+ "strings": {
28
+ "patterns": [
29
+ { "name": "string.quoted.double.c", "begin": "\"", "end": "\"",
30
+ "patterns": [ { "name": "constant.character.escape.c", "match": "\\\\." } ] },
31
+ { "name": "string.quoted.single.c", "begin": "'", "end": "'",
32
+ "patterns": [ { "name": "constant.character.escape.c", "match": "\\\\." } ] }
33
+ ]
34
+ },
35
+ "numbers": {
36
+ "name": "constant.numeric.c",
37
+ "match": "\\b(0[xX][0-9a-fA-F]+|[0-9]+(\\.[0-9]+)?([eE][-+]?[0-9]+)?[fFuUlL]*)\\b"
38
+ },
39
+ "preprocessor": {
40
+ "name": "keyword.control.directive.c",
41
+ "match": "^\\s*#\\s*(include|define|undef|if|ifdef|ifndef|else|elif|endif|pragma|error)\\b"
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "comments": {
3
+ "lineComment": "#"
4
+ },
5
+ "brackets": [
6
+ ["{", "}"],
7
+ ["[", "]"],
8
+ ["(", ")"]
9
+ ],
10
+ "autoClosingPairs": [
11
+ { "open": "{", "close": "}" },
12
+ { "open": "[", "close": "]" },
13
+ { "open": "(", "close": ")" },
14
+ { "open": "\"", "close": "\"" },
15
+ { "open": "'", "close": "'" }
16
+ ],
17
+ "surroundingPairs": [
18
+ ["{", "}"],
19
+ ["[", "]"],
20
+ ["(", ")"],
21
+ ["\"", "\""],
22
+ ["'", "'"]
23
+ ]
24
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "python-lang",
3
+ "displayName": "Python Language Basics",
4
+ "version": "0.0.1",
5
+ "engines": { "cacamacs": "*" },
6
+ "contributes": {
7
+ "languages": [
8
+ {
9
+ "id": "python",
10
+ "aliases": ["Python", "py"],
11
+ "extensions": [".py", ".pyw"],
12
+ "configuration": "./language-configuration.json"
13
+ }
14
+ ],
15
+ "grammars": [
16
+ {
17
+ "language": "python",
18
+ "scopeName": "source.python",
19
+ "path": "./syntaxes/python.tmLanguage.json"
20
+ }
21
+ ]
22
+ }
23
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "scopeName": "source.python",
3
+ "name": "Python",
4
+ "patterns": [
5
+ { "include": "#comment" },
6
+ { "include": "#triple-string" },
7
+ { "include": "#string" },
8
+ { "include": "#keyword" },
9
+ { "include": "#builtin" },
10
+ { "include": "#decorator" },
11
+ { "include": "#number" }
12
+ ],
13
+ "repository": {
14
+ "comment": {
15
+ "name": "comment.line.number-sign.python",
16
+ "match": "#.*$"
17
+ },
18
+ "triple-string": {
19
+ "patterns": [
20
+ { "name": "string.quoted.triple.double.python", "begin": "\"\"\"", "end": "\"\"\"" },
21
+ { "name": "string.quoted.triple.single.python", "begin": "'''", "end": "'''" }
22
+ ]
23
+ },
24
+ "string": {
25
+ "patterns": [
26
+ { "name": "string.quoted.double.python", "begin": "\"", "end": "\"",
27
+ "patterns": [ { "name": "constant.character.escape.python", "match": "\\\\." } ] },
28
+ { "name": "string.quoted.single.python", "begin": "'", "end": "'",
29
+ "patterns": [ { "name": "constant.character.escape.python", "match": "\\\\." } ] }
30
+ ]
31
+ },
32
+ "keyword": {
33
+ "name": "keyword.control.python",
34
+ "match": "\\b(and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b"
35
+ },
36
+ "builtin": {
37
+ "name": "constant.language.python",
38
+ "match": "\\b(True|False|None|self|cls|__init__|print|len|range|str|int|float|list|dict|set|tuple)\\b"
39
+ },
40
+ "decorator": {
41
+ "name": "entity.name.function.decorator.python",
42
+ "match": "^\\s*@[A-Za-z_][A-Za-z0-9_.]*"
43
+ },
44
+ "number": {
45
+ "name": "constant.numeric.python",
46
+ "match": "\\b(0[xX][0-9a-fA-F]+|[0-9]+\\.?[0-9]*)\\b"
47
+ }
48
+ }
49
+ }
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.1
2
+ Name: cacamacs
3
+ Version: 0.0.4
4
+ Summary: cacamacs — a small terminal text editor with Emacs key bindings
5
+ Home-page: https://github.com/stricaud/ccm
6
+ Classifier: Development Status :: 4 - Beta
7
+ Classifier: Environment :: Console :: Curses
8
+ Classifier: Programming Language :: C
9
+ Classifier: Topic :: Text Editors
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+
13
+ # ccm — cacamacs
14
+
15
+ A small terminal text editor with Emacs key bindings, built on the
16
+ [gtcaca](https://github.com/stricaud/gtcaca) libcaca TUI toolkit and its
17
+ `editor` widget. It shows off the widget's colourization, folding, annotations,
18
+ autocompletion, search/replace and a VSCode-style language-extension model.
19
+
20
+ ```sh
21
+ ccm [file | directory] [language-configuration.json]
22
+ ```
23
+
24
+ - A **file** opens in the editor.
25
+ - A **directory** opens the file browser (also `C-x d`).
26
+ - An optional explicit `language-configuration.json` forces that config.
27
+
28
+ See [docs/README-cacamacs.md](https://github.com/stricaud/ccm/blob/main/docs/README-cacamacs.md) for the full key-binding
29
+ reference and feature tour.
30
+
31
+ > **History.** ccm started life as `apps/cacamacs` inside the gtcaca repo, where
32
+ > a copy remains as a worked example of building an app on the toolkit. Active
33
+ > development now happens here, against gtcaca as an ordinary external
34
+ > dependency.
35
+
36
+ ## Install with pip
37
+
38
+ Prebuilt binaries are published to PyPI for macOS (Apple Silicon), Linux
39
+ (x86_64) and Windows (x86_64) — no compiler or Homebrew needed:
40
+
41
+ ```sh
42
+ pip install cacamacs
43
+ ccm # or: cacamacs
44
+ ```
45
+
46
+ PyPI is used purely as a binary channel (as `ruff`/`cmake`/`ninja` do): the
47
+ wheel carries the compiled `ccm` and the `libgtcaca`/`libcaca`/`oniguruma`
48
+ libraries it needs, made relocatable, plus the sample language extensions so
49
+ syntax highlighting works out of the box. See [packaging/](packaging/) for how
50
+ the per-platform wheels are built (`packaging/build.sh` → `packaging/wheel.py`,
51
+ wired up in `.github/workflows/release.yml`, which publishes on a `v*` tag).
52
+
53
+ ## Building
54
+
55
+ ccm consumes gtcaca like any third party would: install gtcaca first, then
56
+ build ccm against it. gtcaca ships a `gtcaca.pc`, so pkg-config finds it.
57
+
58
+ ```sh
59
+ # 1. install gtcaca (any one of these):
60
+ brew install stricaud/tap/gtcaca # Homebrew tap
61
+ # …or from a gtcaca checkout: cmake -S . -B build && cmake --build build && sudo cmake --install build
62
+
63
+ # 2. build ccm
64
+ cmake -S . -B build
65
+ cmake --build build
66
+
67
+ # 3. run it
68
+ ./run.sh # builds if needed, then runs build/ccm
69
+ ./run.sh path/to/file
70
+ ```
71
+
72
+ Requirements: a C compiler, CMake ≥ 3.20, pkg-config, and an installed
73
+ `gtcaca` (which pulls in `libcaca`).
74
+
75
+ ## Installing
76
+
77
+ ```sh
78
+ sudo cmake --install build # → /usr/local/bin/ccm, share/ccm/ccm-theme.example
79
+ ```
80
+
81
+ ### Self-contained macOS package
82
+
83
+ `scripts/package-macos.sh` builds a `.pkg` that bundles `libgtcaca` and
84
+ `libcaca` alongside `ccm` (rewritten to `@rpath`), so the installed editor needs
85
+ neither Homebrew nor a system gtcaca:
86
+
87
+ ```sh
88
+ scripts/package-macos.sh # → ccm-<version>.pkg
89
+ ```
90
+
91
+ Its postinstall seeds `~/.ccm/theme` from the bundled sample (never clobbering
92
+ an existing one).
93
+
94
+ ## Configuration
95
+
96
+ - **Colour theme** — copy [docs/ccm-theme.example](https://github.com/stricaud/ccm/blob/main/docs/ccm-theme.example) to
97
+ `~/.ccm/theme`. Comments in the file explain every key.
98
+ - **Editor config** — copy [examples/config.json](https://github.com/stricaud/ccm/blob/main/examples/config.json) to
99
+ `~/.cacamacs/config.json` for tab size, indent, per-language overrides.
100
+ - **Language extensions** — the VSCode-style grammar/config bundles under
101
+ [examples/extensions/](https://github.com/stricaud/ccm/blob/main/examples/extensions/) drive syntax colourization.
102
+
103
+ ## Layout
104
+
105
+ ```
106
+ src/ editor sources (cacamacs.c, ui.c, edit.c, search.c, …)
107
+ docs/ feature docs + the colour-theme sample
108
+ examples/ config sample and language extensions
109
+ scripts/ macOS packaging
110
+ CMakeLists.txt standalone build (finds gtcaca via pkg-config)
111
+ run.sh build-and-run helper
112
+ ```
@@ -0,0 +1,18 @@
1
+ cacamacs/__init__.py,sha256=7CWiRZfSVMdJGvSRTHCgzEg5aAA4V1Ne7WG6rQgWTF8,67
2
+ cacamacs/__main__.py,sha256=5cWBMkrlvS3X0H1Vb0lvZXaclRMXEoIcFBQ_mrOMdt0,1328
3
+ cacamacs/_bundle/ccm-theme.example,sha256=bl1Qf2WoGCxWlVp3ALPKGHrN9hI-z4o06wL7SVB9kQs,1179
4
+ cacamacs/_bundle/ccm.exe,sha256=1MhZqe80ThWRCEj0H5P7Xy1D1SmTqVujzF4ID0kETVs,324026
5
+ cacamacs/_bundle/extensions/c-lang-0.0.1/language-configuration.json,sha256=2okCTSDQ1o5Mg1xHp7Hxl8Nfz7jG8EbULZ4U5HRd65Y,704
6
+ cacamacs/_bundle/extensions/c-lang-0.0.1/package.json,sha256=2dLe0rMSFq7NmqhLtvbxmdbY4calqNM_D96taKxnS_I,676
7
+ cacamacs/_bundle/extensions/c-lang-0.0.1/syntaxes/c.tmLanguage.json,sha256=YpDGf87d_GjCxjJ5_wtaQRPy4NC544FdbgGYX1TaSOA,1582
8
+ cacamacs/_bundle/extensions/python-0.0.1/language-configuration.json,sha256=f_NwmLrhLeBwIgfVItjxX2ZBKb-Mii3-O4rIVH80peQ,454
9
+ cacamacs/_bundle/extensions/python-0.0.1/package.json,sha256=0Wo8o8Jg-LZr-O-hryL9zjRjFKH2mF8shYHotvjc8tI,533
10
+ cacamacs/_bundle/extensions/python-0.0.1/syntaxes/python.tmLanguage.json,sha256=sb8IvMo7XsxcxG6mT5PETZI1ay7Ut8P8mBYEFqln5QI,1783
11
+ cacamacs/_bundle/libcaca-0.dll,sha256=Sre2nhVrd6dndiN603BU3JVY8Y3CzUqcKkKHqIEQArI,859225
12
+ cacamacs/_bundle/libgtcaca.dll,sha256=rbXg7S3oaVhXVtZ3_lNKldk8tDn_eak2J7PIUnc4X1s,1326997
13
+ cacamacs/_bundle/libonig-5.dll,sha256=AU5BeKEkLUXJ2XNAdxDpnyVOpXfnMElIN2cHSlAm_k4,613839
14
+ cacamacs/_bundle/zlib1.dll,sha256=Ec2RFxdlzWXxwzYuPfZ-X1phimuIyM3siZuALq8cew0,127291
15
+ cacamacs-0.0.4.dist-info/METADATA,sha256=d2y8fB87Rv9VdAhwQQMBIWgk-Ben-Net9JjjBR5m57M,4094
16
+ cacamacs-0.0.4.dist-info/WHEEL,sha256=vYmcjJjApvQ91K9AH7yd4oij_XgNMLxLZeTDFBZ2jJA,105
17
+ cacamacs-0.0.4.dist-info/entry_points.txt,sha256=UKgsBc5ohdFbe8Ek0vlm6w0IRNQRTT-X6OOj4HqnQEs,81
18
+ cacamacs-0.0.4.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: cacamacs packaging/wheel.py
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-win_amd64
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ cacamacs = cacamacs.__main__:main
3
+ ccm = cacamacs.__main__:main