GNU bug report logs - #5395
cc-mode raises on typing '>' in #include

Previous Next

Packages: cc-mode, emacs;

Reported by: Daniel Colascione <daniel <at> censorshipresearch.org>

Date: Sat, 16 Jan 2010 00:24:02 UTC

Severity: normal

Merged with 5426

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 5395 in the body.
You can then email your comments to 5395 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


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5395; Package emacs. (Sat, 16 Jan 2010 00:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Colascione <daniel <at> censorshipresearch.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 16 Jan 2010 00:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Colascione <daniel <at> censorshipresearch.org>
To: bug-gnu-emacs <at> gnu.org
Subject: cc-mode raises on typing '>' in #include
Date: Fri, 15 Jan 2010 19:17:42 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Check out latest Emacs BZR.
Start with -Q
Visit an arbitrary .cpp file
Type #include <foo>

After typing the closing '>', an error is raised. Here is the traceback

Debugger entered--Lisp error: (args-out-of-range 15 16)
  remove-text-properties(15 16 (category nil))
  (let ((pos here-cpp-end)) (remove-text-properties pos (1+ pos) (quote
...)))
  (c-clear-char-property here-cpp-end (quote category))
  (progn (c-clear-char-property here-cpp-beg (quote category))
(c-clear-char-property here-cpp-end (quote category)))
  (c-clear-cpp-delimiters here-cpp-beg here-cpp-end)
  (progn (c-clear-cpp-delimiters here-cpp-beg here-cpp-end)
(c-with-cpps-commented-out (c-parse-state-1)))
  (unwind-protect (progn (c-clear-cpp-delimiters here-cpp-beg
here-cpp-end) (c-with-cpps-commented-out ...)) (and (not modified)
(buffer-modified-p) (set-buffer-modified-p nil)))
  (let* ((modified ...) (buffer-undo-list t) (inhibit-read-only t)
(inhibit-point-motion-hooks t) before-change-functions
after-change-functions deactivate-mark buffer-file-name
buffer-file-truename) (unwind-protect (progn ... ...) (and ... ... ...)))
  (c-save-buffer-state nil (c-clear-cpp-delimiters here-cpp-beg
here-cpp-end) (c-with-cpps-commented-out (c-parse-state-1)))
  (unwind-protect (c-save-buffer-state nil (c-clear-cpp-delimiters
here-cpp-beg here-cpp-end) (c-with-cpps-commented-out ...))
(c-save-buffer-state nil (c-set-cpp-delimiters here-cpp-beg here-cpp-end)))
  (c-with-all-but-one-cpps-commented-out here-cpp-beg here-cpp-end
(c-parse-state-1))
  (if (and here-cpp-beg (> here-cpp-end here-cpp-beg))
(c-with-all-but-one-cpps-commented-out here-cpp-beg here-cpp-end
(c-parse-state-1)) (c-with-cpps-commented-out (c-parse-state-1)))
  (progn (c-suppress-<->-as-parens) (if (and here-cpp-beg ...)
(c-with-all-but-one-cpps-commented-out here-cpp-beg here-cpp-end ...)
(c-with-cpps-commented-out ...)))
  (unwind-protect (progn (c-suppress-<->-as-parens) (if ... ... ...))
(c-restore-<->-as-parens))
  (c-with-<->-as-parens-suppressed (if (and here-cpp-beg ...)
(c-with-all-but-one-cpps-commented-out here-cpp-beg here-cpp-end ...)
(c-with-cpps-commented-out ...)))
  (prog1 (c-with-<->-as-parens-suppressed (if ... ... ...)) (setq
c-state-old-cpp-beg here-cpp-beg c-state-old-cpp-end here-cpp-end))
  (let (here-cpp-beg here-cpp-end) (save-excursion (when ... ... ...))
(prog1 (c-with-<->-as-parens-suppressed ...) (setq c-state-old-cpp-beg
here-cpp-beg c-state-old-cpp-end here-cpp-end)))
  c-parse-state()
  (or c-state-cache (c-parse-state))
  (c-safe-position (point) (or c-state-cache (c-parse-state)))
  (or (c-safe-position (point) (or c-state-cache ...)) 0)
  (max (or (c-safe-position ... ...) 0) (point-min))
  (setq safe-pos (max (or ... 0) (point-min)) safe-pos-list (list safe-pos))
  (if (setq safe-pos (car-safe safe-pos-list)) nil (setq safe-pos (max
... ...) safe-pos-list (list safe-pos)))
  (unless (setq safe-pos (car-safe safe-pos-list)) (setq safe-pos (max
... ...) safe-pos-list (list safe-pos)))
  (let ((pos ...) safe-pos state pps-end-pos) (while (and safe-pos-list
...) (setq safe-pos-list ...)) (unless (setq safe-pos ...) (setq
safe-pos ... safe-pos-list ...)) (while (progn ... ...) (setq safe-pos
... safe-pos-list ...)) (if (elt state 1) (setq safe-pos ...
safe-pos-list ...)) (if (or ... ...) (elt state 8)))
  (save-excursion (let (... safe-pos state pps-end-pos) (while ... ...)
(unless ... ...) (while ... ...) (if ... ...) (if ... ...)))
  c-ssb-lit-begin()
  (setq lit-beg (c-ssb-lit-begin))
  (cond ((setq lit-beg ...) (goto-char lit-beg) t) ((and paren-level
...) (if ... ... ... nil)) ((c-beginning-of-macro limit) (if ... t ...
nil)))
  (let ((pos ...) state-2 pps-end-pos) (cond (... ... t) (... ...) (...
...)))
  (and (< (skip-chars-backward skip-chars limit) 0) (let (... state-2
pps-end-pos) (cond ... ... ...)))
  (while (and (< ... 0) (let ... ...)))
  (progn (while (and ... ...)) (> (point) (progn ... ...)))
  (while (progn (while ...) (> ... ...)))
  (let ((start ...) state-2 safe-pos-list start-macro-beg lit-beg
(paren-level-pos ...)) (while (progn ... ...)) (/= (point) start))
  c-syntactic-skip-backward("^<;}" nil t)
  c-electric-lt-gt(nil)
  call-interactively(c-electric-lt-gt nil nil)


In GNU Emacs 23.1.91.1 (x86_64-apple-darwin10.2.0, NS apple-appkit-1038.25)
 of 2010-01-15 on edith.local
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--with-ns''

Important settings:
  value of $LC_ALL: en_US.UTF-8
  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: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: C++/l

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
C-x C-f <backspace> <M-backspace> <M-backspace> <M-backspace>
<M-backspace> <M-backspace> l i s <tab> <tab> <tab>
c c <tab> <backspace> <backspace> p r o <tab> g m <tab>
c c <tab> <tab> <tab> e n g <tab> <return> <escape>
x e v a l - b f <tab> <backspace> u <tab> <return>
M-x C-g C-x C-f C-a C-k / t m p / f o o . c p p <return>
# i n c l u d e SPC < f o o > <escape> x t o g g l
e d - <backspace> <backspace> - e <backspace> d e <tab>
<return> e r <tab> <return> C-a C-x k y <backspace>
<return> y e s <return> C-x C-f <up> <return> # i n
c l u d e SPC < f o o > <down-mouse-1> <mouse-1> <wheel-up>
<double-wheel-up> <triple-wheel-up> <triple-wheel-up>
<help-echo> <down-mouse-1> <mouse-1> C-x h M-w <help-echo>
<down-mouse-1> <mouse-1> q q <escape> x r e p o r t
- - e m <tab> <return>

Recent messages:
Quit
let: Args out of range: 15, 16
Making completion list...
Debug on Error enabled globally
Entering debugger...
Mark set [2 times]
Saved text until "interactively(c-electric-lt-gt nil nil)
"
Entering debugger...
Back to top level.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message sendmail ecomplete rfc822 mml mml-sec
password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231
rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc
time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
hashcash mail-utils emacsbug debug cus-start cus-load cc-mode cc-fonts
cc-menus cc-cmds cc-styles cc-align cc-engine cc-langs cl cl-19 cc-vars
cc-defs regexp-opt cc-bytecomp vc-dispatcher vc-bzr sha1 hex-util
help-mode view tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win
easymenu tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mldrag 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 loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind ns multi-tty emacs)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAktRBaYACgkQ17c2LVA10VsrOwCgwyddVcYGAcOf5HyuiihOotSe
zKkAnjdB/a/dqQKoNaKIxR69d4ZPVYiY
=SRwH
-----END PGP SIGNATURE-----





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5395; Package emacs. (Mon, 18 Jan 2010 17:01:02 GMT) Full text and rfc822 format available.

