Skip to main content
1 of 6
x-yuri
  • 291
  • 1
  • 8

For Emacs 26.3:

(eval-after-load "python" (lambda () (fset 'old-python-indent--calculate-indentation (symbol-function 'python-indent--calculate-indentation)) (defun python-indent--calculate-indentation () (save-excursion (pcase (python-indent-context) (`(,:inside-paren . ,start) (goto-char start) (+ (current-indentation) python-indent-offset)) (old-python-indent--calculate-indentation)))) ;; Alternatively, use advice-add ;; (defun my/python-indent--calculate-indentation (orig-fun &rest args) ;; ... ;; (apply orig-fun args)) ;; (advice-add 'python-indent--calculate-indentation :around #'my/python-indent--calculate-indentation) )) 
x-yuri
  • 291
  • 1
  • 8