emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp simple.el


From: Juri Linkov
Subject: [Emacs-diffs] emacs/lisp simple.el
Date: Sun, 08 Feb 2009 00:46:38 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Juri Linkov <jurta>     09/02/08 00:46:38

Modified files:
        lisp           : simple.el 

Log message:
        (toggle-word-wrap): New command.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/simple.el?cvsroot=emacs&r1=1.970&r2=1.971

Patches:
Index: simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.970
retrieving revision 1.971
diff -u -b -r1.970 -r1.971
--- simple.el   7 Feb 2009 05:51:27 -0000       1.970
+++ simple.el   8 Feb 2009 00:46:38 -0000       1.971
@@ -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"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]