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

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

bug#12263: 24.2; c-at-expression-start-p


From: Alan Mackenzie
Subject: bug#12263: 24.2; c-at-expression-start-p
Date: Fri, 1 Nov 2019 11:26:36 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Leo and Stefan.

On Thu, Oct 31, 2019 at 00:21:41 +0100, Stefan Kangas wrote:
> tags 12263 + confirmed
> found 12263 26.1
> found 12263 27.0.50
> thanks

> Leo <sdl.web@gmail.com> writes:

> > 1. Emacs -q t.m
> > 2. Move point to the first '-'
> > 3. M-: (c-at-expression-start-p)
> > 4. Move point to the second '-'
> > 5. M-: (c-at-expression-start-p)

> > step 3 return nil but step 5 returns non-nil. It appears that every
> > first method declaration fails c-at-expression-start-p.

> > Leo

> > @interface ZXITFReader : ZXOneDReader

> > - (NSArray *)decodeStart:(ZXBitArray *)row;
> > - (NSArray *)decodeEnd:(ZXBitArray *)row;

> > @end

> I can reproduce this on current master and 26.1.

Yes.

c-at-expression-start-p is a strange function.  It is not interactive,
yet is not used at all by CC Mode.  A web search found no uses of it
(though I don't really trust web searches).

The function's documentation also defines "expression" somewhat
idiosyncratically as:

    "An \"expression\" here is a bit different from the normal language
    grammar sense: It's any sequence of expression tokens except commas,
    unless they are enclosed inside parentheses of some kind."

.  With that definition of "expression", there is no bug here, since
there is nothing before that "-" to terminate any "previous expression".
However, this redefinition of "expression" hardly seems defendable - it
seems to have been made mainly for the convenience in coding.

Leo, can you remember at all what (if anything) you were using this
function for?

Given that it appears to be wholly unused, I'm inclined to mark this
function as obsolete or deprecated, and then to remove it later.  It
doesn't seem to be worth the trouble to make it work properly.  The same
might also apply to the function c-at-statement-start-p.

> Best regards,
> Stefan Kangas

-- 
Alan Mackenzie (Nuremberg, Germany).





reply via email to

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