From: Martin Stjernholm Date: Mon, 10 Feb 2003 00:51:25 +0000 (+0000) Subject: (c-set-offset): Don't find a default syntactic element through X-Git-Tag: ttn-vms-21-2-B4~11296 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ea7038228bfde2707880dae062e3a1595c427195;p=emacs.git (c-set-offset): Don't find a default syntactic element through syntactic analysis if called outside a CC Mode buffer. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fcf154b03eb..a30150aafc7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2003-02-10 Martin Stjernholm + + * 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 * progmodes/cc-mode.el (c-basic-common-init): Install diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 4bd72f29070..c7f1adaa434 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -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)))