From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.bugs Subject: bug#9560: 24.0.50; c-mode syntax problems Date: Tue, 20 Sep 2011 11:25:08 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1316532366 25759 80.91.229.12 (20 Sep 2011 15:26:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Sep 2011 15:26:06 +0000 (UTC) To: 9560@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 20 17:26:02 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R62Cw-0003ZN-1G for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Sep 2011 17:26:02 +0200 Original-Received: from localhost ([::1]:51515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R62Cv-0004Vh-Hu for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Sep 2011 11:26:01 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R62Cr-0004Ut-6t for bug-gnu-emacs@gnu.org; Tue, 20 Sep 2011 11:25:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R62Co-0005GY-Pt for bug-gnu-emacs@gnu.org; Tue, 20 Sep 2011 11:25:57 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41787) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R62Co-0005GU-LT for bug-gnu-emacs@gnu.org; Tue, 20 Sep 2011 11:25:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R62Hl-0005Eu-Po for bug-gnu-emacs@gnu.org; Tue, 20 Sep 2011 11:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Welsh Duggan Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Sep 2011 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9560 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.131653264320111 (code B ref -1); Tue, 20 Sep 2011 15:31:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Sep 2011 15:30:43 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R62HR-0005EJ-Ru for submit@debbugs.gnu.org; Tue, 20 Sep 2011 11:30:42 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R62HN-0005EA-QD for submit@debbugs.gnu.org; Tue, 20 Sep 2011 11:30:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R62CK-0005Dj-4Z for submit@debbugs.gnu.org; Tue, 20 Sep 2011 11:25:30 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:33379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R62CK-0005Df-0Q for submit@debbugs.gnu.org; Tue, 20 Sep 2011 11:25:24 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R62CD-0004Lq-Lp for bug-gnu-emacs@gnu.org; Tue, 20 Sep 2011 11:25:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R62CB-0005Ca-By for bug-gnu-emacs@gnu.org; Tue, 20 Sep 2011 11:25:17 -0400 Original-Received: from euclid.red.cert.org ([192.88.209.48]:38176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R62CB-0005CD-68 for bug-gnu-emacs@gnu.org; Tue, 20 Sep 2011 11:25:15 -0400 Original-Received: from bucknell.indigo.cert.org (bucknell.indigo.cert.org [10.60.10.121]) by euclid.red.cert.org (8.14.4/8.14.4) with ESMTP id p8KFLZom012503 for ; Tue, 20 Sep 2011 11:21:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cert.org; s=jthatj15xw2j; t=1316532095; bh=Las4bnsj+7PcX9dWRFGezOdzeARaH56I0GZ5gj3FJoE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:Sender:Reply-To:Cc:In-Reply-To; b=l6RAOieNXOx41I7pcx8L/9pDPM+uXXCf4QZqObIvtBsceq7Fx9bj2Aot9TNZPBOih q1r6mqrWY+vYYd9apZg7P+7aMZ+EmC/u8DgBAH7pHFnrH6fhWg9GCbxNvi0iClLWaA 4gBnr/DBxbr58aeikE1ei+6jtD1OWvdov2rq4Zcg= Original-Received: from waterbuck.yellow.cert.org (waterbuck.yellow.cert.org [10.20.128.84]) by bucknell.indigo.cert.org (8.14.4/8.14.4/2.79) with ESMTP id p8KFPDI5025751 for ; Tue, 20 Sep 2011 11:25:13 -0400 Original-Received: (from mwd@localhost) by waterbuck.yellow.cert.org (8.14.4/8.14.4/Submit/1.6) id p8KFP8bq008000; Tue, 20 Sep 2011 11:25:08 -0400 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 20 Sep 2011 11:31:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:51540 Archived-At: I really wish I could give an exact recipe for this, but this particular failure is extremely transient. I can leave an emacs open in an bad state for postmortem diagnosis, but I cannot predict when or under what conditions this problem and ones similar to it will happen. In this particular case, I am editing an immediate struct at top level. For example: static const sk_stringmap_entry_t field_map_entries[] =3D { {"class", RWST_CLASS, "class name", NULL}, {"type", RWST_TYPE, "type name", NULL}, {"flowtype", RWST_FLOWTYPE, "flowtype name", NULL}, {"id-flowtype", RWST_FLOWTYPE_ID, "flowtype integer identifier", NULL}, {"sensor", RWST_SENSOR, "sensor name", NULL}, {"id-sensor", RWST_SENSOR_ID, "sensor integer identifier", NULL}, {"describe-sensor", RWST_SENSOR_DESC, "sensor description", NULL}, {"default-class", RWST_DEFAULT_CLASS, "default class name", NULL}, {"default-type", RWST_DEFAULT_TYPE, "default type name", NULL}, {"mark-defaults", RWST_MARK_DEFAULTS,=20 "'+' for default classes, '*' for types", NULL}, {"class:list", RWST_CLASS_LIST, "list of class names", NULL}, {"type:list", RWST_TYPE_LIST, "list of type names", NULL}, {"flowtype:list", RWST_FLOWTYPE_LIST, "list of flowtype names", NULL}, {"id-flowtype:list", RWST_FLOWTYPE_ID_LIST, "list of flowtype integer identifier", NULL}, {"sensor:list", RWST_SENSOR, "list of sensor names", NULL}, {"id-sensor:list", RWST_SENSOR_ID,=20 "list of sensor integer identifier", NULL}, {"default-class:list", RWST_DEFAULT_CLASS_LIST,=20 "list of default class name", NULL}, {"default-type:list", RWST_DEFAULT_TYPE_LIST, "list of default type name", NULL}, }; Note the indentation of that next-to-last line. That's because the syntax thinks it is ((statement-block-intro 4740) (statement-cont 4740)), indent: 12. It thinks the line above it is ((defun-open 4740)), indent: 4. But if I cursor up a few lines before hitting TAB, I get ((brace-list-entry 4557)), indent: 5, and tabbing down from there fixes the problem. This has happened to me three times while adding entries to this struct. I will include the entire file as I am editing it in this bug report, in case someone can recreate it by emptying the struct and typing the stuff in again. This sort of problem happens to me relatively frequently when editing C files, on the order of 1-10 times a day. Usually saving and reloading the file fixes the problem. Sometimes reindenting the section does. If there is any in-situ debugging I can do when this happens again, please let me know. auto-fill-mode (setq c-basic-offset 4 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . = 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "* " c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-nonempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . c-lineup-inexpr-block) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-method-call + ) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist ) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment ) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . *) (substatement . +) (statement-case-intro . *) (statement . 0) (brace-entry-open . 0) (brace-list-entry . 0) (brace-list-intro . +) (brace-list-close . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEFUN-intro-cont ) (brace-list-open . +) (inline-open . 0) (arglist-close . c-lineup-arglist) (arglist-intro . +) (statement-cont . c-lineup-math) (statement-case-open . *) (label . *) (substatement-label . 0) (substatement-open . 0) (knr-argdecl-intro . 5) (statement-block-intro . +) ) c-buffer-is-cc-mode 'c-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(//+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%= ;>*=C2=B7=E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) Package: CC Mode 5.31.8 (C/l) Buffer Style: gnu c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st= ring-delim gen-comment-delim syntax-properties 1-bit) In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.4) of 2011-09-19 on waterbuck.yellow.cert.org Windowing system distributor `The X.Org Foundation', version 11.0.70101000 configured using `configure '--prefix=3D/home/mwd' '--without-toolkit-scro= ll-bars' '--with-gif=3Dno'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dnone locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: C/l Minor modes in effect: flyspell-mode: t shell-dirtrack-mode: t display-time-mode: t diff-auto-refine-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t abbrev-mode: t Recent messages: Reading active file via nndraft...done Checking new news...done Don't touch it! It's the History Eraser Button, you fool! syntax: ((brace-list-entry 4646)), indent: 5 syntax: ((statement-block-intro 4740) (statement-cont 4740)), indent: 12 Don't touch it! It's the History Eraser Button, you fool! Type C-x 1 to remove help window.=20=20 Type "q" in help window to restore its previous buffer. Auto-saving... syntax: ((statement-block-intro 4740) (statement-cont 4740)), indent: 12 Features: (shadow emacsbug apropos align time-stamp tabify whitespace dabbrev help-mode view vc-svn cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs browse-url mule-util mailalias copyright cus-edit cus-start cus-load sendmail flyspell ispell sort ansi-color gnus-cite mail-extr qp gnus-async gnus-bcklg gnus-ml gnus-topic nndraft nnmh utf-7 rot13 disp-table epa-file epa derived epg network-stream starttls nnimap parse-time tls utf7 netrc gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime mailcap gnus-cache edmacro kmacro nnir gnus-sum gnus-demon nntp gnus-group gnus-undo nnmail mail-source nnoo gnutls gnus-start gnus-spec gnus-int gnus-range gnus-win gnus-load woman man uniquify warnings tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cconv macroexp assoc shell pcomplete tramp-loaddefs time smime password-cache dig comint server psvn advice help-fns advice-preload cl log-edit ring pcvs-util add-log diff-mode easy-mmode pgg pgg-parse pgg-def message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus gnus-ems nnheader gnus-util time-date mail-utils mm-util mail-prsvr wid-edit generic-x dired-x easymenu dired regexp-opt tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) --=20 Michael Welsh Duggan (mwd@cert.org)