Mercurial > emacs
comparison lisp/longlines.el @ 64216:6c19076eecb0
(longlines-show-region, longlines-unshow-hard-newlines):
Recognize hard newlines by non-nil hard property, instead of t.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 10 Jul 2005 20:37:20 +0000 |
parents | 6fb026ad601f |
children | 41bb365f41c4 |
comparison
equal
deleted
inserted
replaced
64215:a4c59075cac8 | 64216:6c19076eecb0 |
---|---|
168 | 168 |
169 (defun longlines-show-region (beg end) | 169 (defun longlines-show-region (beg end) |
170 "Make hard newlines between BEG and END visible." | 170 "Make hard newlines between BEG and END visible." |
171 (let* ((pmin (min beg end)) | 171 (let* ((pmin (min beg end)) |
172 (pmax (max beg end)) | 172 (pmax (max beg end)) |
173 (pos (text-property-any pmin pmax 'hard t))) | 173 (pos (text-property-not-all pmin pmax 'hard nil))) |
174 (while pos | 174 (while pos |
175 (put-text-property pos (1+ pos) 'display | 175 (put-text-property pos (1+ pos) 'display |
176 (copy-sequence longlines-show-effect)) | 176 (copy-sequence longlines-show-effect)) |
177 (setq pos (text-property-any (1+ pos) pmax 'hard t))))) | 177 (setq pos (text-property-not-all (1+ pos) pmax 'hard nil))))) |
178 | 178 |
179 (defun longlines-unshow-hard-newlines () | 179 (defun longlines-unshow-hard-newlines () |
180 "Make hard newlines invisible again." | 180 "Make hard newlines invisible again." |
181 (interactive) | 181 (interactive) |
182 (setq longlines-showing nil) | 182 (setq longlines-showing nil) |
183 (let ((pos (text-property-any (point-min) (point-max) 'hard t))) | 183 (let ((pos (text-property-not-all (point-min) (point-max) 'hard nil))) |
184 (while pos | 184 (while pos |
185 (remove-text-properties pos (1+ pos) '(display)) | 185 (remove-text-properties pos (1+ pos) '(display)) |
186 (setq pos (text-property-any (1+ pos) (point-max) 'hard t))))) | 186 (setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil))))) |
187 | 187 |
188 ;; Wrapping the paragraphs. | 188 ;; Wrapping the paragraphs. |
189 | 189 |
190 (defun longlines-wrap-region (beg end) | 190 (defun longlines-wrap-region (beg end) |
191 "Wrap each successive line, starting with the line before BEG. | 191 "Wrap each successive line, starting with the line before BEG. |