GNU bug report logs - #12263
24.2; c-at-expression-start-p

Previous Next

Packages: cc-mode, emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Thu, 23 Aug 2012 01:34:02 UTC

Severity: minor

Tags: confirmed

Found in versions 26.1, 25.0.95, 27.0.50, 24.2

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Leo <sdl.web <at> gmail.com>, Stefan Kangas <stefan <at> marxist.se>
Cc: 12263 <at> debbugs.gnu.org
Subject: bug#12263: 24.2; c-at-expression-start-p
Date: Fri, 1 Nov 2019 11:26:36 +0000
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 <at> 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).




This bug report was last modified 5 years and 17 days ago.

Previous Next


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