From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "H. Dieter Wilhelm" Newsgroups: gmane.emacs.bugs Subject: bug#60587: Patch for adding links to symbols' help documentation Date: Mon, 09 Jan 2023 21:01:08 +0100 Message-ID: <86ilhfv5ob.fsf@duenenhof-wilhelm.de> References: <86y1qgr1bf.fsf@duenenhof-wilhelm.de> <86tu13qydg.fsf@duenenhof-wilhelm.de> <83h6x2u74b.fsf@gnu.org> <86pmbovljq.fsf@duenenhof-wilhelm.de> <835ydfq3iq.fsf@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="13610"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: 60587@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 09 21:02:28 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 1pEyLj-0003J1-AY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Jan 2023 21:02:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEyLN-0001hA-2x; Mon, 09 Jan 2023 15:02:05 -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 1pEyLK-0001gv-L6 for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2023 15:02: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 1pEyLK-0003Kv-3J for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2023 15:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEyLJ-0008HB-Ut for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2023 15:02:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "H. Dieter Wilhelm" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Jan 2023 20:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60587 X-GNU-PR-Package: emacs Original-Received: via spool by 60587-submit@debbugs.gnu.org id=B60587.167329448231751 (code B ref 60587); Mon, 09 Jan 2023 20:02:01 +0000 Original-Received: (at 60587) by debbugs.gnu.org; 9 Jan 2023 20:01:22 +0000 Original-Received: from localhost ([127.0.0.1]:38259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEyKf-0008G3-Fz for submit@debbugs.gnu.org; Mon, 09 Jan 2023 15:01:21 -0500 Original-Received: from mout.kundenserver.de ([217.72.192.73]:40519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEyKd-0008Fo-EY for 60587@debbugs.gnu.org; Mon, 09 Jan 2023 15:01:20 -0500 Original-Received: from ping ([109.250.146.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mq2rM-1oTCzf3zSE-00n9Ot; Mon, 09 Jan 2023 21:01:10 +0100 In-Reply-To: <835ydfq3iq.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Jan 2023 14:46:37 +0200") X-Provags-ID: V03:K1:AWwFRml1sW/60VxOTsTYIReEJ3k4yH073ReWxYze+PzmWh+aM+L CT8TXVyonTE/egq6Y0lqfZpZrevLT+ZNEGsAUIMdj8EwWT0VRlyWtpjhQtJmMiOazhfIZh2 VUXbDXFBMi2RS8rdVcy1039O2yXb2Qahv2bqSJLOJyLIu+E7jlItnYVwsMiPKzV5KWaiLPq WaLaOpVgO3Yl+jENNWatg== UI-OutboundReport: notjunk:1;M01:P0:E0X4NWCk1oI=;9i4xGDzTXs13RsBIoef236OiKCC 55BiTBtTePnSBib36ISWdLwE5nQo8UPEvBYkJnuW3oBNKn6VrdN/rPy6hPbKhrXpSE6FZSkn5 oECU9gGmPtD2cIBK64z7JjIM2l0i0lEYfMiB5yKC045FRoYkdS2m9WPgBLtWH3tk7duxz614f 3kPGv0BkA6vOf1dKDwa/ZJZDpRhsQpRKk5ufaGXv3jmxrBW+Jp8zzlZw6ZeCr5Q56EQuyT+/e 6nmIPA5yvD1MkE5xzxS52bEiZNfMJQdYA79A9IkYQmrQ7XqoQ+PHtnvy9SiOGZ/a9ZYU/nkkG /S25/aVi8G7azKgu09vRlHNsDxPAENfXY/meL0siX2Gs2zXpOjQdC/tu2MgyBd5yak7JVyXeY fR6vpmRIUJlUG3+p6YnOvQ3mu+OVhMkbXMrfHj2DxYzdwmTw7cEKGYq8x+/BeLe0Nsu/r+VmI 30rDNk4GArxr/hAyddwvUzEi7pktk7bvJ77lRJM2xtTv4o+kUvGi4hRiBP0rgo/t6hpgSn502 /FMN9lbs0IVqmPvn5hfYRB/CwO/4APQnDFrzvoBVzXyqdy2/RYG+OVeZsP9I+v0S1CNUXSGfJ JgIsuB3YxIwkMNtHt2WCjXCqrDlkz2cubKZsfnLlZQH+7eNqzgL9WKbcC8cECfL0znKaH/5zV qOI1in2VQc/AvXA5l5ClSFH+E+mJOy6DNc75u4M+7g== 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:253043 Archived-At: Eli Zaretskii writes: >> >> +(info-initialize) >> > >> > Why do you need to call this? and why on top level? >> >> Because I have no better idea to build info-emacs-info-dir-content >> (maybe dynamically?). With the code below I force the initialisation of >> Info-directory-list. It is used for checking if the current info >> document is relevant to Emacs. > > Info-directory-list starts as nil, so you can test its value. > More generally, this feature displays links in an Info buffer, right? > If an Info buffer is displayed in Emacs, info-initialize was already > called, and you don't need to call it again. That is true. It was not much work to avoid it. :-) >> >> +;; Turn into regexp list necessary? Stefan >> >> +;; Switch to alist with explanation of file name? >> >> +(defcustom info-xref-none-emacs-or-elisp-documents >> >> + '("aarm2012" ; Stefan: Ada manual, Elpa archive >> >> + "arm2012" ; Stefan: Ada manual >> >> + "sicp" ; T.V: Structure and Interpretation of Computer Programs, >> >> + ; Melpa archive >> >> + ) >> >> + "List of all none GNU-Emacs or Elisp documentation. >> >> +Or other documents not to be checked for linking to their help >> >> +documentation. The list must contains only the base name of the >> >> +files (without their file name extension \".info\")." >> >> + :type '(repeat string) >> >> + :group 'info-xref) >> > >> > Not sure what is this about, and what do the names above signify. >> >> This was a discussion on gmane.emacs.devel (please see >> jwvtv0qv5av.fsf-monnier+emacs@gnu.org) on how to avoid trying to link >> info documents which don't belong to Emacs. (Core-Utils, Ada >> documentation from Melpa, etc.) > > I cannot access that discussion with this URL (can you tell on which > date that happened? then I will look in the emacs-devel list > archives) Please have a look here: https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00994.html (Above is the message-id from 2020-05-08) > , and I don't think I understand how such names will creep > into this feature. Does the code somehow search every Info manual on > the system to do its job? It's not searching, just checking whether Info-current-file has an extension of .info(.gz) (this is redundant on my system but I forgot to document in what circumstances this check might be necessary) and is included in any of the Info-directory-list directories. Since Info-directory-list may contain info files which are not related to Emacs, it checks against the "blacklist" info-none-emacs-or-elisp-documents. E.g. from Elpa there are packages, like sicp (Structure and Interpretation of Computer Programs) in info format. (defun info-check-docu-p () "Check if the current info file is relevant to Emacs. That means `Info-current-file' is either found in Emacs' info/ directory or in `package-user-dir' and is not included in the `info-none-emacs-or-elisp-documents' list." (unless info-emacs-info-dir-content (info-compile-emacs-info-dir-content)) (let* ((ifile Info-current-file) (ifi (when ifile (file-name-sans-extension (file-name-nondirectory ifile)))) (pdir (when (boundp 'package-user-dir) (expand-file-name package-user-dir))) ;; FIXME: Check if pdir is redundant because Package adds ;; info package folders to Info-directory-list anyway (ifiles info-emacs-info-dir-content) (ndocu info-none-emacs-or-elisp-documents)) (and ifile (or (assoc-string (concat ifi ".info") ifiles) ;; info files might be archived! (assoc-string (concat ifi ".info.gz") ifiles) (when pdir (string-match pdir ifile))) (not (assoc-string ifi ndocu))))) -- Best wishes) H. Dieter Wilhelm Zwingenberg, Germany