Message #8 received at 5395 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Alan Mackenzie  <acm <at> muc.de>
Cc: 5395 <at> debbugs.gnu.org, Daniel Colascione <daniel <at> censorshipresearch.org>
Subject: Re: cc-mode raises on typing '>' in #include
Date: Mon, 18 Jan 2010 12:00:17 -0500
> Check out latest Emacs BZR.
> Start with -Q
> Visit an [empty] .cpp file
> Type #include <foo>
>
> After typing the closing '>', an error is raised. Here is the traceback

Actually, I get an error as soon as I type #.

Alan, I think this is due to your 2009-12-03 changes to the
c-parse-state mechanism.  Could you take a look?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5395; Package emacs. (Mon, 18 Jan 2010 20:08:01 GMT) Full text and rfc822 format available.

Message #11 received at 5395 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 5395 <at> debbugs.gnu.org, Daniel Colascione <daniel <at> censorshipresearch.org>
Subject: Re: cc-mode raises on typing '>' in #include
Date: Mon, 18 Jan 2010 20:03:47 +0000
Hello, Yidong and Daniel,

On Mon, Jan 18, 2010 at 12:00:17PM -0500, Chong Yidong wrote:
> > Check out latest Emacs BZR.
> > Start with -Q
> > Visit an [empty] .cpp file
> > Type #include <foo>

