]> code.delx.au - gnu-emacs/commitdiff
(longlines-auto-wrap): Handle argument correctly.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 4 Jun 2007 20:33:00 +0000 (20:33 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 4 Jun 2007 20:33:00 +0000 (20:33 +0000)
lisp/longlines.el

index f39d31e69f0471601ff4926d50a64aef2dd5136c..149f69c9f2655e1a0f2de8727ac1c433ff0f527e 100644 (file)
@@ -368,10 +368,10 @@ Hard newlines are left intact."
 With optional argument ARG, turn on line wrapping if and only if ARG is positive.
 If automatic line wrapping is turned on, wrap the entire buffer."
   (interactive "P")
-  (and (null arg)
-       (null longlines-auto-wrap)
-       (setq arg 1))
-  (if (> (prefix-numeric-value arg) 0)
+  (setq arg (if arg
+               (> (prefix-numeric-value arg) 0)
+             (not longlines-auto-wrap)))
+  (if arg
       (let ((mod (buffer-modified-p)))
        (setq longlines-auto-wrap t)
        (longlines-wrap-region (point-min) (point-max))