# HG changeset patch # User Martin Stjernholm # Date 1044838226 0 # Node ID 425dcb97eca4dbe6ef5777c62f1bd3c47cc11368 # Parent 68d45eb4df69a8404bc741473bfe3df128b21209 (c-set-offset): Don't find a default syntactic element through syntactic analysis if called outside a CC Mode buffer. diff -r 68d45eb4df69 -r 425dcb97eca4 lisp/progmodes/cc-styles.el --- 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)))