emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTML info


From: Juri Linkov
Subject: Re: HTML info
Date: Fri, 24 Dec 2021 10:34:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

> I’m a bit confused. In order to have variable-pitch info’s. What do we
> need to do and what do makeinfo maintainers need to do?

What we can already do is to at least display Emacs manuals from HTML
generated by `make html`.

> Disregard of where will the HTML info files be, whether they will be
> in a single file, whether distributions will distribute HTML info
> files, what do we need to do in order to at least support reading HTML
> info files like .info files?
>
> Is it a good idea that we start from a major mode Info-html-mode that
> can view manuals in either a single or multiple HTML files, that
> supports various info commands?

Most of the core package info.el deals with handling of the Info format.

Take for example Info-search.  What it mostly does is parsing the Info file's
tag table and visiting Info subfiles.  All this is not needed for HTML.
Instead of this, the HTML search function will have other problems:
how to skip text in HTML tags, e.g. searching for the word "href"
should not match it as the HTML attribute in ‘<a href="">...</a>’, etc.

OTOH, some of Info-search code should be reused in HTML Info files:
- the key ‘s’ bound in Info-mode-map should still call ‘Info-search’;
- the interactive spec should be used without changes for HTML search;
- such code (signal 'user-search-failed (list regexp "end of manual"))
  should be reused, etc. (And most isearch functions in info.el are
  already general enough that can be used for both Info and HTML formats,
  except the Info-format specific ‘Info-isearch-filter’.)

So we have at least 3 choices:

1. Intersperse the existing Info-search with such conditionals:

   (if info-html-minor
       (search-forward "<div class="contents">")
     (search-forward "\n\^_\nIndirect:"))

2. Add more hooks to every Info top command,
   so Info-html-mode could register own handlers:

   (add-hook 'Info-search-function 'Info-html-search)

3. Completely duplicate all top Info commands in a new package
   info-html.el.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]