From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: cc-mode Objective C method names Date: Thu, 2 Jan 2020 11:02:30 +0000 Message-ID: <20200102110230.GA59584@breton.holly.idiocy.org> References: <20200101112757.GA41966@breton.holly.idiocy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="234793"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 02 12:02:46 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 1imyFY-000yvM-J4 for ged-emacs-devel@m.gmane.org; Thu, 02 Jan 2020 12:02:44 +0100 Original-Received: from localhost ([::1]:39672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imyFW-00044a-OC for ged-emacs-devel@m.gmane.org; Thu, 02 Jan 2020 06:02:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41274) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imyFQ-00043P-1k for emacs-devel@gnu.org; Thu, 02 Jan 2020 06:02:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imyFO-0008Lk-Uo for emacs-devel@gnu.org; Thu, 02 Jan 2020 06:02:35 -0500 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:42494) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1imyFO-0008LH-Mi for emacs-devel@gnu.org; Thu, 02 Jan 2020 06:02:34 -0500 Original-Received: by mail-wr1-x436.google.com with SMTP id q6so38783433wro.9 for ; Thu, 02 Jan 2020 03:02:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=5jE6b2dJJc/fo7izUWfKwRikqkGvW1iYexpMrejflKs=; b=us4OKRnq4PK1E1zTLK/GWxLyq8UcEC4iqrx+By4ZHDA08yf+6SmdSVdGeWSnrKGwXF J2H7IJzRw8rFNcaLkVREFVzfRWMDjJa2i8rzLPmY4NCull62rHymz04R0ot4bT1Zw4OI VihvRBkLNLBeQ6Pxcrhj1b0JbIFODGnd4cvZ5lobR49ghmkJuIm+METui0taQ93QDefu EC13O7ndQzp8j8O3oI8nbsId4VjStro0jETknuwgjZKgbYzJAxiWU4kmIPZ46EzNCm5k AArW5EU8ty2QJjlyu50eVxwSlV2Ug7FSbr90b0uSBwt8JMAZMh4K9UTHEMnSkhqEcewn +NMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=5jE6b2dJJc/fo7izUWfKwRikqkGvW1iYexpMrejflKs=; b=Y9q/74MiLj5WZnGZ3Y6JCUDlkSEJUJSCJI/C/G8AF/0D+holXFn6f7nh4JpYDKRnV+ fcLtzSHVxVhz8f4Fdb7Xp0Ni536RBN0S5DLKW8FvcSwLEEmmjAUf8W18Qka+jSuLtxZ6 yOYULXU4BGZKyzLv616RH0uCVQHwB0LCRFcaxT/NqcnR3tLWEpLFpfi+QmXs8rCrHY33 WBPD/XENufjAHvnlqwxDhA+9iiE1iklp/rSTwS3BOhuEiRREm6vaM0R8R7NwlOXcXBZ/ PsJBhwEtZRokbeQze0xRhB0nULBVkMZtEVtjIj3iVz65g4TI0jGl9beV3BPypKvbe3wA aniw== X-Gm-Message-State: APjAAAUVm6ZbGa7Ug3l3+1AgJowbfKjmguBGmbUHLvbRAQYRkIPKBruf n3FUgDqxKmr6ks/s1/Rv/4w= X-Google-Smtp-Source: APXvYqwSQlxJ06lSJcliKavDmnyfxWnTzEUCN2MimW554HoN2rfHjNfykqgFK9uh7Gs2C+nLZUwzaA== X-Received: by 2002:adf:ff84:: with SMTP id j4mr88516948wrr.27.1577962953063; Thu, 02 Jan 2020 03:02:33 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-3c68-1d99-a68c-dce7.holly.idiocy.org. [2001:8b0:3f8:8129:3c68:1d99:a68c:dce7]) by smtp.gmail.com with ESMTPSA id m7sm8054990wma.39.2020.01.02.03.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2020 03:02:32 -0800 (PST) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 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:243856 Archived-At: On Wed, Jan 01, 2020 at 10:29:42AM -0500, Stefan Monnier wrote: > > And I think the methods’ 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. I think it’s the normal way, I’m not very clear as there are very few examples of people referring to methods without the class being already known. For example Apple’s documentation only ever refers to methods like this: - initWithFrame: or like this: - (instancetype)initWithFrame:(NSRect)frameRect; but in neither case does it tell you which class it’s from, you have to pick it up from other clues on the page. > > The ‘-’ means it’s an instance method and a ‘+’ 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 happens quite often, but not in the Emacs code base, which is presumably the only place this is of use. So I’ll get rid of that. > > 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. > > 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. I’ll wait a while and see if he has any comments. > > + (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) Thanks! -- Alan Third