]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'kill-ring-deindent-mode'
authorEli Zaretskii <eliz@gnu.org>
Sat, 26 Apr 2025 14:30:20 +0000 (17:30 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sun, 27 Apr 2025 13:28:50 +0000 (15:28 +0200)
* 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

index 27d5875bc2267abc19731d3854ee8e2b9edf4a34..eeb8f1ee6bb302b6174bb5ce4a2e1915ab570cfd 100644 (file)
@@ -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))