From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: master 6e796b5: Stop project-root from going into infinite recursion Date: Thu, 18 Mar 2021 02:37:21 +0200 Message-ID: <149b5d9e-37d1-ea9e-f39d-38c2707588b3@yandex.ru> References: <20210317164927.28196.12402@vcs0.savannah.gnu.org> <20210317164928.C2C11209AA@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36257"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 18 01:38:14 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 1lMgg1-0009Jm-Rj for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Mar 2021 01:38:13 +0100 Original-Received: from localhost ([::1]:43344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMgg0-000616-UH for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Mar 2021 20:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMgfH-0005av-Kj for emacs-devel@gnu.org; Wed, 17 Mar 2021 20:37:27 -0400 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:40600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMgfF-0006Nu-SI for emacs-devel@gnu.org; Wed, 17 Mar 2021 20:37:27 -0400 Original-Received: by mail-wm1-x331.google.com with SMTP id y124-20020a1c32820000b029010c93864955so4384696wmy.5 for ; Wed, 17 Mar 2021 17:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UkyGWOotn3bc5tiXxOvLAOz6le0/6ccYozHQvCIBLSA=; b=EiK+qSiRJiwLiJh019mMndHHiesrq2icx42nCWBeHusn8iLmkRSK1EHDb0yZXpmqfq 23XzGt6+vFucI961v4SvoomCeu1zznxb5UZoRUTkbS3I6QENvBtzsDiqskPJ47m2biK1 tTcBcqpPmeOesd9y0pZIjF8Iwab2/Og7pyKCkY26NVlWGPxq/4l8qqZUoaT28gSjSFXr YBhbTBDNx5wkKgxeJ6qa6lTuYF5+crflYj31YG9NYRqA7XfUc+lMTyI5RRKB0GTAcVEE VRzI5Rrih6XUMyCwJfq80kXlcGkEkAvt9jB+HdXMqjmm9QxKuPm7id98l0GvecKqi6h8 deZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UkyGWOotn3bc5tiXxOvLAOz6le0/6ccYozHQvCIBLSA=; b=nQEdiv+P9td0LpZe/GcSkCWwzOXldxCa/52xW3iStavfTWpakG+UHsjpPXnEBd1y8w 0RwzmCrlGiexMQDtTU6lp4E6MBap94cEFFkmBYAmZ1R4uo3XaPv8vogK1gdiTXqj0e8w LkeH0oADbm9wlLHbQviEptHmAiV+6FxADRk2SrdkeLGLmqF3axOIVsGjEM6tEVUblR9Q D/BUSCurZmoK3h5H0ovPxcKC8RNASzIjkseFdL4sr1tPNvtTinckftSAxMu5QCwnh92D 7mBLQT/OgP5aCDmxHf68ndxFo9PYeuLRqJZgBWqkDmAkCoHeHQa0W3QJt4K9pgMcYaHI EPSQ== X-Gm-Message-State: AOAM532sl2hQKS202Q9nvW+OkRGnmahgjrUrbXxj4ptnf9fBcrRaDNCV 875Bo+yXZuqdbOLtLOk35uBcgVIKK44= X-Google-Smtp-Source: ABdhPJzz8wZC9HD50NQII9vYM0IVeCW950vCm79H/6Se13N4o4RdsEAaf9HWnxvxBQ/DHT/eGY6P6g== X-Received: by 2002:a7b:c357:: with SMTP id l23mr1110589wmj.152.1616027844169; Wed, 17 Mar 2021 17:37:24 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id v2sm4431718wmj.1.2021.03.17.17.37.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Mar 2021 17:37:23 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=raaahh@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:266538 Archived-At: On 18.03.2021 00:29, Stefan Monnier wrote: > 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;-) I'm no CLOS expect, so I was choosing purely on how the names sound. > 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;-) That's a neat suggestion, thanks!