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: [elpa] externals/detached 827e3d64fe: Bug fix: Incorrect initialization of projectile Date: Mon, 22 Aug 2022 16:15:52 -0400 Message-ID: References: <166119825097.26859.927185263202609197@vcs2.savannah.gnu.org> <20220822195731.3F972C0088A@vcs2.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="11979"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Niklas Eklund Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 22 22:17:53 2022 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 1oQDrt-0002ut-1k for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Aug 2022 22:17:53 +0200 Original-Received: from localhost ([::1]:44736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQDrr-0004Ak-18 for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Aug 2022 16:17:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQDq8-0003RQ-8f for emacs-devel@gnu.org; Mon, 22 Aug 2022 16:16:05 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQDq2-0002du-Ia for emacs-devel@gnu.org; Mon, 22 Aug 2022 16:16:03 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DBAB2806AA; Mon, 22 Aug 2022 16:15:55 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5D1C880263; Mon, 22 Aug 2022 16:15:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1661199354; bh=1qwXqfezs+bl3Oh3esnOZyclciKAoPxU8lyjGRyN5KY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=peCxWjEkIEqO8nNEZcTSyw+v/gPfVq8fa7f1CRHVutnNZZwiVF+UKFZvh8P3vL3FX qYSMH6gA7XFSSbKwpaIfjPTU7oA92zcAPlh56zLPpqKBFZBCKBVMDtMu5NlljR2uSM Dlr5Zf3u1aCkXNTo9iLhYc+cWnjKYFgr+FRcEvoaA33yx+3cPLmFJfUIT2/AWWboLS ohzG53ymTT84d5gGItwVNXiTepw4JJ+Hi0MPxUxDmCKKPFahLgEbAKFw8jt+ixDYEH +5tY/ASnHzSjZWDfeZJgXDLS4Gp9rXuG1xKen93kaOH7U8w030/mXmqz31s/dO+DcR 7XSrbWc1EXC3A== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 208A112041B; Mon, 22 Aug 2022 16:15:54 -0400 (EDT) In-Reply-To: <20220822195731.3F972C0088A@vcs2.savannah.gnu.org> (ELPA Syncer's message of "Mon, 22 Aug 2022 15:57:31 -0400 (EDT)") 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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:293816 Archived-At: Hi Niklas, > @@ -150,7 +150,7 @@ > > (defun detached-init--projectile () > "Initialize integration with `projectile'." > - (when (functionp #'projectile) > + (when (featurep 'projectile) > (advice-add 'projectile-run-compilation > :override #'detached-extra-projectile-run-compilation))) > I suspect that you can then also remove the corresponding `declare-function`. More importantly, `advice-add` can be used on a symbol whose function is not yet defined, so you can skip the `when` test altogether. The same applies to the following: (when (functionp #'dired-rsync) (advice-add #'dired-rsync--do-run :override #'detached-extra-dired-rsync))) where my stylistic checker additionally complains about: - #' kind of says that `dired-rsync` is a function, so using `functionp` on it is a bit weird. Usually, code does (fboundp 'dired-rsync) instead. - `advice-add` takes as first argument a symbol. That symbol is expected to contains a function, indeed, but it can't just take any function (e.g. a (lambda ...) would be an error), for that reason I think using ' rather than #' is preferable (e.g. if you consider that Common Lisp (and `cl-flet`) will treat #' as a reference to the function stored in the symbol (much like `symbol-function`) rather than as the symbol itself). Stefan