[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-pretest-bug] Re: C indentation error.
From: |
Michael Cadilhac |
Subject: |
Re: [emacs-pretest-bug] Re: C indentation error. |
Date: |
Mon, 27 Mar 2006 20:13:37 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
Haven't seen any comments for this and my boss complains about his
<tab> key issuing errors when working on my files ;-)
Thanks in advance !
Michael Cadilhac <address@hidden> writes:
> Richard Stallman <address@hidden> writes:
>
>> > I got an error with some C indentation in macro definitions in GNU
>> > Emacs 22.0.50.34 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of
>> > 2006-03-02.
>> >
>> > Error is triggered by:
>> >
>> > With emacs -Q :
>> > In scratch, insert the following:
>> >
>> > #foo :\
>> > bar
>> >
>> > Toggle to c-mode, and try to indent the last line.
>> >
>> > I get: Invalid search bound (wrong side of point).
>>
>> However, looking at the code of search_command, I'm wondering why
>> an error could be output even if noerror is t or a symbol [1] ;
>> fixing this that way :
>>
>> The noerror argument means "no error if the search fails".
>> Invalid arguments are a different issue.
>>
>> I will clarify this in the Lisp manual.
>>
>> So your proposed change in search.c should not be installed.
>
> That's what I thought ; I was trying to get a reaction for this bug
> report ;-)
>
>> Instead, the code in CC mode should be fixed not to pass invalid
>> search bounds.
>
> After a little more search, I propose the following change :
>
> Index: lisp/progmodes/cc-engine.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-engine.el,v
> retrieving revision 1.47
> diff -c -r1.47 cc-engine.el
> *** lisp/progmodes/cc-engine.el 24 Feb 2006 15:33:02 -0000 1.47
> --- lisp/progmodes/cc-engine.el 19 Mar 2006 17:59:56 -0000
> ***************
> *** 5916,5922 ****
> ;; it shouldn't apply when we check the
> ;; preceding label.
> c-record-type-identifiers)
> ! (c-forward-syntactic-ws)
> (c-forward-label nil pte start))))))))
>
> ;; Check that the next nonsymbol token is ":". Allow '('
> --- 5916,5922 ----
> ;; it shouldn't apply when we check the
> ;; preceding label.
> c-record-type-identifiers)
> ! (c-forward-syntactic-ws pte)
> (c-forward-label nil pte start))))))))
>
> ;; Check that the next nonsymbol token is ":". Allow '('
>
> ----------------------------------------------------------------------
>
> Well... It fixes the bug, really, but it doesn't investigate the bug
> as it probably should be ; the bug _may_ be in c-forward-sws, a too
> long function for me to work on ;-)
>
> Bye !
--
Michael Cadilhac, a.k.a. Micha [mika] |
Epita/LRDE promo 2007 | )\._.,--....,'``.
123 av. de Fontainebleau | 08.70.65.13.14 | /. _.. \ _\ (` ._,.
94270 Le Kremlin Bicetre | 06.23.20.31.30 | '._.-(,_..'--(,_...`-..'
pgpkret2IQw2w.pgp
Description: PGP signature