Subject: bug#5624: 23.1; etags elisp and scheme "=" in names

From: Eli Zaretskii <[email-masked]>
Date: Sun, 11 Jun 2017 17:52:48 +0300

> From: Alex <[email-masked]>
> Date: Sat, 10 Jun 2017 19:37:49 -0600
> Cc: [email-masked]
> 
> Kevin Ryde <[email-masked]> writes:
> 
> > If an elisp defun has an "=" char in its name, etags stops at that point
> > and the TAGS file doesn't have the whole name.  Eg. a foo.el containing
> >
> >     (defun foo==bar () (message "hi"))
> >
> > M-. foo==bar gives
> >
> >     No tags containing foo==bar
> >
> > The same seems to be true of scheme, eg. a foo.scm containing a similar
> >
> >     (define foo==bar 123)
> >
> > The way the tag line comes out means a single "=" at the end of a name,
> > or any number of them at the start of a name, ends up working, but I
> > believe it's legal (if unusual) to have them in the middle of a name
> > too.
> 
> This appears to be because in etags.c, all languages use the same
> `notinname' procedure to determine a valid identifier.

Yes.  But there are exceptions from this rule, where that is deemed
necessary.  For example, Ruby_functions has this:

	 /* Ruby method names can end in a '='.  Also, operator overloading can
	    define operators whose names include '='.  */
	  while (!notinname (*cp) || *cp == '=')
	    cp++;

> Shouldn't each language (optionally) use a different procedure to
> determine the bounds of an identifier? Lisp and Scheme, for instance,
> would not have '=' in their respective `notinname' procedures.

Feel free to work on this, if you want to scratch that particular
itch.  Alternatively, just augment notinname in language-specific
support code, like some of the supported languages already do.

TIA.