Chapter 26. What tools provide what functions?

Procedure 26.1.  Font highlighting (a.k.a. font lock)
  1. python-mode

    works automatically when in python-mode

  2. python-ts-mode

    No difference apparent vs python-mode (over my body)

Procedure 26.2.  Sort Imports
  1. treesitter

    In Emacs, with python file open (but cursor anywhere), type C-c TAB s

    Prerequisite

    Requires python isort package. poetry add --group=dev isort

    This works, but the exact details conflict with ruff's linter and produce an I1001 error.

  2. ruff

    At the command line: ruff check filename --fix

Procedure 26.3.  Rename symbols
Procedure 26.4.  Automatically load
  1. treesitter

    To use treesitter, first change to the -ts- version of the current mode. For example, python-ts-mode instead of python-mode. To make this automatic TK.

    If needed, install the grammar for that mode via M-x treesit-install-language-grammar and then following the prompts to let it download and compile and install the grammar.

  2. lsp

    ?

Procedure 26.5.  Insert templates
Procedure 26.6.  Code folding
Procedure 26.7.  rough notes


            Raw notes

Completion Front-ends
helm
ivy
default




linting from flycheck (UI) + ruff




Installing tree-sitter python
up-----------------------------
(from 2024-11 Habamax https://gist.github.com/habamax/290cda0e0cdc6118eb9a06121b9bc0d7)

Make sure you have installed python treesitter grammar

    Windows: download libtree-sitter-python.dll from https://corwin.bru.st/emacs-tree-sitter/ into ~/.emacs.d/tree-sitter/
    GNU/Linux: run M-x treesit-install-language-grammar RET type python RET and do a couple of additional y for default options. You will need to have git and C/Cpp compiler available as it would download repo and build grammar library.

verify:
M-x ielm
(treesit-language-available-p 'python)
should return t

verify:
Open python file and do M-x python-ts-mode RET to activate treesitter python mode.

set treesit-font-lock-level to 4


Install ruff
------------
poetry add --group=dev ruff

poetry add --group=dev flycheck



Commands
--------







Things I want to do


* rename symbols
  - 

* replace tabs with spaces and switch to two spaces
* figure out what lens mode does