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#60628: 29.0.60; apropos-documentation does not work for preloaded symbols Date: Thu, 12 Jan 2023 11:36:42 +0200 Message-ID: <83bkn4ksb9.fsf@gnu.org> References: <83o7rascqg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37314"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60628@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 12 10:37:17 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 1pFu1L-0009LL-PV for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Jan 2023 10:37:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFu1J-0004pW-2S; Thu, 12 Jan 2023 04:37:13 -0500 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 1pFu19-0004ov-D8 for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 04:37:03 -0500 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 1pFu18-0008WB-55 for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 04:37:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFu18-00075k-0y for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 04:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Jan 2023 09:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60628 X-GNU-PR-Package: emacs Original-Received: via spool by 60628-submit@debbugs.gnu.org id=B60628.167351618827218 (code B ref 60628); Thu, 12 Jan 2023 09:37:01 +0000 Original-Received: (at 60628) by debbugs.gnu.org; 12 Jan 2023 09:36:28 +0000 Original-Received: from localhost ([127.0.0.1]:44701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFu0a-00074v-3v for submit@debbugs.gnu.org; Thu, 12 Jan 2023 04:36:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFu0Y-00074i-CV for 60628@debbugs.gnu.org; Thu, 12 Jan 2023 04:36:26 -0500 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 1pFu0S-0008Qn-Q8; Thu, 12 Jan 2023 04:36:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=rr5QnCYm2K9anTVxYPCyKkMXQqlJvbrqfkbHAHnfULQ=; b=oFzQE7VuEI3OMJVb+M2a Z4QSaxCkA4UbgQKy1OoGffg2nzYZXI0B2Mc+E9kUz6+E3/t2ws3pPduVJLooZtKUcuXlT7PB8Y2Jw hJVN4KT0qJvMHb86aUOtEApiQr1IYvPDJSRGeItn9vNPrHVajPiDT4zDElG3un7Ux48fJxv8Spqx/ Xnjzb43cDaWehEv40FJ0W7n7Yl1g+EGcTQk1dUfURqxC6WckY9lRDPqFVYbFIsLI28uJMRg1yq/yS 0Goo9X9qhyK5MdBvocRxfCK9zWfWeeLSblWfbz8X9kusjLtz+5HgRcQNVxSh34FlAlNiHv6tUCenO ddYllw3VDzS7TQ==; 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 1pFu0F-0005uA-Rf; Thu, 12 Jan 2023 04:36:12 -0500 In-Reply-To: <83o7rascqg.fsf@gnu.org> (message from Eli Zaretskii on Sat, 07 Jan 2023 15:20:07 +0200) 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:253198 Archived-At: Ping! > Date: Sat, 07 Jan 2023 15:20:07 +0200 > From: Eli Zaretskii > > To reproduce: > > emacs -Q > C-h d list.*directory RET > > Note that the resulting *Apropos* buffer only lists built-in functions > and variables, i.e. those defined in C. In particular, missing are > functions/variables from files.el, such as find-directory-functions, > parse-colon-path, and directory-files-recursively, whose doc strings > all match the regexp. > > This seems to be due to > > commit 59732a83c8875c8986d2221600d559a24d8309cc > Author: Stefan Monnier > Date: Thu Dec 30 23:17:45 2021 -0500 > > Don't store docstrings of preloaded .el files in etc/DOC > > The doc string of apropos-documentation does say: > > Note that by default this command only searches in the file specified by > ‘internal-doc-file-name’; i.e., the etc/DOC file. With C-u prefix, > or if ‘apropos-do-all’ is non-nil, it searches all currently defined > documentation strings. > > However, since we no longer write the doc strings of preloaded Lisp > files to DOC, that default no longer makes sense: Emacs should not > distinguish between built-in primitives and preloaded stuff, and it > didn't up to and including Emacs 28. > > Moreover, "C-u C-h d" also doesn't work for preloaded functions, > because: > > (apropos-documentation-internal 'directory-files-recursively) > => nil > > This happens because: > > (apropos-safe-documentation 'directory-files-recursively) > => ("files.elc" . 39940) > > and in that case apropos-documentation-internal calls > apropos-documentation-check-elc-file, which does something very > strange: it only looks inside strings that begin with "\n#@", and > otherwise simply ignores everything else. Is this also a remnant from > back when preloaded files had their doc strings in etc/DOC? Or else > why does it only look for "#@" comments preceded by a newline? > > Basically, apropos-documentation is currently completely broken on the > release branch. The following simple change seems to at least repair > "C-u C-h d", but I don't think it's sufficient, as we need to > resurrect the ability to find preloaded symbols without C-u. > > diff --git a/lisp/apropos.el b/lisp/apropos.el > index b260d88..cff6f1c 100644 > --- a/lisp/apropos.el > +++ b/lisp/apropos.el > @@ -1064,7 +1064,9 @@ apropos-documentation-check-elc-file > (setq apropos-files-scanned (cons file apropos-files-scanned)) > (erase-buffer) > (insert-file-contents file) > - (while (search-forward "\n#@" nil t) > + (while (search-forward "#@" nil t) > + (or (not (looking-at-p "[0-9]+")) > + (progn > ;; Read the comment length, and advance over it. > (setq end (read) > beg (1+ (point)) > @@ -1110,7 +1112,7 @@ apropos-documentation-check-elc-file > 'face apropos-match-face doc))) > (setcar (nthcdr (if this-is-a-variable 3 2) > apropos-item) > - doc)))))))))) > + doc)))))))))))) > > > Ideas? patches? comments? > > > > In GNU Emacs 29.0.60 (build 197, i686-pc-mingw32) of 2023-01-07 built on > HOME-C4E4A596F7 > Repository revision: 9d410f8de64e91d16999a9bb5dd884d6d06d22bd > Repository branch: emacs-29 > Windowing system distributor 'Microsoft Corp.', version 5.1.2600 > System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600) > > Configured using: > 'configure -C --prefix=/d/usr --with-wide-int > --enable-checking=yes,glyphs 'CFLAGS=-O0 -gdwarf-4 -g3'' > > Configured features: > ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY > W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF > TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB > > Important settings: > value of $LANG: ENU > locale-coding-system: cp1255 > > Major mode: Lisp Interaction > > Minor modes in effect: > tooltip-mode: t > global-eldoc-mode: t > eldoc-mode: t > show-paren-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > line-number-mode: t > indent-tabs-mode: t > transient-mark-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > > Load-path shadows: > None found. > > Features: > (shadow sort mail-extr dabbrev emacsbug message mailcap yank-media puny > dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg > rfc6068 epg-config gnus-util text-property-search time-date subr-x > mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils > mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr > mail-utils cl-extra pp cl-print byte-opt gv bytecomp byte-compile > help-fns radix-tree mule-util help-mode cl-loaddefs cl-lib apropos rmc > iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook > vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table > term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image > regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode > prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu > timer select scroll-bar mouse jit-lock font-lock syntax font-core > term/tty-colors frame minibuffer nadvice seq simple cl-generic > indonesian philippine cham georgian utf-8-lang misc-lang vietnamese > tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek > romanian slovak czech european ethiopic indian cyrillic chinese > composite emoji-zwj charscript charprop case-table epa-hook > jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs > theme-loaddefs faces cus-face macroexp files window text-properties > overlay sha1 md5 base64 format env code-pages mule custom widget keymap > hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty > make-network-process emacs) > > Memory information: > ((conses 16 54328 11479) > (symbols 48 7273 0) > (strings 16 20447 2422) > (string-bytes 1 523245) > (vectors 16 11853) > (vector-slots 8 170903 17702) > (floats 8 34 42) > (intervals 40 449 141) > (buffers 888 13)) > > > >