From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: cc-mode Objective C method names Date: Wed, 01 Jan 2020 10:29:42 -0500 Message-ID: References: <20200101112757.GA41966@breton.holly.idiocy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="216436"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Emacs-Devel devel To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 01 16:30:27 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1imfx3-000uAE-80 for ged-emacs-devel@m.gmane.org; Wed, 01 Jan 2020 16:30:25 +0100 Original-Received: from localhost ([::1]:59224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imfx2-00029X-2c for ged-emacs-devel@m.gmane.org; Wed, 01 Jan 2020 10:30:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44317) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imfwW-0001cT-1j for emacs-devel@gnu.org; Wed, 01 Jan 2020 10:29:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imfwT-0005bo-SK for emacs-devel@gnu.org; Wed, 01 Jan 2020 10:29:50 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55966) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1imfwT-0005Zc-Km for emacs-devel@gnu.org; Wed, 01 Jan 2020 10:29:49 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C17E281099; Wed, 1 Jan 2020 10:29:48 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3855B8033D; Wed, 1 Jan 2020 10:29:47 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1577892587; bh=27+2TY7CIe7DPchUSxtIIeCA0rY7Md16RL8HCupi1NA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=nFElZzBST6zd3StWMGZnUNI+vlbTcbTAvPTiAGPZpIIfOUSN0Sc+Jq1QATXfQDCAr xMbhZ1jqNMaHl7h6bAt93PLvet8MtdfJ1gwfJ/ZnF8BYrZxHFFZpFy3Q7NLu7bwsf+ ob9wxA/qVJh/KZ7HlUG04+I3vsReQpJZVvYhw06ABONKNWOiVclRvqmwQ4jI5J2bMf lRF/i9ti/msX0edOe6DYtxoSHX7zlvc8HpDnmLfNmMww6uTeHarbo4ai4IbdOTEcMu TPM6Njbt3u1l/tqLlhGGNlAVWO4IzZvk0PSAV+hxWIjn0sEW50upCd6ZqKxN8a8Tki WWlLMxtI16VJw== Original-Received: from alfajor (reservations.lactaureau.com [208.77.84.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DA086120C4F; Wed, 1 Jan 2020 10:29:46 -0500 (EST) In-Reply-To: <20200101112757.GA41966@breton.holly.idiocy.org> (Alan Third's message of "Wed, 1 Jan 2020 11:27:57 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243835 Archived-At: > And I think the methods=E2=80=99 names should be written something like: > > -[ClassName doSomething] > -[ClassName doSomethingTo:with:] These names look very odd to me (as a non-ObjC coder, I find the brackets rather ugly and useless for example), but if they're the "normal" way to refer to them, then I guess it's fine. > The =E2=80=98-=E2=80=99 means it=E2=80=99s an instance method and a =E2= =80=98+=E2=80=99 would mean it was a > class method. Might be best not to include it: how often do you have both a class method and an instance method with the same name? [ E.g. in Elisp we use the function names and variable names as is, without clarifying if it's a function name or a variable name. ] > It appears to work for me, but I=E2=80=99m not great at Emacs lisp so I > thought it best to run this by the mailing list in case I=E2=80=99ve made= any > boneheaded errors. This is the code of the other Alan and I'm not very familiar with this part of CC-mode, so don't take my opinion too seriously, but it looks acceptable to me. > + (if (looking-at "(") > + (c-forward-token-2 2 t) > + (c-forward-token-2 1 t)) AKA (c-forward-token-2 (if (looking-at "(") 2 1) t) -- Stefan