emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C indentation error.


From: Michael Cadilhac
Subject: Re: C indentation error.
Date: Sun, 19 Mar 2006 19:07:32 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

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 | '._.-(,_..'--(,_...`-..'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]