Skip to content

Commit 1a64c8d

Browse files
committed
Tune up org-agenda and python stuf
1 parent d0bdeee commit 1a64c8d

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

init.el

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,8 +1302,11 @@ MobileOrg, the original `org-agenda-custom-commands' is restored."
13021302
;; Number of days to include in overview display.
13031303
(setq org-agenda-span 1)
13041304

1305+
;; Show agenda in the current window, keeping all other windows.
1306+
(setopt org-agenda-window-setup 'current-window)
1307+
13051308
;; Restore windows layout after quit agenda.
1306-
(setq org-agenda-restore-windows-after-quit t)
1309+
(setopt org-agenda-restore-windows-after-quit t)
13071310

13081311
(defun my-org-agenda-skip-non-stuck-projects ()
13091312
"Skip projects that are not stuck."
@@ -2795,35 +2798,32 @@ buffers to include `company-capf' (with optional yasnippet) and
27952798
;; warning to be harmless and unnecessary spam.
27962799
(setopt python-indent-guess-indent-offset-verbose nil)
27972800

2798-
(defun flycheck-configure-python-checkers ()
2799-
"Configure Python-specific Flycheck executables for the current buffer."
2800-
(let* ((exec-path (python-shell-calculate-exec-path)))
2801-
(setq-local flycheck-python-flake8-executable (executable-find "flake8"))
2802-
(setq-local flycheck-python-pylint-executable (executable-find "pylint"))
2803-
(setq-local flycheck-python-mypy-executable (executable-find "mypy"))))
2804-
2805-
(defun flycheck-apply-python-checkers-after-locals ()
2806-
"Apply Python-specific Flycheck configurations after local variables."
2807-
(add-hook 'hack-local-variables-hook
2808-
#'flycheck-configure-python-checkers nil t))
2809-
28102801
(defun flycheck-chain-lsp-python-checkers ()
28112802
"Chain Python-specific Flycheck checkers after the LSP checker."
2812-
(when (and (derived-mode-p 'python-mode)
2803+
(if (and (derived-mode-p 'python-mode)
28132804
flycheck-python-flake8-executable)
2814-
(flycheck-add-next-checker 'lsp 'python-flake8 t)))
2805+
(flycheck-add-next-checker 'lsp 'python-flake8 t)
2806+
(flycheck-remove-next-checker 'lsp 'python-flake8)))
28152807

28162808
(with-eval-after-load 'lsp-mode
28172809
(add-hook 'lsp-managed-mode-hook #'flycheck-chain-lsp-python-checkers))
28182810

28192811
(defun setup-python-environment ()
28202812
"Setup a Python development environment in the current buffer."
2813+
;; Compute the environment configuration for the project and
2814+
;; set the buffer-local values for `process-environment' and
2815+
;; `exec-path'.
2816+
(envrc--update)
2817+
2818+
;; Initialize Python-specific Flycheck checkers after local variables are set.
2819+
;; We can safely `executable-find' here, thank to `envrc--update'.
2820+
(setq-local flycheck-python-flake8-executable (executable-find "flake8"))
2821+
(setq-local flycheck-python-pylint-executable (executable-find "pylint"))
2822+
(setq-local flycheck-python-mypy-executable (executable-find "mypy"))
2823+
28212824
;; Enable YASnippet mode
28222825
(yas-minor-mode 1)
28232826

2824-
;; Turn on `flyspell-mode' for comments and strings.
2825-
(flyspell-prog-mode)
2826-
28272827
;; Setup active backends for `python-mode'.
28282828
(company-backend-for-hook 'lsp-completion-mode-hook
28292829
'((company-capf :with company-yasnippet)
@@ -2851,7 +2851,7 @@ buffers to include `company-capf' (with optional yasnippet) and
28512851

28522852
;; Configure hooks after `python-mode' is loaded.
28532853
(add-hook 'python-mode-hook #'setup-python-environment)
2854-
(add-hook 'python-mode-hook #'flycheck-apply-python-checkers-after-locals)
2854+
(add-hook 'python-mode-hook #'flyspell-prog-mode)
28552855

28562856
;;;;; Lisp and company
28572857
;; Associate `cask-mode' with Cask files.

0 commit comments

Comments
 (0)