Commits

Alan Mackenzie  committed cd3113d

AWK Mode: make auto-newline work when there's "==" in the pattern.
cc-cmds.el (c-point-syntax): Handle virtual semicolons correctly.
cc-engine.el (c-guess-basic-syntax CASE 5A.3): Test more rigorously for
"=" token.

  • Participants
  • Parent commits 391069c

Comments (0)

Files changed (2)

       (insert-char ?\n 1)
       ;; In AWK (etc.) or in a macro, make sure this CR hasn't changed
       ;; the syntax.  (There might already be an escaped NL there.)
-      (when (or (c-at-vsemi-p (1- (point)))
-		(let ((pt (point)))
-		  (save-excursion
-		    (backward-char)
-		    (and (c-beginning-of-macro)
-			 (progn (c-end-of-macro)
-				(< (point) pt))))))
+      (when (or
+	     (save-excursion
+	       (c-skip-ws-backward (c-point 'bopl))
+	       (c-at-vsemi-p))
+	     (let ((pt (point)))
+	       (save-excursion
+		 (backward-char)
+		 (and (c-beginning-of-macro)
+		      (progn (c-end-of-macro)
+			     (< (point) pt))))))
 	(backward-char)
 	(insert-char ?\\ 1)
 	(forward-char))

File cc-engine.el

 			     (setq tmpsymbol nil)
 			     (while (and (> (point) placeholder)
 					 (zerop (c-backward-token-2 1 t))
-					 (/= (char-after) ?=))
+					 (not (looking-at "=\\([^=]\\|$\\)")))
 			       (and c-opt-inexpr-brace-list-key
 				    (not tmpsymbol)
 				    (looking-at c-opt-inexpr-brace-list-key)
 				    (setq tmpsymbol 'topmost-intro-cont)))
-			     (eq (char-after) ?=))
+			     (looking-at "=\\([^=]\\|$\\)"))
 			   (looking-at c-brace-list-key))
 		       (save-excursion
 			 (while (and (< (point) indent-point)