From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master 6e796b5: Stop project-root from going into infinite recursion Date: Wed, 17 Mar 2021 18:29:34 -0400 Message-ID: References: <20210317164927.28196.12402@vcs0.savannah.gnu.org> <20210317164928.C2C11209AA@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35605"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 17 23:30:29 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 1lMegN-0009BB-Vf for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Mar 2021 23:30:27 +0100 Original-Received: from localhost ([::1]:33078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMegM-0001A3-UL for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Mar 2021 18:30:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMefc-0000jE-SB for emacs-devel@gnu.org; Wed, 17 Mar 2021 18:29:40 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43533) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMefa-0005BP-Iw for emacs-devel@gnu.org; Wed, 17 Mar 2021 18:29:40 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4945980602; Wed, 17 Mar 2021 18:29:37 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6E9A4801F1; Wed, 17 Mar 2021 18:29:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1616020175; bh=efQAx5Ngisr5Yn6zQkDkB0afKd75pgDcJgWWuGXbBOA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=D4eiRj/4u9Of69+/iFc7qjdbzSmUA8PKEG/VqDuFelpOFBuHcv6vBPiCTrHnPl4vG uA51VM2brlfRlCJoTSJGw1AyUS0FG7RbXzI9JeA23QEnSc0k7QtkFWEYc/124ueG4x aR9SHfGnSU7p+I5nzQbWicW+wEfrzABYVMqSMAw6OpxxHEN5cAnPxXAOBb75zrVTka 6TqDVFny77bnOujHhVdBmvwLMok98jjMLGUwoQwg1LnFtmNZ5YEE33a+/nyky7YqPw IOv2V+X8LOq2fsTeIiYR7vOm1uu7rtP7O93pS3IFJHjKTcKugDSHZ93xYHORRzwrAN wLMBX+PMXELOg== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1037C1200A1; Wed, 17 Mar 2021 18:29:35 -0400 (EDT) In-Reply-To: (Dmitry Gutov's message of "Wed, 17 Mar 2021 23:52:06 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:266535 Archived-At: >> I think `cl-call-next-method` is a better choice. > If you're sure about that. > The idea here was, some prospective backend author might look at the error > symbol and make a decision on how to fix the problem based on it. > And "you need to implement this method" seems better expressed with "No > applicable method" rather than with "No next method". I see. I consider the difference between the two as an error in CLOS, but I didn't have the courage to remove it in cl-generic.el ;-) FWIW, you could also get what you want with something like: (cl-defgeneric project-root (project) "Return root directory of the current project. It usually contains the main build file, dependencies configuration file, etc. Though neither is mandatory. The directory name must be absolute.") (cl-defmethod project-root (project &context (project--within-roots-fallback (eql nil))) (car (project-roots project))) This way there indeed won't be any applicable method when project--within-roots-fallback is non-nil ;-) Stefan