From: Martin S. <ma...@ly...> - 2004-04-09 12:34:43
|
Alan Mackenzie <ac...@mu...> wrote: > However, If point is just after the \ of and escaped newline, c-b-s-c > doesn't move. The immediate reason for this is the following line of > code near the beginning of the function: > > (let ((start (point))) > ;; When we got newline terminated comments, forward-comment in all > ;; supported emacsen so far will stop at eol of each line not > ;; ending with a comment when moving backwards. This corrects for > ;; that, and at the same time handles line continuations. > (while (progn > (skip-chars-backward " \t\n\r\f\v") > (and (looking-at "[\n\r]") > (eq (char-before) ?\\) > (< (point) start))) ; <=============================== > (backward-char)) > > I don't understand why this check, (< (point) start), is done. Is there > any reason for it, or could I simply delete it? There's a design-wise reason for it, namely that the backslash and the newline both are considered to make up the syntactic whitespace, and you have to stand after and not in the middle of it to jump over it. It's the same thing as newline ended comments. There you also need to be at the beginning of the next line to skip past it; if you're at the end of the same line you're considered to be within the comment. As for a practical reason, I don't really know. It seems unlikely that removing that extra check will actually break any code right now, but I'm not sure of that. What's the situation where it's causing problems? Keeping the design consistent is a bit nice for its own sake, but if it's causing headaches for you, it might be best to change it anyway. |