unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 60587@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#60587: Patch for adding links to symbols' help documentation
Date: Mon, 09 Jan 2023 21:01:08 +0100	[thread overview]
Message-ID: <86ilhfv5ob.fsf@duenenhof-wilhelm.de> (raw)
In-Reply-To: <835ydfq3iq.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Jan 2023 14:46:37 +0200")

Eli Zaretskii <eliz@gnu.org> 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





  parent reply	other threads:[~2023-01-09 20:01 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 23:47 bug#60587: 30.0.50; Info pages are lacking links from symbol names to the symbol's help documentation H. Dieter Wilhelm
2023-01-06 19:03 ` bug#60587: Patch for adding links to symbols' " H. Dieter Wilhelm
2023-01-07  7:38   ` Eli Zaretskii
2023-01-08 20:06     ` H. Dieter Wilhelm
2023-01-09 12:46       ` Eli Zaretskii
2023-01-09 14:25         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-09 20:01         ` H. Dieter Wilhelm [this message]
2023-01-13 23:33     ` H. Dieter Wilhelm
2023-01-14  7:12       ` Eli Zaretskii
2023-01-15 12:48         ` H. Dieter Wilhelm
2023-01-17 21:53     ` H. Dieter Wilhelm
2023-01-18 13:20       ` Eli Zaretskii
2023-01-20 21:09         ` H. Dieter Wilhelm
2023-01-20 21:59           ` Drew Adams
2023-01-20 23:32           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-22 13:00             ` H. Dieter Wilhelm
2023-01-21  8:21           ` Eli Zaretskii
2023-01-21 20:27             ` H. Dieter Wilhelm
2023-01-22  6:00               ` Eli Zaretskii
2023-01-22 22:09                 ` Drew Adams
2023-01-23 12:14                   ` Eli Zaretskii
2023-01-23 16:16                     ` Drew Adams
2023-01-25 21:29             ` H. Dieter Wilhelm
2023-01-25 22:24               ` Drew Adams
2023-01-26 10:29                 ` Ihor Radchenko
2023-01-26 15:06                   ` Drew Adams
2023-01-26 15:12                     ` Ihor Radchenko
2023-01-26 15:23                       ` Drew Adams
2023-01-27 21:35                 ` H. Dieter Wilhelm
2023-01-27 22:12                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-27 23:09                     ` Drew Adams
2023-01-27 23:13                   ` Drew Adams
2023-01-28  8:11                     ` Eli Zaretskii
2023-01-28 17:30                       ` Drew Adams
2023-02-01 22:09                     ` H. Dieter Wilhelm
2023-02-02  2:30                       ` Drew Adams
2023-02-05  0:48                     ` H. Dieter Wilhelm
2023-02-05  3:54                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-05 13:54                         ` H. Dieter Wilhelm
2023-02-06 21:04                           ` H. Dieter Wilhelm
2023-02-12 11:04                         ` H. Dieter Wilhelm
2023-02-14 20:56                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-15 22:18                             ` H. Dieter Wilhelm
2023-02-16  3:08                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-20 23:53                                 ` H. Dieter Wilhelm
2023-02-21  2:12                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-01 21:45                                     ` H. Dieter Wilhelm
2023-03-11  8:32                                       ` Eli Zaretskii
2023-03-11  9:16                                         ` H. Dieter Wilhelm
2023-02-15  5:17                           ` Richard Stallman
2023-02-15  9:53                             ` Gregory Heytings
2023-02-15 13:42                               ` Gregory Heytings
2023-01-26 10:37               ` Eli Zaretskii
2023-01-27  7:45                 ` Juri Linkov
2023-01-27  8:11                   ` Eli Zaretskii
2023-01-27 22:21                 ` H. Dieter Wilhelm
2023-01-28  7:51                   ` Eli Zaretskii
2023-02-01 21:26                 ` H. Dieter Wilhelm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ilhfv5ob.fsf@duenenhof-wilhelm.de \
    --to=dieter@duenenhof-wilhelm.de \
    --cc=60587@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).