From c899b3db0cff6e28f9a820efd45fe9e80b737f09 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 8 Feb 2009 00:47:15 +0000 Subject: [PATCH] (toggle-word-wrap): New command. --- lisp/ChangeLog | 4 ++++ lisp/simple.el | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 82802f147dd..371a97bcab3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2009-02-08 Juri Linkov + + * simple.el (toggle-word-wrap): New command. + 2009-02-07 Chong Yidong * progmodes/ps-mode.el (ps-run-tmp-dir): Doc fix. diff --git a/lisp/simple.el b/lisp/simple.el index 950d7f0730d..cb2459a7348 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5079,6 +5079,21 @@ is non-nil." (message "Truncate long lines %s" (if truncate-lines "enabled" "disabled"))) +(defun toggle-word-wrap (&optional arg) + "Toggle whether to use word-wrapping for continuation lines. +With prefix argument ARG, wrap continuation lines at word boundaries +if ARG is positive, otherwise wrap them at the right screen edge. +This command toggles the value of `word-wrap'. It has no effect +if long lines are truncated." + (interactive "P") + (setq word-wrap + (if (null arg) + (not word-wrap) + (> (prefix-numeric-value arg) 0))) + (force-mode-line-update) + (message "Word wrapping %s" + (if word-wrap "enabled" "disabled"))) + (defvar overwrite-mode-textual " Ovwrt" "The string displayed in the mode line when in overwrite mode.") (defvar overwrite-mode-binary " Bin Ovwrt" -- 2.39.5