> > After typing the closing '>', an error is raised. Here is the traceback

> Actually, I get an error as soon as I type #.

> Alan, I think this is due to your 2009-12-03 changes to the
> c-parse-state mechanism.  Could you take a look?

I feel the error is caused by the bug in

    Subject: (insert ?\n) spuriously calls before-change-functions twice.

which I reported on 2010-01-05 and have since fixed.  I haven't yet been
able to commit the fix due to not yet understanding bzr well enough.
Soon!

-- 
Alan Mackenzie (Nuremberg, Germany).




bug reassigned from package 'emacs' to 'emacs,cc-mode'. Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 18 Jan 2010 23:44:02 GMT) Full text and rfc822 format available.

Forcibly Merged 5395 5426. Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 20 Jan 2010 00:23:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5395; Package emacs,cc-mode. (Wed, 20 Jan 2010 10:29:02 GMT) Full text and rfc822 format available.

Message #18 received at 5395 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Daniel Colascione <daniel <at> censorshipresearch.org>, 5395 <at> debbugs.gnu.org
Subject: Re: bug#5395: cc-mode raises on typing '>' in #include
Date: Wed, 20 Jan 2010 10:34:37 +0000
Hello, Daniel,

On Fri, Jan 15, 2010 at 07:17:42PM -0500, Daniel Colascione wrote:

> Check out latest Emacs BZR.
> Start with -Q
> Visit an arbitrary .cpp file
> Type #include <foo>

> After typing the closing '>', an error is raised. Here is the traceback

[ .... ]

Thanks for the traceback.  It was useful.

I'm not sure how you managed to type beyond the '#' without getting this
error.  ;-(

Anyhow, I've committed a fix for this (or a very similar) bug into
savannah.  Could you please update your bzr Emacs and see if the bug has
gone.

Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).




bug closed, send any further explanations to Daniel Colascione <daniel <at> censorshipresearch.org> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Wed, 20 Jan 2010 15:26:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <bug-gnu-emacs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 18 Feb 2010 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.