]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-set-offset): Don't find a default syntactic element through
authorMartin Stjernholm <mast@lysator.liu.se>
Mon, 10 Feb 2003 00:51:25 +0000 (00:51 +0000)
committerMartin Stjernholm <mast@lysator.liu.se>
Mon, 10 Feb 2003 00:51:25 +0000 (00:51 +0000)
syntactic analysis if called outside a CC Mode buffer.

lisp/ChangeLog
lisp/progmodes/cc-styles.el

index fcf154b03ebd27a6e4bc13a1de7eb8fcf37c1a6c..a30150aafc7a465b5205b10bbb07f120073ed4ac 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-10  Martin Stjernholm  <mast@lysator.liu.se>
+
+       * progmodes/cc-styles.el (c-set-offset): Don't find a default
+       syntactic element through syntactic analysis if called outside
+       a CC Mode buffer.
+
 2003-02-09  Martin Stjernholm  <mast@lysator.liu.se>
 
        * progmodes/cc-mode.el (c-basic-common-init): Install
index 4bd72f290703d4c8c2d4467b450dbc6b84beaae0..c7f1adaa4348bbef226ed7cc311357d5bf532016 100644 (file)
@@ -445,10 +445,11 @@ and exists only for compatibility reasons."
                    ;; 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)))