Update python for emacs29.
This commit is contained in:
		
							parent
							
								
									1bed94b1b1
								
							
						
					
					
						commit
						cd02a14792
					
				| @ -8,7 +8,7 @@ | ||||
| 
 | ||||
| (require 'util-vertico) | ||||
| 
 | ||||
| ;; (require 'lang-python) | ||||
| (require 'lang-python) | ||||
| 
 | ||||
| ;; (require 'lang-javascript) | ||||
| 
 | ||||
|  | ||||
| @ -52,11 +52,11 @@ | ||||
|   ) | ||||
| 
 | ||||
| (use-package python | ||||
|   :mode ("\\.py\\'" . python-mode) | ||||
|   :commands python-mode | ||||
|   :mode ("\\.py\\'" . python-ts-mode) | ||||
|   :commands (python-mode python-ts-mode) | ||||
|   :pin manual | ||||
|   :hook ( | ||||
|          (python-mode . (lambda () | ||||
|          (python-ts-mode . (lambda () | ||||
|                           (when (executable-find "poetry") | ||||
|                             (add-poetry-venv-to-path) | ||||
|                             (let ((venv (locate-venv-poetry))) (when venv | ||||
| @ -64,14 +64,19 @@ | ||||
|                                                                        (list (cons ':python (list ':venvPath venv ':pythonPath (concat venv "/bin/python"))))) | ||||
|                                                                  )) | ||||
|                             ) | ||||
|                           (eglot-ensure) | ||||
|                           (when-linux | ||||
|                             (eglot-ensure) | ||||
|                             ) | ||||
| 
 | ||||
|                           (add-hook 'before-save-hook 'python-fmt nil 'local) | ||||
|                           (tree-sitter-hl-mode +1) | ||||
|                           )) | ||||
|          ) | ||||
|   :bind ((:map python-mode-map ([backspace] . python-backspace)) | ||||
|   :bind ((:map python-ts-mode-map ([backspace] . python-backspace)) | ||||
|          ) | ||||
|   :init | ||||
|   (add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode)) | ||||
|   (add-to-list 'treesit-language-source-alist '(python "https://github.com/tree-sitter/tree-sitter-python")) | ||||
|   (unless (treesit-ready-p 'python) (treesit-install-language-grammar 'python)) | ||||
|   ) | ||||
| 
 | ||||
| (provide 'lang-python) | ||||
|  | ||||
| @ -35,9 +35,6 @@ | ||||
|                             (add-to-list 'eglot-server-programs (cons 'rust-ts-mode (list rust-analyzer-command))) | ||||
|                             ) | ||||
|                           ) | ||||
|                         (when-linux | ||||
|                           (tree-sitter-hl-mode +1) | ||||
|                           ) | ||||
|                         (add-hook 'before-save-hook 'eglot-format-buffer nil 'local) | ||||
|                         )) | ||||
|          ) | ||||
|  | ||||
| @ -3,4 +3,5 @@ | ||||
|     name: | ||||
|       - aspell-en | ||||
|       - prettier # typescript+yaml formatting | ||||
|       - pyright | ||||
|     state: present | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander