From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: declare function/macro private Date: Sun, 06 Jun 2021 20:12:49 +0200 Message-ID: <87v96qrguz.fsf@gnu.org> References: <0278C47F-42CE-45C4-B789-83C57DF1A191@bydasein.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35829"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.13; emacs 28.0.50 Cc: "Paul W. Rankin" , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 06 20:25:39 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lpxSt-00094Z-3M for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 20:25:39 +0200 Original-Received: from localhost ([::1]:45674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpxSs-0002Mv-1O for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Jun 2021 14:25:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpxS2-0001fe-3a for emacs-devel@gnu.org; Sun, 06 Jun 2021 14:24:47 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56524) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpxRz-00071n-93; Sun, 06 Jun 2021 14:24:44 -0400 Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:39373) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpxRz-0001F7-5k; Sun, 06 Jun 2021 14:24:43 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailauth.nyi.internal (Postfix) with ESMTP id 7B5AC27C0054; Sun, 6 Jun 2021 14:24:42 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 06 Jun 2021 14:24:42 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedthedguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvffuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe evveeikeetkeeviefgfeffiedvteeguddvffeuueduveegtddthedvhfeuveffhfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 6 Jun 2021 14:24:40 -0400 (EDT) In-reply-to: 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270494 Archived-At: Stefan Monnier writes: > I think the "--" convention actually includes an extra information > compared to yours which could be useful here: we could warn for uses > of "foo--" if and only if the use appears in something whose name > doesn't start with "foo-". > > IOW, use the string before the "--" as the definition of the "library" > (so that would support cases where a library is spread over several > files, as well as the case where a single file contains "internal > libraries"). If my package was structured like foo.el foo-search.el foo-parse.el I'd find it quite natural to name a private function in foo-search.el `foo-search--do-stuff'. Of course, it's ok if my `foo-base-do-stuff' function from foo.el calls it but it would trigger a warning with your approach because the "library" would be foo-search, no? Bye, Tassilo