aboutsummaryrefslogtreecommitdiff
path: root/modules/prog-python.el
Commit message (Collapse)AuthorAgeFilesLines
* docs(load-graph): classify programming modulesCraig Jennings12 days1-0/+11
| | | | | | Sixth classification batch: prog-general plus the language modules — prog-c, prog-go, prog-lisp, prog-python, prog-webdev, prog-json, prog-yaml, prog-shell, prog-training. I annotated each header, added a Batch 6 table to the inventory, and extended the validation allowlist. 52 of 102 modules are now classified. prog-general owns the shared defaults and tree-sitter/LSP policy and stays eager. The language modules are eager only by init order and should load by major mode, so they're tagged Phase 6 deferral candidates. prog-shell's after-save executable hook is the one side effect worth scoping. No new hidden dependencies.
* refactor(prog): six programming-track hygiene fixes from re-reviewCraig Jennings2026-05-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - prog-lsp.el: rename `cj/lsp--remove-eldoc-provider' → `cj/lsp--remove-eldoc-provider-global' and call it once from the lsp-mode `:config' block instead of attaching it per-buffer via `lsp-managed-mode-hook'. The previous per-buffer remove with the buffer-local flag raced lsp-mode's own population of the local hook; removing the provider from the global default before any LSP buffer attaches makes the absence stick. Two existing tests updated to the new contract (remove-from-default + idempotent re-run). - prog-webdev.el / prog-python.el: warn at load time when `prettier' or `pyright' is missing on PATH via `cj/executable-find-or-warn'. Both modules now `(require 'system-lib)' to expose the helper. Missing dependencies surface up front instead of mid-edit at first format/LSP attach. - keyboard-compat.el: document existing idempotence. The hook install uses a named function so `add-hook' deduplicates, and the hook body only calls `define-key' (latest binding wins, same value) -- adding a comment so future readers don't re-question. - dev-fkeys.el: add a `typescript' clause to `cj/--f6-test-runner-cmd-for'. F6 now runs `npx --no-install vitest <path>' when vitest is on PATH, otherwise `npx --no-install jest <path>'. Updates the matching test from "returns nil" to cover both code paths; the impl-level test now asserts the routed command instead of expecting a user-error. - flycheck-config.el: build the LanguageTool wrapper path with `(expand-file-name "scripts/languagetool-flycheck" user-emacs-directory)' instead of a hardcoded `~/.emacs.d/...'. Survives a non-standard `user-emacs-directory'. - latex-config.el: replace the hardcoded Zathura viewer with `cj/--latex-select-pdf-viewer', which walks `cj/--latex-pdf-viewer-candidates' (zathura → evince → okular → SumatraPDF → xdg-open) and falls back to "PDF Tools" when nothing is on PATH. Each entry maps an executable to the matching TeX-view-program-list name so AUCTeX's defaults handle the actual viewer invocation.
* fix(prog-python): toggle electric-pair-local-mode in the setup hookCraig Jennings2026-05-121-1/+1
| | | | `cj/python-setup` called `(electric-pair-mode t)`, which flips the global minor mode every time a Python buffer opens. I switched it to `electric-pair-local-mode` so the pairing stays scoped to Python buffers, like the other buffer-local settings in the hook.
* refactor(prog-python): extract the mypy and pdb command buildersCraig Jennings2026-05-121-3/+10
| | | | I pulled the command-string construction out of `cj/python-mypy` and `cj/python-debug` into `cj/--python-mypy-command` and `cj/--python-debug-command`. The wrappers stay thin — resolve the target, hand off to `compile` or `pdb`. With the command shape in a pure helper I can unit-test it directly instead of stubbing `compile` and `pdb`.
* feat(dev-fkeys): add project-aware F4 compile/run dispatcherCraig Jennings2026-05-031-1/+0
| | | | | | | | | | | | | | | | | | | I added a new module `modules/dev-fkeys.el` that owns the dev F-key block. F4 prompts via `completing-read` with a candidate set filtered by project type (compiled / interpreted / unknown). C-F4 is the compile-only fast path. M-F4 is clean + rebuild. It runs a heuristic clean command derived from the project markers (go.mod, Cargo.toml, Eask, Makefile, CMakeLists.txt) and chains `projectile-compile-project` on success. S-F4 stays on `recompile` and now lives globally instead of duplicated across prog-general.el and prog-c.el. F6 is bound globally to `projectile-test-project` as a Phase 1 stopgap. Phase 2 replaces it with the polyglot test runner spec'd in todo.org. Project-type detection runs against the projectile root and falls back to `unknown` when no marker matches. Interpreted markers are checked first so a Python or Node project with a Makefile for tasks classifies as interpreted instead of compiled. Compile + Run sequencing uses a one-shot `compilation-finish-functions` hook that self-removes on first invocation and only fires the follow-up when the status string starts with `finished`. Cleanup in the same commit: - Dropped F4/F5/F6 from `prog-general.el`'s prog-mode-hook. They are now global. - Dropped F6→format bindings from prog-c.el / prog-python.el / prog-shell.el. C-; f was already bound in each, so this is pure removal. - Dropped the duplicate S-F4 from prog-c.el. The global binding covers it. - Updated the keybinding header in prog-general.el and the workflow comments in prog-c.el / prog-shell.el. - Wired `(require 'dev-fkeys)` in init.el alongside coverage-core. TDD: 73 tests across 11 files, one per helper. Production code is split into small testable internals (`cj/--detect-project-type`, `cj/--f4-candidates`, `cj/--f4-derive-clean-cmd`, `cj/--f4-make-once-hook`, `cj/--f4-dispatch`, `cj/--f4-compile-and-run-impl`, `cj/--f4-clean-rebuild-impl`, `cj/--f4-project-root`) plus three thin interactive wrappers. Smoke tests confirm bindings register on load. Known limitation: if another `compilation-finish-functions` hook fires between my add-hook and the compile finishing, the chain can fire on the wrong compile. The hook self-removes on first invocation regardless of which compile it sees. Documented in the impl docstring. Acceptable for v1. Phase 2 will replace F6 with the polyglot test runner (tree-sitter queries for Python/Go/TS, sexp scan for Elisp, buffer-local last-test memory).
* session: switch Python LSP to pyright, add Django web-mode configCraig Jennings2026-03-041-30/+14
| | | | | | Replaced pylsp with lsp-pyright in prog-python.el for better type inference, especially for Django ORM. Added Django engine and indent settings to web-mode in prog-webdev.el. Pyright already installed via pacman.
* feat:programming: Enhance language-specific keybindings and setupCraig Jennings2025-10-201-2/+36
| | | | | | | | | Add language-specific keybindings and configurations for C, Go, Python, and shell scripting panels. Introduce system utility function declarations and improve keybinding consistency across languages. Implement keybindings for debug, format, and static analysis tools tailored to each programming language, enhancing the developer experience and workflow efficiency.
* feat:python: Enhance Python LSP setup with plugins and configCraig Jennings2025-10-201-5/+60
| | | | | | | | Add detailed configuration for LSP in the Python programming environment. Include forward declarations for LSP and external packages, and enable LSP with pylsp server if available. Set up pylsp plugin preferences and update relevant settings in python-mode initialization.
* refactor: prog-python: Remove hs-minor-mode from python setupCraig Jennings2025-10-201-1/+0
| | | | | Remove hs-minor-mode as it is no longer needed for code folding in Python setup.
* refactor: prog/python: Remove defers and update symbolsCraig Jennings2025-10-201-11/+13
| | | | | | | - Remove deferred loading from various use-package declarations to streamline. - Replace deprecated `define-key` with `keymap-set` in `dired-mode-map`. - Update Python configuration to prefer `python-ts-mode` over `python-mode` and ensure associated modes and hooks work with `python-ts-mode`. - Clean up deprecated `auto-mode-alist` usage to reflect the transition to Tree-sitter based major modes.
* changing repositoriesCraig Jennings2025-10-121-0/+81