From fc32823987130c968b548517d4af53e5f93f82cd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 26 Apr 2025 17:30:20 +0300 Subject: [PATCH] Fix 'kill-ring-deindent-mode' * lisp/indent-aux.el (kill-ring-deindent-buffer-substring-function): Fix deindenting for modes which set 'indent-tab-mode' to nil. (Bug#77981) (cherry picked from commit 1c7fe501fedb41aaf5b22d82dab5a365f86e4c85) --- lisp/indent-aux.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/indent-aux.el b/lisp/indent-aux.el index 27d5875bc22..eeb8f1ee6bb 100644 --- a/lisp/indent-aux.el +++ b/lisp/indent-aux.el @@ -45,10 +45,14 @@ is yanked." end (max a b))) (let ((indentation (save-excursion (goto-char beg) (current-column))) + (i-t-m indent-tabs-mode) (text (if delete (delete-and-extract-region beg end) (buffer-substring beg end)))) (with-temp-buffer + ;; Indent/deindent the same as the major mode in the original + ;; buffer. + (setq indent-tabs-mode i-t-m) (insert text) (indent-rigidly (point-min) (point-max) (- indentation)) -- 2.39.5