From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#63625: 29.0.90; package-install inserts package directory into load-path twice. Date: Mon, 22 May 2023 17:36:09 +0200 Message-ID: <877ct0js46.fsf@gmail.com> References: <4ACD9E26-B5A6-412E-8DFC-C09C05A4EACD@mac.com> <871qj8lp8u.fsf@gmail.com> <87bkicjvne.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13846"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , 63625@debbugs.gnu.org, todd smith To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 22 17:37:37 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1q17bN-0003Rv-Fw for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 May 2023 17:37:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q17aq-0005Jn-C0; Mon, 22 May 2023 11:37:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q17ao-00057C-Go for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 11:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q17ao-0002M4-3E for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 11:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q17an-000534-Um for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 11:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 May 2023 15:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63625 X-GNU-PR-Package: emacs Original-Received: via spool by 63625-submit@debbugs.gnu.org id=B63625.168476977919346 (code B ref 63625); Mon, 22 May 2023 15:37:01 +0000 Original-Received: (at 63625) by debbugs.gnu.org; 22 May 2023 15:36:19 +0000 Original-Received: from localhost ([127.0.0.1]:35969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q17a6-00051y-Rz for submit@debbugs.gnu.org; Mon, 22 May 2023 11:36:19 -0400 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:47176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q17a4-00051k-MM for 63625@debbugs.gnu.org; Mon, 22 May 2023 11:36:17 -0400 Original-Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-3f606a89795so8993225e9.2 for <63625@debbugs.gnu.org>; Mon, 22 May 2023 08:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684769771; x=1687361771; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ULU4u6uuvBHr3Gz80qcmMw+MvA/QkpJdBeCjgvsUO8Y=; b=Kx7rH+3CDO2StDGyPLZ7n9xgFiD01s60lAV7bFE0K4wGq1D9DmFi3KrtX6HCyuuEs1 Jil9XzxibcmVm5seNfxgyUpR4C8yFijQrRiNhcbeDlDwd4z7/GMuZl1LbMB0mABQTiQD GnsfwP0KN5BaceuhnE56Nw8KFb8cE5sdhT0qt7E7CGkJQMlPRLouOyaPP0HKpVmxCkli PKDnPlss/DDIRZ1GsXDVEihOV7jTAdMCjJTnXgBhNPb4OanrB5Fi+G3bzqC8C6BAiB/8 mZ+w+gpyP3OaHlEeKgyyiUexVAMFpzwBCgrgc1/vprsTHss6mFtIL1f71XIUSG/n0IOW 67UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684769771; x=1687361771; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ULU4u6uuvBHr3Gz80qcmMw+MvA/QkpJdBeCjgvsUO8Y=; b=fySJwzWfzuUyHWI3iTjOFsBfpxgXdvxurv97/gOy1GF+kadbrp+MEj+NGcgtOCOPvd fsNuGzr87qbnl+LYrRWKOhJY0zWFZngzc+jkeCyfFQDkB2D8FQ8qSK1uiEEaPFox4j7L UYOepsMCYcY3uPCO1ZAu8u2Gs7qTpwZsO1qTV2ECgYDsfD329mIP+CA56zZ9y9CwZ3aJ 7psz9s8jpxJ908AHaZsn5arjh30+1LDcolMLd4LgCLhmkMOjwJHoKmNSoybVXVL0ssny /SVsrzXgtd2RukieKQl5gCILU9+UwRD245BvnMYzZF5tjNkgj/s+JG8Fs959/0L1+2Lv vcig== X-Gm-Message-State: AC+VfDwKFy4CFV+zYY834euL+qPpTS6AMqvtDNg9vZixCUmOxe47yDAZ Y4MvgMDdYe9Ahi0eRKSRqOo= X-Google-Smtp-Source: ACHHUZ5lhGDIGTA4NVvMa6pUu9Ej0FilUYtN5zo/+4EO2J9m9JF2lHKtXTrRCZhCRWZz+u35MaEbxg== X-Received: by 2002:a7b:cc15:0:b0:3f4:20ec:7601 with SMTP id f21-20020a7bcc15000000b003f420ec7601mr8249118wmh.34.1684769770603; Mon, 22 May 2023 08:36:10 -0700 (PDT) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id n16-20020a1c7210000000b003f6042d6d92sm4099020wmc.46.2023.05.22.08.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 08:36:09 -0700 (PDT) In-Reply-To: (Stefan Monnier via's message of "Mon, 22 May 2023 11:04:46 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262164 Archived-At: >>>>> On Mon, 22 May 2023 11:04:46 -0400, Stefan Monnier via "Bug reports f= or GNU Emacs, the Swiss army knife of text editors" = said: >> `file-name-directory' will return nil for names with no slashes in >> them, but I don=CA=BCt know if that=CA=BCs possible here. Stefan> I think `load-file-name` is always absolute, so I think we shou= ld be Stefan> safe, but that's the question, yes. This is where we quote Knuth on the difference between proof and testing :-) >> I *think* we can use `when-let*' here, since subr.el is preloaded. Stefan> Please don't, it's too recently introduced IMO and such generat= ed files Stefan> may be loaded in older Emacsen. OK Stefan> (package--reload-previously-loaded pkg-desc)) Stefan> (with-demoted-errors "Error loading autoloads: %s" Stefan> (load (package--autoloads-file-name pkg-desc) nil t)) Stefan> - (add-to-list 'load-path (directory-file-name pkg-dir))) Stefan> + ;; FIXME: Since 2013 (commit 4fac34cee97a), the autolo= ad files take Stefan> + ;; care of changing the `load-path', so maybe it's tim= e to Stefan> + ;; remove this fallback code? Stefan> + (unless (or (member (file-name-as-directory pkg-dir) l= oad-path) Stefan> + (member (directory-file-name pkg-dir) load= -path)) Stefan> + (add-to-list 'load-path pkg-dir))) Stefan> Maybe we can have that patch in emacs-29 and remove the code al= together Stefan> on `master`? That seems reasonable. Eli? Robert --=20