From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63881: 29.0.91; apropos-documentation fails when load-history contains element whose CAR is nil Date: Sun, 04 Jun 2023 08:31:58 +0300 Message-ID: <83cz2b7pyp.fsf@gnu.org> References: <878rd0c4df.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12242"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63881@debbugs.gnu.org To: Visuwesh , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 04 07:32:26 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 1q5gLq-0002zF-Db for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jun 2023 07:32:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5gLV-0003N3-Jv; Sun, 04 Jun 2023 01:32:05 -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 1q5gLT-0003Mh-5f for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 01:32:03 -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 1q5gLS-0002gM-Tq for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 01:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5gLS-0002vY-Db for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 01:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jun 2023 05:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63881 X-GNU-PR-Package: emacs Original-Received: via spool by 63881-submit@debbugs.gnu.org id=B63881.168585667811199 (code B ref 63881); Sun, 04 Jun 2023 05:32:02 +0000 Original-Received: (at 63881) by debbugs.gnu.org; 4 Jun 2023 05:31:18 +0000 Original-Received: from localhost ([127.0.0.1]:44693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5gKk-0002uZ-2W for submit@debbugs.gnu.org; Sun, 04 Jun 2023 01:31:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5gKf-0002uK-Re for 63881@debbugs.gnu.org; Sun, 04 Jun 2023 01:31:16 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5gKa-0002aD-2m; Sun, 04 Jun 2023 01:31:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=O/V6Z4+vibTTs3ekBSCW42PBaMmSLv78v4GJZLSy3mU=; b=UxwetE2ovRk9 GFSg/FQpepI2qE7cxoU5zUpnEz4OWHBhRwPthZ3cpozORTMwTXbKo8DbhxnfL+Sj4RCDPd3zKQrpU QWIa05cfnwv3RD4jiwU63QBBjjT/REXSmOtBAuAwzixwU/BOa1gIUGHJ5sbwPW94bkQNMT2GKyfiP q49sWQlUsF5kkoCf+xLeDSSFGs0YywpPBIGwLPNOyF8C9Y2lWdDFuSUIyCa3lsQscQcC/b5vCWsV7 +UeApCSymGioMl3UOPEKtnLR52foRhViLPUKvjX9yIl/zX2Ea/yL8HqozyXTXi0p9V5Hzup+cY3fZ LRkaUB9QIHS0Z45xCP2ijw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5gKY-0002Um-7L; Sun, 04 Jun 2023 01:31:07 -0400 In-Reply-To: <878rd0c4df.fsf@gmail.com> (message from Visuwesh on Sun, 04 Jun 2023 08:37:08 +0530) 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:262897 Archived-At: > From: Visuwesh > Date: Sun, 04 Jun 2023 08:37:08 +0530 > > > As per (info "(elisp) Where Defined"), load-history may contain an > element whose CAR is nil if eval-buffer was used to evaluate a defun > in a non-file-visiting buffer. > > After such an entry is added to load-history, apropos-documentation > fails with the backtrace at end. How did you add such an entry to load-history? IOW, is there a real-life use case where this happens? > To reproduce the issue, > > 1. emacs -Q > 2. Insert (defun test () t) > 3. M-x eval-buffer RET > 4. Confirm that a nil entry is present in load-history by evaluating > (alist-get nil load-history 'none) > 5. C-h d any RET > > The problem lies in apropos--map-preloaded-atoms in the part > > (dolist (x load-history) > (when (string-match preloaded-regexp (car x)) > ^^^^^^^^ > (dolist (def (cdr x)) > (cond > ((symbolp def) (funcall f def)) > ((eq 'defun (car-safe def)) (funcall f (cdr def))))))))) > > > ---- > > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > string-match("\\`/home/viz/lib/ports/emacs/lisp/\\(?:abbrev\\|b\\(?:..." nil) > (if (string-match preloaded-regexp (car x)) (progn (let ((tail (cdr x))) (while tail (let ((def (car tail))) (cond ((symbolp def) (funcall f def)) ((eq ... ...) (funcall f ...))) (setq tail (cdr tail)))))))