aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-12-28 10:56:33 +0200
committerEli Zaretskii2023-12-28 10:56:33 +0200
commit24e71050ea9f82979fadd320e8aaf9c8d58b72f2 (patch)
tree6996b93e0c37bd20bc6b5d5f18518f6e75961a73
parent6abf1c038f6c74f2e56078228cdf8a0cda40c6b3 (diff)
downloademacs-24e71050ea9f82979fadd320e8aaf9c8d58b72f2.tar.gz
emacs-24e71050ea9f82979fadd320e8aaf9c8d58b72f2.zip
Fix rectangle commands when 'indent-tabs-mode' is non-nil
* lisp/rect.el (delete-rectangle, kill-rectangle): Temporarily bind 'indent-tabs-mode' to nil. (Bug#67925)
-rw-r--r--lisp/rect.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/rect.el b/lisp/rect.el
index 9049e322ca6..525a1586434 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -282,7 +282,8 @@ When called from a program the rectangle's corners are START and END.
282With a prefix (or a FILL) argument, also fill lines where nothing has 282With a prefix (or a FILL) argument, also fill lines where nothing has
283to be deleted." 283to be deleted."
284 (interactive "*r\nP") 284 (interactive "*r\nP")
285 (apply-on-rectangle 'delete-rectangle-line start end fill)) 285 (let (indent-tabs-mode)
286 (apply-on-rectangle 'delete-rectangle-line start end fill)))
286 287
287;;;###autoload 288;;;###autoload
288(defun delete-extract-rectangle (start end &optional fill) 289(defun delete-extract-rectangle (start end &optional fill)
@@ -337,7 +338,8 @@ you can use this command to copy text from a read-only buffer.
337even beep.)" 338even beep.)"
338 (interactive "r\nP") 339 (interactive "r\nP")
339 (condition-case nil 340 (condition-case nil
340 (setq killed-rectangle (delete-extract-rectangle start end fill)) 341 (let (indent-tabs-mode)
342 (setq killed-rectangle (delete-extract-rectangle start end fill)))
341 ((buffer-read-only text-read-only) 343 ((buffer-read-only text-read-only)
342 (setq deactivate-mark t) 344 (setq deactivate-mark t)
343 (setq killed-rectangle (extract-rectangle start end)) 345 (setq killed-rectangle (extract-rectangle start end))