changeset 49660:425dcb97eca4

(c-set-offset): Don't find a default syntactic element through syntactic analysis if called outside a CC Mode buffer.
author Martin Stjernholm <mast@lysator.liu.se>
date Mon, 10 Feb 2003 00:50:26 +0000
parents 68d45eb4df69
children 794b46b14a17
files lisp/progmodes/cc-styles.el
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/cc-styles.el	Sun Feb 09 14:43:55 2003 +0000
+++ b/lisp/progmodes/cc-styles.el	Mon Feb 10 00:50:26 2003 +0000
@@ -445,10 +445,11 @@
 		    ;; initial contents tries to be the last element
 		    ;; on the syntactic analysis list for the current
 		    ;; line
-		    (let* ((syntax (c-guess-basic-syntax))
-			   (len (length syntax))
-			   (ic (format "%s" (car (nth (1- len) syntax)))))
-		      (cons ic 0))
+		    (and c-buffer-is-cc-mode
+			 (let* ((syntax (c-guess-basic-syntax))
+				(len (length syntax))
+				(ic (format "%s" (car (nth (1- len) syntax)))))
+			   (cons ic 0)))
 		    )))
 	  (offset (c-read-offset langelem)))
      (list langelem offset current-prefix-arg)))