Package: cc-mode;
Reported by: Michael Welsh Duggan <mwd <at> md5i.com>
Date: Sun, 13 Dec 2015 05:16:01 UTC
Severity: normal
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22156 in the body.
You can then email your comments to 22156 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-cc-mode <at> gnu.org
:bug#22156
; Package cc-mode
.
(Sun, 13 Dec 2015 05:16:01 GMT) Full text and rfc822 format available.Michael Welsh Duggan <mwd <at> md5i.com>
:bug-cc-mode <at> gnu.org
.
(Sun, 13 Dec 2015 05:16:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Michael Welsh Duggan <mwd <at> md5i.com> To: submit <at> debbugs.gnu.org Subject: CC Mode 5.33 (C++/l); Strange end-of-buffer error Date: Sun, 13 Dec 2015 00:15:42 -0500
Using emacs -Q /tmp/foo.cpp to start a new file, type the following: struct foo<A<B, When you type the comma, you should get an "End of buffer" error. The error seems to be at the point following this in the backtrace: Debugger entered--returning value: nil c-syntactic-re-search-forward("[<;{},|+&-]\\|[>)]" nil t t) * c-forward-<>-arglist-recur(nil) * c-forward-<>-arglist-recur(nil) * c-forward-<>-arglist(nil) * c-forward-name() * c-forward-type(t) * #[(preceding-token-end context last-cast-end) "`\306\211\211\211\211\211\211\211\211\211\211\211\211\211\211\211\211 @3ABCDEFGHIJKLMN\307 \203C\310 \210\2028`O\306\211PQ\306R\311S!\204cT\312=\203\213\311\313!\203\213\314 U\315\216\311V!\203s\316E*\317\320!W\321WX\")P\212\322\320!\210`Q)\323\316!\211R\203\366T\324=\203\272C\325W\321WX\")=\203\272\311\326!\203\272\316\306ROb\210M\203\325\3273M\330=\203\325\212Lb\210\316Y\323 \210*MJLIKHPGRMOL`K\306\211BAP\203\210P\331Z\211[ZN*\203#\3163M\203QK\202QNQb\202\222\306JQNR\203WP\332Z\211[ZN*\203A\316BP\333Z\211[ZN*\205\222\316\211A\202\222P\332Z\211[ZN*\203i\316FP\333Z\211[ZN*\203{\316D\3163PCQb\202\222R\205\222R\316=?,\204CM\316=\203\261\311\\!\203\253\322\320!\210\202\235`K\202\233M\334=\203\276\316M\202\233M\204\312NK\202\233M\335=\203\233T\324=\203\233\212\306\211\211]^_Kb\210\336 \210`^\337\340!\341W\204*T\342=\203\232``\343\306x\341W\203!\344\306x\341W\203!\311a!\203!\341\225`Y\203!\316\202&`b\210\306)\203\232\345`^\"_\346\306x\341W\203\232`]\337\340!\341W\204zT\342=\203\232``\343\306x\341W\203q\344\306x\341W\203q\311a!\203q\341\225`Y\203q\316\202v`b\210\306)\203\232`LY\203\232\345`]\"_\232\203\232Lb\210\306\211MJLK,`\341\306\211\211\211\211\211\211\211\211\211\211\211bcdefghijkl`mOKb\210n\203\347o\347\232\203\347\306f\350=\203<mTm\306u\210\202<\311o!\203<T\324=\203\351\224\203``\352 \211j\203<`b\311\353!\203<\306j\306f\350=\203$mTm\306u\210\2026h\204/m\341Uh\316l\320\225b\210\310 \210\202\347m\341Vkj\204a\311p!\203a`\211`\203a\352 \211j\203a`b\311q!\203\300\306f\354=\203\201m\341V\203pmSm\306u\210\202j\314 U\355\216\311\356!*\203\241\3571\235\360`\320\"b\210\3160\202\246\210\202p\320\225b\210\316\203pg\204\271m\341U\203\271\341\224g\316\211i\202gm\320U\203ph\204pM\316=\204pJ\204\354D\204\354A\204\354n\203pr\204p\3611\371\362`\320\211#0\202\373\210\306\211`\203p`\206`Sf\354=\203pMeLd\306k\316\211jiKg\341mJ\334=\2031\316\2023J\211M\203DILHK\202LNLNKF\204UBFD\204^ADKO`b\210\316\203p\310 \210\202a\f\203{\311s!\204\224D\204\205A\203\350j\204\350l\204\350M\203\350MeLd\306k\316\211jiKg\341mJ\334=\203\267\316\202\271J\211M\203\312ILHK\202\322NLNKF\204\333BFD\204\344ADKO\f\203\311t!\203\212\341\225b\210\310 \210`L\323 M)\3632\354m\341V\203*\3641\362`\320m#b0\202!\210\202\"\210\365\3633\316=\"\210\311r\366=\2036\367\202@r\203?\370\202@\371!fj\203\345M\204RD\203al\204ak\204a\365\363\316\"\210k\203Ul\204UJ\204\216D\204\216A\204\2163\316=\204\216\212bb\210\323 \372>)\204UMeLd\306k\316\211jiKg\341mJ\334=\203\261\316\202\263J\211M\203\304ILHK\202\314NLNKF\204\325BFD\204\336ADKO\202UJ\203G`OU\203-\306f\373=\203%T\312=\204%3\316=\203\365\363\316\"\210\202-u\203-3\327=\203-\316@\365\363\316\"\210\202-\316@\365\363\316\"\210i\203\223l\204\223k\204\223\316@\365\363\316\"\210\202\223M\316=\203S\365\363\316\"\210`OU\203\223f\203\215r\374=\203wv\204pw\203\205M\375>\202\202r\366=\203\215M\376>\203\215\365\363\316\"\210\202\223\365\3633\"\210k\203 l\204 r\204 M\316=\204 J\204\311D\204\311A\204\311n\203 i\203\311\311x!\204 MeLd\306k\316\211jiKg\341mJ\334=\203\354\316\202\356J\211M\203\377ILHK\202NLNKF\204BFD\204ADKO\202Ul\2034k\204/i\2034\365\363\316\"\210M\203Ul\204Uk\204Ug\203Ugf\350=\203U\365\363\306\"\2103\203_\365\363\316\"\210j\203\347r\204\347\311y!\203\347k\203\335l\204\335i\204\335M\316=\204\335MeLd\306k\316\211jiKg\341mJ\334=\203\251\316\202\253J\211M\203\274ILHK\202\304NLNKF\204\315BFD\204\326ADKO\202\342g\203\347\365\363\316\"\210l\204\361k\204\375M\377>\203\375\365\363\316\"\210M\201\212>\203\365\363\316\"\210T\324=\203re\203re\201\213>\204mdf\201\214=\203r\212dTb\210\310 \210\201\215 z\201\216\216\201\217{!\210\311|!+\204m\212dTb\210`\323 \210`}~\321\201\220~}#\200\"+\203r\365\363\316\"\210j\203\302h\203\235M\203\235f\204\216\311\201\221!\203\235r\204\235i\204\235\365\363\316\"\210g\204\252\311\201\221!\203\347M\330=\203\347r\201\222=\204\347\365\363\316\"\210\202\347r\203\347l\204\342r\374=\203\347w\204\347k\204\342i\203\347\365\363\316\"\210r\374=03.\212\201\205\224 \202eV\205\224 \202\206 `Sf\201>\205\224 \310 \210\311\201\223!\205\224 \306\211`u\210\310 \210`\311\203!\205[ \341\225`\201\224\224\204N \320\224\203F 3\204N M\201\225>\202K \311\204!?\205[ \311\205!?\206[ \341\225`X)\205\224 \202eV\205\224 \202Sb\210`\206=\206\224 \336 \210\337\340!\341W\203\204 \311\207!\202\224 `Sf\201\226>?\205\224 \201\227 ?)\203\274 \203\263 M\203\263 M\316=\204\263 \316YLb\210\323 \210)b\210\201\230\202V\n3\203Q\n@\203\376 J\334=\203\321 \316\202\323 J\211M\203\344 ILHK\202\354 NLNKF\204\365 BFD\204\376 ADr\374=\203'\n\311\201\231!\203'\n`\201\232\210\211`\211\201\233\211\211T\201\234\210$+\210\203<\nM\203<\n\316Y\212Lb\210\323 \210*KF\204H\nE\205M\nFEBB\202V\n\n\306.\207" [c-record-type-identifiers c-record-ref-identifiers save-rec-ref-ids save-rec-type-ids new-style-auto cast-end nil c-forward-annotation c-forward-sws looking-at java-mode "@[A-Za-z0-9]+" match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] t match-string 1 intern-soft c-forward-keyword-clause c-forward-type c++-mode "auto" "[=(]" ids found c-decl-hangon-kwds c-typedef-decl-kwds c-typeless-decl-kwds prefix maybe c-backward-sws skip-syntax-backward "w_" 0 pike-mode "-!%&*+/<=>^|~[]()" "`" buffer-substring-no-properties ":~ \n\f" "\\<\\>" 40 3 c-forward-name "\\(::\\)" 41 #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] "\\s(" (error) scan-sexps (error) ...] 21](1 nil nil) * apply(#[(preceding-token-end context last-cast-end) "`\306\211\211\211\211\211\211\211\211\211\211\211\211\211\211\211\211 @3ABCDEFGHIJKLMN\307 \203C\310 \210\2028`O\306\211PQ\306R\311S!\204cT\312=\203\213\311\313!\203\213\314 U\315\216\311V!\203s\316E*\317\320!W\321WX\")P\212\322\320!\210`Q)\323\316!\211R\203\366T\324=\203\272C\325W\321WX\")=\203\272\311\326!\203\272\316\306ROb\210M\203\325\3273M\330=\203\325\212Lb\210\316Y\323 \210*MJLIKHPGRMOL`K\306\211BAP\203\210P\331Z\211[ZN*\203#\3163M\203QK\202QNQb\202\222\306JQNR\203WP\332Z\211[ZN*\203A\316BP\333Z\211[ZN*\205\222\316\211A\202\222P\332Z\211[ZN*\203i\316FP\333Z\211[ZN*\203{\316D\3163PCQb\202\222R\205\222R\316=?,\204CM\316=\203\261\311\\!\203\253\322\320!\210\202\235`K\202\233M\334=\203\276\316M\202\233M\204\312NK\202\233M\335=\203\233T\324=\203\233\212\306\211\211]^_Kb\210\336 \210`^\337\340!\341W\204*T\342=\203\232``\343\306x\341W\203!\344\306x\341W\203!\311a!\203!\341\225`Y\203!\316\202&`b\210\306)\203\232\345`^\"_\346\306x\341W\203\232`]\337\340!\341W\204zT\342=\203\232``\343\306x\341W\203q\344\306x\341W\203q\311a!\203q\341\225`Y\203q\316\202v`b\210\306)\203\232`LY\203\232\345`]\"_\232\203\232Lb\210\306\211MJLK,`\341\306\211\211\211\211\211\211\211\211\211\211\211bcdefghijkl`mOKb\210n\203\347o\347\232\203\347\306f\350=\203<mTm\306u\210\202<\311o!\203<T\324=\203\351\224\203``\352 \211j\203<`b\311\353!\203<\306j\306f\350=\203$mTm\306u\210\2026h\204/m\341Uh\316l\320\225b\210\310 \210\202\347m\341Vkj\204a\311p!\203a`\211`\203a\352 \211j\203a`b\311q!\203\300\306f\354=\203\201m\341V\203pmSm\306u\210\202j\314 U\355\216\311\356!*\203\241\3571\235\360`\320\"b\210\3160\202\246\210\202p\320\225b\210\316\203pg\204\271m\341U\203\271\341\224g\316\211i\202gm\320U\203ph\204pM\316=\204pJ\204\354D\204\354A\204\354n\203pr\204p\3611\371\362`\320\211#0\202\373\210\306\211`\203p`\206`Sf\354=\203pMeLd\306k\316\211jiKg\341mJ\334=\2031\316\2023J\211M\203DILHK\202LNLNKF\204UBFD\204^ADKO`b\210\316\203p\310 \210\202a\f\203{\311s!\204\224D\204\205A\203\350j\204\350l\204\350M\203\350MeLd\306k\316\211jiKg\341mJ\334=\203\267\316\202\271J\211M\203\312ILHK\202\322NLNKF\204\333BFD\204\344ADKO\f\203\311t!\203\212\341\225b\210\310 \210`L\323 M)\3632\354m\341V\203*\3641\362`\320m#b0\202!\210\202\"\210\365\3633\316=\"\210\311r\366=\2036\367\202@r\203?\370\202@\371!fj\203\345M\204RD\203al\204ak\204a\365\363\316\"\210k\203Ul\204UJ\204\216D\204\216A\204\2163\316=\204\216\212bb\210\323 \372>)\204UMeLd\306k\316\211jiKg\341mJ\334=\203\261\316\202\263J\211M\203\304ILHK\202\314NLNKF\204\325BFD\204\336ADKO\202UJ\203G`OU\203-\306f\373=\203%T\312=\204%3\316=\203\365\363\316\"\210\202-u\203-3\327=\203-\316@\365\363\316\"\210\202-\316@\365\363\316\"\210i\203\223l\204\223k\204\223\316@\365\363\316\"\210\202\223M\316=\203S\365\363\316\"\210`OU\203\223f\203\215r\374=\203wv\204pw\203\205M\375>\202\202r\366=\203\215M\376>\203\215\365\363\316\"\210\202\223\365\3633\"\210k\203 l\204 r\204 M\316=\204 J\204\311D\204\311A\204\311n\203 i\203\311\311x!\204 MeLd\306k\316\211jiKg\341mJ\334=\203\354\316\202\356J\211M\203\377ILHK\202NLNKF\204BFD\204ADKO\202Ul\2034k\204/i\2034\365\363\316\"\210M\203Ul\204Uk\204Ug\203Ugf\350=\203U\365\363\306\"\2103\203_\365\363\316\"\210j\203\347r\204\347\311y!\203\347k\203\335l\204\335i\204\335M\316=\204\335MeLd\306k\316\211jiKg\341mJ\334=\203\251\316\202\253J\211M\203\274ILHK\202\304NLNKF\204\315BFD\204\326ADKO\202\342g\203\347\365\363\316\"\210l\204\361k\204\375M\377>\203\375\365\363\316\"\210M\201\212>\203\365\363\316\"\210T\324=\203re\203re\201\213>\204mdf\201\214=\203r\212dTb\210\310 \210\201\215 z\201\216\216\201\217{!\210\311|!+\204m\212dTb\210`\323 \210`}~\321\201\220~}#\200\"+\203r\365\363\316\"\210j\203\302h\203\235M\203\235f\204\216\311\201\221!\203\235r\204\235i\204\235\365\363\316\"\210g\204\252\311\201\221!\203\347M\330=\203\347r\201\222=\204\347\365\363\316\"\210\202\347r\203\347l\204\342r\374=\203\347w\204\347k\204\342i\203\347\365\363\316\"\210r\374=03.\212\201\205\224 \202eV\205\224 \202\206 `Sf\201>\205\224 \310 \210\311\201\223!\205\224 \306\211`u\210\310 \210`\311\203!\205[ \341\225`\201\224\224\204N \320\224\203F 3\204N M\201\225>\202K \311\204!?\205[ \311\205!?\206[ \341\225`X)\205\224 \202eV\205\224 \202Sb\210`\206=\206\224 \336 \210\337\340!\341W\203\204 \311\207!\202\224 `Sf\201\226>?\205\224 \201\227 ?)\203\274 \203\263 M\203\263 M\316=\204\263 \316YLb\210\323 \210)b\210\201\230\202V\n3\203Q\n@\203\376 J\334=\203\321 \316\202\323 J\211M\203\344 ILHK\202\354 NLNKF\204\365 BFD\204\376 ADr\374=\203'\n\311\201\231!\203'\n`\201\232\210\211`\211\201\233\211\211T\201\234\210$+\210\203<\nM\203<\n\316Y\212Lb\210\323 \210*KF\204H\nE\205M\nFEBB\202V\n\n\306.\207" [c-record-type-identifiers c-record-ref-identifiers save-rec-ref-ids save-rec-type-ids new-style-auto cast-end nil c-forward-annotation c-forward-sws looking-at java-mode "@[A-Za-z0-9]+" match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] t match-string 1 intern-soft c-forward-keyword-clause c-forward-type c++-mode "auto" "[=(]" ids found c-decl-hangon-kwds c-typedef-decl-kwds c-typeless-decl-kwds prefix maybe c-backward-sws skip-syntax-backward "w_" 0 pike-mode "-!%&*+/<=>^|~[]()" "`" buffer-substring-no-properties ":~ \n\f" "\\<\\>" 40 3 c-forward-name "\\(::\\)" 41 #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] "\\s(" (error) scan-sexps (error) ...] 21] (1 nil nil)) * c-forward-decl-or-cast-1(1 nil nil) c-just-after-func-arglist-p(1) c-guess-basic-syntax() c-indent-line() c-electric-semi&comma(nil) funcall-interactively(c-electric-semi&comma nil) call-interactively(c-electric-semi&comma nil nil) command-execute(c-electric-semi&comma) Emacs : GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, X toolkit) of 2015-11-26 Package: CC Mode 5.33 (C++/l) Buffer Style: SiLK c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit) current state: ============== (setq c-basic-offset 4 c-comment-only-line-offset 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 '((brace-list-open) (brace-entry-open) (statement-cont) (substatement-open after) (block-close . c-snug-do-while) (extern-lang-open after) (namespace-open after) (module-open after) (composition-open after) (inexpr-class-open after) (inexpr-class-close before) (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 nil 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 . 0) (inextern-lang . 0) (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 . c-lineup-topmost-intro-cont) (brace-list-open . 0) (inline-open . 0) (arglist-close . +) (arglist-intro . +) (statement-cont . c-lineup-math) (statement-case-open . *) (label . *) (substatement-label . 2) (substatement-open . 0) (knr-argdecl-intro . +) (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 "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-–!|#%;>*·•‣⁃◦]+[ ]*\\)*\\)" ) -- Michael Welsh Duggan (md5i <at> md5i.com)
bug-cc-mode <at> gnu.org
:bug#22156
; Package cc-mode
.
(Thu, 17 Dec 2015 14:34:01 GMT) Full text and rfc822 format available.Message #8 received at 22156 <at> debbugs.gnu.org (full text, mbox):
From: Alan Mackenzie <acm <at> muc.de> To: Michael Welsh Duggan <mwd <at> md5i.com> Cc: 22156 <at> debbugs.gnu.org Subject: Re: bug#22156: CC Mode 5.33 (C++/l); Strange end-of-buffer error Date: Thu, 17 Dec 2015 14:35:46 +0000
Hello, Michael. On Sun, Dec 13, 2015 at 12:15:42AM -0500, Michael Welsh Duggan wrote: > Using emacs -Q /tmp/foo.cpp to start a new file, type the following: > struct foo<A<B, > When you type the comma, you should get an "End of buffer" error. The > error seems to be at the point following this in the backtrace: Yes. Thanks again for such a succinct bug report, and for the backtrace. For some reason I couldn't get Emacs to give me a backtrace no matter what I tried. > Debugger entered--returning value: nil > c-syntactic-re-search-forward("[<;{},|+&-]\\|[>)]" nil t t) > * c-forward-<>-arglist-recur(nil) > * c-forward-<>-arglist-recur(nil) > * c-forward-<>-arglist(nil) > * c-forward-name() > * c-forward-type(t) > * #[(preceding-token-end context last-cast-end) "`\306\211\211\211\211\211\ ... > * apply(#[(preceding-token-end context last-cast-end) "`\306\211\211\211\211\211 ... > * c-forward-decl-or-cast-1(1 nil nil) > c-just-after-func-arglist-p(1) > c-guess-basic-syntax() > c-indent-line() > c-electric-semi&comma(nil) > funcall-interactively(c-electric-semi&comma nil) > call-interactively(c-electric-semi&comma nil nil) > command-execute(c-electric-semi&comma) > Emacs : GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, X toolkit) > of 2015-11-26 > Package: CC Mode 5.33 (C++/l) > Buffer Style: SiLK > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit) [ Dump of CC Mode's state snipped, but appreciated. ] The cause was a simple coding error: after searching forward (for a closing >), c-forward-<>-arglist-recur failed to set point back to the starting place before trying the next possibility. Here is a patch which I hope fixes things. Please let me know whether or not it works satisfactorily. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index acc2edd..11a0db2 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -5964,7 +5964,7 @@ c-forward-<>-arglist-recur ;; Recursive part of `c-forward-<>-arglist'. ;; ;; This function might do hidden buffer changes. - (let ((start (point)) res pos tmp + (let ((start (point)) res pos ;; Cover this so that any recorded found type ranges are ;; automatically lost if it turns out to not be an angle ;; bracket arglist. It's propagated through the return value @@ -6059,15 +6059,13 @@ c-forward-<>-arglist-recur ;; Either an operator starting with '<' or a nested arglist. (setq pos (point)) (let (id-start id-end subres keyword-match) - (cond + (cond ;; The '<' begins a multi-char operator. ((looking-at c-<-op-cont-regexp) - (setq tmp (match-end 0)) (goto-char (match-end 0))) ;; We're at a nested <.....> ((progn - (setq tmp pos) - (backward-char) ; to the '<' + (backward-char) ; to the '<' (and (save-excursion ;; There's always an identifier before an angle @@ -6087,7 +6085,9 @@ c-forward-<>-arglist-recur (and keyword-match (c-keyword-member (c-keyword-sym (match-string 1)) - 'c-<>-type-kwds))))))) + 'c-<>-type-kwds)))))) + (or subres (goto-char pos)) + subres) ;; It was an angle bracket arglist. (setq c-record-found-types subres) @@ -6103,11 +6103,11 @@ c-forward-<>-arglist-recur (c-record-ref-id (cons id-start id-end)) (c-record-type-id (cons id-start id-end))))) - ;; At a "less than" operator. - (t - (forward-char) - ))) - t) ; carry on looping. + ;; At a "less than" operator. + (t + ;; (forward-char) ; NO! We've already gone over it. + ))) + t) ; carry on looping. ((and (not c-restricted-<>-arglists) (or (and (eq (char-before) ?&) > -- > Michael Welsh Duggan > (md5i <at> md5i.com) -- Alan Mackenzie (Nuremberg, Germany).
bug-cc-mode <at> gnu.org
:bug#22156
; Package cc-mode
.
(Fri, 18 Dec 2015 13:38:01 GMT) Full text and rfc822 format available.Message #11 received at 22156 <at> debbugs.gnu.org (full text, mbox):
From: Michael Welsh Duggan <mwd <at> md5i.com> To: Alan Mackenzie <acm <at> muc.de> Cc: 22156 <at> debbugs.gnu.org Subject: Re: bug#22156: CC Mode 5.33 (C++/l); Strange end-of-buffer error Date: Fri, 18 Dec 2015 08:37:30 -0500
Alan Mackenzie <acm <at> muc.de> writes: > [Third attempt at sending; the first two bounced. If this gets through, > would you please add back the bug system address (22156 <at> debbugs.gnu.org) > as a CC when replying.] I haven't yet had time to test this, but I got a couple other copies of this message. I would appreciate it if you let me know how they bounced, so I can see if there are any problems in my mail system. > Hello, Michael. > > On Sun, Dec 13, 2015 at 12:15:42AM -0500, Michael Welsh Duggan wrote: >> Using emacs -Q /tmp/foo.cpp to start a new file, type the following: > >> struct foo<A<B, > >> When you type the comma, you should get an "End of buffer" error. The >> error seems to be at the point following this in the backtrace: > > Yes. Thanks again for such a succinct bug report, and for the > backtrace. For some reason I couldn't get Emacs to give me a backtrace > no matter what I tried. > >> Debugger entered--returning value: nil >> c-syntactic-re-search-forward("[<;{},|+&-]\\|[>)]" nil t t) >> * c-forward-<>-arglist-recur(nil) >> * c-forward-<>-arglist-recur(nil) >> * c-forward-<>-arglist(nil) >> * c-forward-name() >> * c-forward-type(t) >> * #[(preceding-token-end context last-cast-end) >> "`\306\211\211\211\211\211\ ... >> * apply(#[(preceding-token-end context last-cast-end) >> "`\306\211\211\211\211\211 ... >> * c-forward-decl-or-cast-1(1 nil nil) >> c-just-after-func-arglist-p(1) >> c-guess-basic-syntax() >> c-indent-line() >> c-electric-semi&comma(nil) >> funcall-interactively(c-electric-semi&comma nil) >> call-interactively(c-electric-semi&comma nil nil) >> command-execute(c-electric-semi&comma) > > >> Emacs : GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, X toolkit) >> of 2015-11-26 >> Package: CC Mode 5.33 (C++/l) >> Buffer Style: SiLK >> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes >> gen-string-delim gen-comment-delim syntax-properties 1-bit) > > [ Dump of CC Mode's state snipped, but appreciated. ] > > The cause was a simple coding error: after searching forward (for a > closing >), c-forward-<>-arglist-recur failed to set point back to the > starting place before trying the next possibility. > > Here is a patch which I hope fixes things. Please let me know whether > or not it works satisfactorily. > > > > diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el > index acc2edd..11a0db2 100644 > --- a/lisp/progmodes/cc-engine.el > +++ b/lisp/progmodes/cc-engine.el > @@ -5964,7 +5964,7 @@ c-forward-<>-arglist-recur > ;; Recursive part of `c-forward-<>-arglist'. > ;; > ;; This function might do hidden buffer changes. > - (let ((start (point)) res pos tmp > + (let ((start (point)) res pos > ;; Cover this so that any recorded found type ranges are > ;; automatically lost if it turns out to not be an angle > ;; bracket arglist. It's propagated through the return value > @@ -6059,15 +6059,13 @@ c-forward-<>-arglist-recur > ;; Either an operator starting with '<' or a nested arglist. > (setq pos (point)) > (let (id-start id-end subres keyword-match) > - (cond > + (cond > ;; The '<' begins a multi-char operator. > ((looking-at c-<-op-cont-regexp) > - (setq tmp (match-end 0)) > (goto-char (match-end 0))) > ;; We're at a nested <.....> > ((progn > - (setq tmp pos) > - (backward-char) ; to the '<' > + (backward-char) ; to the '<' > (and > (save-excursion > ;; There's always an identifier before an angle > @@ -6087,7 +6085,9 @@ c-forward-<>-arglist-recur > (and keyword-match > (c-keyword-member > (c-keyword-sym (match-string 1)) > - 'c-<>-type-kwds))))))) > + 'c-<>-type-kwds)))))) > + (or subres (goto-char pos)) > + subres) > ;; It was an angle bracket arglist. > (setq c-record-found-types subres) > > @@ -6103,11 +6103,11 @@ c-forward-<>-arglist-recur > (c-record-ref-id (cons id-start id-end)) > (c-record-type-id (cons id-start id-end))))) > > - ;; At a "less than" operator. > - (t > - (forward-char) > - ))) > - t) ; carry on looping. > + ;; At a "less than" operator. > + (t > + ;; (forward-char) ; NO! We've already gone over it. > + ))) > + t) ; carry on looping. > > ((and (not c-restricted-<>-arglists) > (or (and (eq (char-before) ?&) > > > >> -- >> Michael Welsh Duggan >> (md5i <at> md5i.com) -- Michael Welsh Duggan (md5i <at> md5i.com)
bug-cc-mode <at> gnu.org
:bug#22156
; Package cc-mode
.
(Tue, 22 Dec 2015 06:14:01 GMT) Full text and rfc822 format available.Message #14 received at 22156 <at> debbugs.gnu.org (full text, mbox):
From: Michael Welsh Duggan <mwd <at> md5i.com> To: Alan Mackenzie <acm <at> muc.de> Cc: 22156 <at> debbugs.gnu.org Subject: Re: bug#22156: CC Mode 5.33 (C++/l); Strange end-of-buffer error Date: Tue, 22 Dec 2015 01:13:38 -0500
Alan Mackenzie <acm <at> muc.de> writes: > On Sun, Dec 13, 2015 at 12:15:42AM -0500, Michael Welsh Duggan wrote: >> Using emacs -Q /tmp/foo.cpp to start a new file, type the following: > >> struct foo<A<B, > >> When you type the comma, you should get an "End of buffer" error. The >> error seems to be at the point following this in the backtrace: > > Yes. Thanks again for such a succinct bug report, and for the > backtrace. For some reason I couldn't get Emacs to give me a backtrace > no matter what I tried. > >> Debugger entered--returning value: nil >> c-syntactic-re-search-forward("[<;{},|+&-]\\|[>)]" nil t t) >> * c-forward-<>-arglist-recur(nil) >> * c-forward-<>-arglist-recur(nil) >> * c-forward-<>-arglist(nil) >> * c-forward-name() >> * c-forward-type(t) >> * #[(preceding-token-end context last-cast-end) >> "`\306\211\211\211\211\211\ ... >> * apply(#[(preceding-token-end context last-cast-end) >> "`\306\211\211\211\211\211 ... >> * c-forward-decl-or-cast-1(1 nil nil) >> c-just-after-func-arglist-p(1) >> c-guess-basic-syntax() >> c-indent-line() >> c-electric-semi&comma(nil) >> funcall-interactively(c-electric-semi&comma nil) >> call-interactively(c-electric-semi&comma nil nil) >> command-execute(c-electric-semi&comma) > > >> Emacs : GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, X toolkit) >> of 2015-11-26 >> Package: CC Mode 5.33 (C++/l) >> Buffer Style: SiLK >> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes >> gen-string-delim gen-comment-delim syntax-properties 1-bit) > > [ Dump of CC Mode's state snipped, but appreciated. ] > > The cause was a simple coding error: after searching forward (for a > closing >), c-forward-<>-arglist-recur failed to set point back to the > starting place before trying the next possibility. > > Here is a patch which I hope fixes things. Please let me know whether > or not it works satisfactorily. I can confirm that this seems to fix the problem. -- Michael Welsh Duggan (md5i <at> md5i.com)
Alan Mackenzie <acm <at> muc.de>
:Michael Welsh Duggan <mwd <at> md5i.com>
:Message #19 received at 22156-done <at> debbugs.gnu.org (full text, mbox):
From: Alan Mackenzie <acm <at> muc.de> To: Michael Welsh Duggan <mwd <at> md5i.com> Cc: 22156-done <at> debbugs.gnu.org Subject: Re: bug#22156: CC Mode 5.33 (C++/l); Strange end-of-buffer error Date: Tue, 22 Dec 2015 16:39:56 +0000
Hello, Michael. On Tue, Dec 22, 2015 at 01:13:38AM -0500, Michael Welsh Duggan wrote: > Alan Mackenzie <acm <at> muc.de> writes: [ .... ] > >> Emacs : GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, X toolkit) > >> of 2015-11-26 > >> Package: CC Mode 5.33 (C++/l) > >> Buffer Style: SiLK > >> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes > >> gen-string-delim gen-comment-delim syntax-properties 1-bit) > > [ Dump of CC Mode's state snipped, but appreciated. ] > > The cause was a simple coding error: after searching forward (for a > > closing >), c-forward-<>-arglist-recur failed to set point back to the > > starting place before trying the next possibility. > > Here is a patch which I hope fixes things. Please let me know whether > > or not it works satisfactorily. > I can confirm that this seems to fix the problem. Thanks. I've committed the fix (both to SourceForge and savannah emacs-25 branch) and am marking this bug as closed. > -- > Michael Welsh Duggan > (md5i <at> md5i.com) -- Alan Mackenzie (Nuremberg, Germany).
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Wed, 20 Jan 2016 12:24:04 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.