# HG changeset patch # User Juri Linkov # Date 1234053998 0 # Node ID d08c7c69fefebd23ff96cce25284bb806049788d # Parent 97a01032d9d25caee2923546cd67d801584a73d5 (toggle-word-wrap): New command. diff -r 97a01032d9d2 -r d08c7c69fefe lisp/simple.el --- a/lisp/simple.el Sat Feb 07 22:41:04 2009 +0000 +++ b/lisp/simple.el Sun Feb 08 00:46:38 2009 +0000 @@ -5079,6 +5079,21 @@ (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"