comparison lisp/simple.el @ 101897:d08c7c69fefe

(toggle-word-wrap): New command.
author Juri Linkov <juri@jurta.org>
date Sun, 08 Feb 2009 00:46:38 +0000
parents 0750b250db3d
children 7a9e5d67e102
comparison
equal deleted inserted replaced
101896:97a01032d9d2 101897:d08c7c69fefe
5077 (set-window-hscroll window 0))) 5077 (set-window-hscroll window 0)))
5078 nil t))) 5078 nil t)))
5079 (message "Truncate long lines %s" 5079 (message "Truncate long lines %s"
5080 (if truncate-lines "enabled" "disabled"))) 5080 (if truncate-lines "enabled" "disabled")))
5081 5081
5082 (defun toggle-word-wrap (&optional arg)
5083 "Toggle whether to use word-wrapping for continuation lines.
5084 With prefix argument ARG, wrap continuation lines at word boundaries
5085 if ARG is positive, otherwise wrap them at the right screen edge.
5086 This command toggles the value of `word-wrap'. It has no effect
5087 if long lines are truncated."
5088 (interactive "P")
5089 (setq word-wrap
5090 (if (null arg)
5091 (not word-wrap)
5092 (> (prefix-numeric-value arg) 0)))
5093 (force-mode-line-update)
5094 (message "Word wrapping %s"
5095 (if word-wrap "enabled" "disabled")))
5096
5082 (defvar overwrite-mode-textual " Ovwrt" 5097 (defvar overwrite-mode-textual " Ovwrt"
5083 "The string displayed in the mode line when in overwrite mode.") 5098 "The string displayed in the mode line when in overwrite mode.")
5084 (defvar overwrite-mode-binary " Bin Ovwrt" 5099 (defvar overwrite-mode-binary " Bin Ovwrt"
5085 "The string displayed in the mode line when in binary overwrite mode.") 5100 "The string displayed in the mode line when in binary overwrite mode.")
5086 5101