emacs-devel
[Top][All Lists]
Advanced

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

Re: cc-mode Objective C method names


From: Alan Third
Subject: Re: cc-mode Objective C method names
Date: Sat, 4 Jan 2020 17:09:35 +0000

On Sat, Jan 04, 2020 at 10:48:54AM +0000, Alan Mackenzie wrote:
> Hello, Alan.
> 
> On Wed, Jan 01, 2020 at 11:27:57 +0000, Alan Third wrote:
> > And I think the methods’ names should be written something like:
> 
> > -[ClassName doSomething]
> > -[ClassName doSomethingTo:with:]
> 
> > The ‘-’ means it’s an instance method and a ‘+’ would mean it was a
> > class method.
> 
> If either ClassName or doSomethingTo is long, you might be taking up too
> much space on, for example, the first line of a commit message.  But
> you've probably already thought this through.  How long are these
> extended names in practice?

They can be extremely long, but our code doesn’t tend to have these
very long names.

I’m not sure what we could do to shorten them unless we really don’t
care very much about accuracy. For example we could drop the class
names, but we don’t limit classes to one per file, so we can easily
end up with two classes with the same method name in the same file.
Alternatively we could not list the parameter labels, but we
definitely have methods that only differ by their parameter lists in
Emacs.

FWIW, I’ve not run into any problems so far.

> > It appears to work for me, but I’m not great at Emacs lisp so I
> > thought it best to run this by the mailing list in case I’ve made any
> > boneheaded errors.
> 
> I've got just a few comments to add to Eli's and Stefan's, so ....

I was working through them when I thought of a neater way to do this,
but it’s probably less like the rest of the code in cc mode. Hopefully
it’s OK. Patch attached.
-- 
Alan Third

Attachment: v2-0001-Add-ability-to-find-ObjC-method-names.patch
Description: Text document


reply via email to

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