]> git.eshelyaron.com Git - emacs.git/commitdiff
Make toggle-truncate-lines disable visual-line-mode
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 3 Sep 2021 06:36:03 +0000 (08:36 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 3 Sep 2021 06:37:03 +0000 (08:37 +0200)
* lisp/simple.el (toggle-truncate-lines): Disable
`visual-line-mode' (bug#29664).

lisp/simple.el

index d6c448b36a536fccda8d13748969011aa08c4ba9..c6495166ffc776b8b8626743e4306c15fcf70f6b 100644 (file)
@@ -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.