From 0d3ae350c91c84b11f7d5fb0913fb7d294bc756f Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 3 Sep 2021 08:36:03 +0200 Subject: [PATCH] Make toggle-truncate-lines disable visual-line-mode * lisp/simple.el (toggle-truncate-lines): Disable `visual-line-mode' (bug#29664). --- lisp/simple.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index d6c448b36a5..c6495166ffc 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8306,8 +8306,13 @@ non-nil." (if (eq buffer (window-buffer window)) (set-window-hscroll window 0))) nil t))) - (message "Truncate long lines %s" - (if truncate-lines "enabled" "disabled"))) + (message "Truncate long lines %s%s" + (if truncate-lines "enabled" "disabled") + (if (and truncate-lines visual-line-mode) + (progn + (visual-line-mode -1) + (message " and `visual-line-mode' disabled")) + ""))) (defun toggle-word-wrap (&optional arg) "Toggle whether to use word-wrapping for continuation lines. -- 2.39.2