From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Alexandrov <321942@gmail.com> Newsgroups: gmane.emacs.bugs Subject: bug#34462: 27.0.50; package.el breakage when features are loaded in after-init-hook Date: Wed, 13 Feb 2019 11:06:01 +0300 Message-ID: <87wom4f6za.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="77791"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34462@debbugs.gnu.org To: Steve Purcell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 13 09:07:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtpZY-000K8R-FS for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Feb 2019 09:07:12 +0100 Original-Received: from localhost ([127.0.0.1]:52702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtpZX-0000YI-AM for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Feb 2019 03:07:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtpZP-0000Xm-UR for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2019 03:07:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtpZO-0005ni-HN for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2019 03:07:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtpZO-0005nW-9k for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2019 03:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gtpZO-00048G-3Y for bug-gnu-emacs@gnu.org; Wed, 13 Feb 2019 03:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Alexandrov <321942@gmail.com> Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Feb 2019 08:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34462 X-GNU-PR-Package: emacs Original-Received: via spool by 34462-submit@debbugs.gnu.org id=B34462.155004519015840 (code B ref 34462); Wed, 13 Feb 2019 08:07:02 +0000 Original-Received: (at 34462) by debbugs.gnu.org; 13 Feb 2019 08:06:30 +0000 Original-Received: from localhost ([127.0.0.1]:45747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gtpYs-00047Q-16 for submit@debbugs.gnu.org; Wed, 13 Feb 2019 03:06:30 -0500 Original-Received: from mail-lf1-f52.google.com ([209.85.167.52]:43037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <321942@gmail.com>) id 1gtpYq-00047D-K8 for 34462@debbugs.gnu.org; Wed, 13 Feb 2019 03:06:29 -0500 Original-Received: by mail-lf1-f52.google.com with SMTP id j1so1037977lfb.10 for <34462@debbugs.gnu.org>; Wed, 13 Feb 2019 00:06:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:mail-copies-to :date:message-id:mime-version; bh=FAklil81ngtBjdVCNTgBMA18V/gOc5VQICjiYeWfTIs=; b=tIv8rthjKXWRBts+a6b3kmSwv9VpZ6y0NvMnvt7i++a/v11wbmImLbnrF+PrEQixVg 6me+srt8C3DeaTJS077C4BzQpAVTtKC9slbI+uAAJY8GEKs8Avz3s5H43hZhaaa3nUwU I+9ybwxaRFsQ084W2OOyDApuukEFjxfhnGXWpb+Cbf7PvTG3bqOZM9uNItmdeHlValCv uD0dI7qzVh1X3435VdzqSla88On235t1JNLuZJqoNCPg8kYruvPGwdig+ZgkLM/QfFSj Izdleb6nAKrbiNSKFn8ZKz+VMySZbbajV8gmVYy9u8N2LR6GRl+AiKAY1FB5+theLkB5 Dh5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:mail-copies-to:date:message-id:mime-version; bh=FAklil81ngtBjdVCNTgBMA18V/gOc5VQICjiYeWfTIs=; b=dz0by+ABoHPbs16NymAZSi1dJ+r/bnwwGUuiKr2sFrH5aFmLOGzhdWA7ezoQtNbMlW XxXsJoooXVHLGg4xme8XVODwunPwHUOdgqGWXAj07PhNYQDcdG5WzVPz5JfAtXfLmv0p 4Oda6adJ05c9qaMvzDPFHqOWDUB+Quvl/VdDkRpYow32t6LWUqHmZ2QKEu66ciJFwgBf sMHkzyzCZIszUY+c8FMht32Z5tFTl31y3f+k9VIWu47bKAcEJ2ELxjlrflRAn92Lv1Dt edlcBKVHj5FyhGQEtEooKYFB2NL1ctBxxepVvgZelu5KzwnSRKZp+EShduic/DYCbUpK oT5w== X-Gm-Message-State: AHQUAuYu9z80X5x+YX3dXvP+tY9ZaFw0RES2TN0c5r8WklcrNkAWphbv JV5vYTkya1/vpRqyIEHqmCn3rdkP X-Google-Smtp-Source: AHgI3Ibfjhu91WfUgCtaC88y8EIm9l5ysAedNWiPpCGOiNF2dK3W9V+lnSr0wdwBlCoux342HgMm0A== X-Received: by 2002:a19:f013:: with SMTP id p19mr5047080lfc.154.1550045182059; Wed, 13 Feb 2019 00:06:22 -0800 (PST) Original-Received: from localhost ([213.87.136.21]) by smtp.gmail.com with ESMTPSA id x18-v6sm3603754lji.27.2019.02.13.00.06.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Feb 2019 00:06:20 -0800 (PST) In-Reply-To: (Steve Purcell's message of "Wed, 13 Feb 2019 09:03:14 +1300") Mail-Copies-To: always X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155393 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Steve Purcell wrote: > Given an init.el snippet like: > > (add-hook 'after-init-hook > (lambda () > (require 'server) > (unless (server-running-p) > (server-start)))) > > the `load-history' var will contain an entry with a nil car (as per its > documentation), inside which the `(require . server)' load will be > noted. > > However, the code in `package--list-loaded-files' unconditionally > applies `file-name-sans-extension' to the cars of `load-history', > resulting in errors whenever packages are activated (e.g. upgraded, > installed). > > I believe the correct fix would be simply add a `stringp' test here: > > https://github.com/emacs-mirror/emacs/blob/5abaf16ab49b86ca5add981c2ddcae= a6db0c8a08/lisp/emacs-lisp/package.el#L759 > > (Using a nightly Emacs HEAD snapshot from a couple of days ago.) This is actually not limited to package.el. E. g. lisp/help-fns.el was als= o written in assumtion, that cars of elements of =E2=80=98load-history=E2= =80=99 are always file names: --=-=-= Content-Type: text/x-emacs-lisp Content-Disposition: inline (defun help-fns--autoloaded-p (function file) "Return non-nil if FUNCTION has previously been autoloaded. FILE is the file where FUNCTION was probably defined." (let* ((file (file-name-sans-extension (file-truename file))) (load-hist load-history) (target (cons t function)) found) (while (and load-hist (not found)) (and (caar load-hist) (equal (file-name-sans-extension (caar load-hist)) file) (setq found (member target (cdar load-hist)))) (setq load-hist (cdr load-hist))) found)) --=-=-= Content-Type: text/plain Moreover: $ emacs -Q f emacs-lisp-mode RET --=-=-= Content-Type: text/x-backtrace Content-Disposition: inline Debugger entered--Lisp error: (wrong-type-argument stringp (require . elec-pair)) file-name-nondirectory((require . elec-pair)) file-name-sans-extension((require . elec-pair)) help-fns--autoloaded-p(emacs-lisp-mode "/var/share/pub/src/emacs.~21eef9fa7f~/lisp/progmod...") help-fns-function-description-header(emacs-lisp-mode) describe-function-1(emacs-lisp-mode) describe-function(emacs-lisp-mode) funcall-interactively(describe-function emacs-lisp-mode) call-interactively(describe-function nil nil) command-execute(describe-function) --=-=-= Content-Type: text/plain So something forgot to put there even nil, but started the list right with ENTRIES. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE1yoTx9fONarixgNIydoJ3hnBsjAFAlxjz+kACgkQydoJ3hnB sjBRygf7BGhOaSTdGI0auk9jVeUsL6qb7H9xSzD6H8rEunYu+3ENwEOlM6rzLdgw 5UR/ajXfcOOyVuDRnp4/YfQpOukHibI3SbEX5YLHvvD7G9PM8plACKI88N82nm/n qrGXFrprAvyC832uAfIIRhbqQgnPsBPh0OX1p/+cgLFbqqjZ8LS6e/SToJm2ZcbW c1NbairLlzMXia3DELYTo+Qmj14DdWVDvI6cptzgU7ZxujGTsNHjpKxdYGBoeMkP pWSHAtLxL6Y0Sr2TFvzzhMVqBBXvbXvNTLZGSkTpZ45zANBbrIDpggqmNgbgkcZX G64RraEUQsmQKYJMcwhafIbdvN5+WQ== =QFC4 -----END PGP SIGNATURE----- --==-=-=--