Mercurial > emacs
changeset 81142:d0d5c1ec56b8
(longlines-auto-wrap): Handle argument correctly.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 04 Jun 2007 20:33:00 +0000 |
parents | 36363285b348 |
children | 1234e849b425 |
files | lisp/longlines.el |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/longlines.el Mon Jun 04 20:32:47 2007 +0000 +++ b/lisp/longlines.el Mon Jun 04 20:33:00 2007 +0000 @@ -368,10 +368,10 @@ 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))