* Cannot generate web manuals
@ 2013-12-29 4:04 Xue Fuqiao
2013-12-29 5:53 ` Thien-Thi Nguyen
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Xue Fuqiao @ 2013-12-29 4:04 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1324 bytes --]
I was trying to generate the web manuals for the Emacs webpage locally
with `make-manuals' in admin/admin.el, but met an error. I've attached
the backtrace.
I invoked this command without using prefix argument (which means to
generate all kinds of manuals: HTML, PDF, and PostScript). The error
occurred when generating the "emacs-node" manual (which is the first
step). The bug is in `manual-html-fix-headers': Emacs can't find "<meta
http-equiv=\"Content-Style". I've also attached a sample HTML file
(Abbrevs.html), generated by Texinfo 5.1 and Emacs trunk revision
115779. Maybe we should wrap it with something like
`with-demoted-errors', or remove the erroneous `search-forward' line in
`manual-html-fix-headers'. Should I file a bug report?
BTW perhaps we should use something like `make-progress-reporter' to
report the progress of this function, since it'll take a long time.
I'll also start to work on generating PDF and PostScript versions of
doc/misc manuals as requested by Jambunathan K[fn:1] later.
I also have a question here: `manual-html-mono' does not generate the
manual for lispref. How was
http://www.gnu.org/software/emacs/manual/html_mono/elisp.html generated?
Footnotes:
[fn:1] http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00000.html
--
http://www.gnu.org/software/emacs/
[-- Attachment #2: backtrace.txt --]
[-- Type: text/plain, Size: 7908 bytes --]
Debugger entered--Lisp error: (search-failed "<meta http-equiv=\"Content-Style")
search-forward("<meta http-equiv=\"Content-Style")
(let (opoint) (insert manual-doctype-string) (search-forward "<head>\n") (insert manual-meta-string) (search-forward "<meta") (setq opoint (match-beginning 0)) (re-search-forward "<!--") (goto-char (match-beginning 0)) (delete-region opoint (point)) (insert manual-style-string) (search-forward "<meta http-equiv=\"Content-Style") (setq opoint (match-beginning 0)) (search-forward "</head>") (delete-region opoint (match-beginning 0)))
manual-html-fix-headers()
(if (looking-at "<meta http-equiv") (set-buffer-modified-p nil) (manual-html-fix-headers) (if (equal f "index.html") (let (copyright-text) (manual-html-fix-index-1) (if (re-search-forward "[ ]*<p>Copyright ©" nil t) (progn (setq opoint (match-beginning 0)) (re-search-forward "</blockquote>") (setq copyright-text (buffer-substring opoint (point))) (delete-region opoint (point)))) (manual-html-fix-index-2) (if copyright-text (insert copyright-text)) (insert "\n</div>\n")) (manual-html-fix-node-div)) (save-buffer))
(progn (insert-file-contents (expand-file-name f dir)) (setq buffer-file-name (expand-file-name f dir)) (if (looking-at "<meta http-equiv") (set-buffer-modified-p nil) (manual-html-fix-headers) (if (equal f "index.html") (let (copyright-text) (manual-html-fix-index-1) (if (re-search-forward "[ ]*<p>Copyright ©" nil t) (progn (setq opoint (match-beginning 0)) (re-search-forward "</blockquote>") (setq copyright-text (buffer-substring opoint ...)) (delete-region opoint (point)))) (manual-html-fix-index-2) (if copyright-text (insert copyright-text)) (insert "\n</div>\n")) (manual-html-fix-node-div)) (save-buffer)))
(unwind-protect (progn (insert-file-contents (expand-file-name f dir)) (setq buffer-file-name (expand-file-name f dir)) (if (looking-at "<meta http-equiv") (set-buffer-modified-p nil) (manual-html-fix-headers) (if (equal f "index.html") (let (copyright-text) (manual-html-fix-index-1) (if (re-search-forward "[ ]*<p>Copyright ©" nil t) (progn (setq opoint ...) (re-search-forward "</blockquote>") (setq copyright-text ...) (delete-region opoint ...))) (manual-html-fix-index-2) (if copyright-text (insert copyright-text)) (insert "\n</div>\n")) (manual-html-fix-node-div)) (save-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents (expand-file-name f dir)) (setq buffer-file-name (expand-file-name f dir)) (if (looking-at "<meta http-equiv") (set-buffer-modified-p nil) (manual-html-fix-headers) (if (equal f "index.html") (let (copyright-text) (manual-html-fix-index-1) (if (re-search-forward "[ ]*<p>Copyright ©" nil t) (progn ... ... ... ...)) (manual-html-fix-index-2) (if copyright-text (insert copyright-text)) (insert "\n</div>\n")) (manual-html-fix-node-div)) (save-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents (expand-file-name f dir)) (setq buffer-file-name (expand-file-name f dir)) (if (looking-at "<meta http-equiv") (set-buffer-modified-p nil) (manual-html-fix-headers) (if (equal f "index.html") (let (copyright-text) (manual-html-fix-index-1) (if ... ...) (manual-html-fix-index-2) (if copyright-text ...) (insert "\n</div>\n")) (manual-html-fix-node-div)) (save-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
(let (opoint) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents (expand-file-name f dir)) (setq buffer-file-name (expand-file-name f dir)) (if (looking-at "<meta http-equiv") (set-buffer-modified-p nil) (manual-html-fix-headers) (if (equal f "index.html") (let ... ... ... ... ... ...) (manual-html-fix-node-div)) (save-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
(while --dolist-tail-- (setq f (car --dolist-tail--)) (let (opoint) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents (expand-file-name f dir)) (setq buffer-file-name (expand-file-name f dir)) (if (looking-at "<meta http-equiv") (set-buffer-modified-p nil) (manual-html-fix-headers) (if ... ... ...) (save-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
(let ((--dolist-tail-- (directory-files dir nil "\\.html\\'")) f) (while --dolist-tail-- (setq f (car --dolist-tail--)) (let (opoint) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents ...) (setq buffer-file-name ...) (if ... ... ... ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
manual-html-node("/home/xfq/emacs-repo/main/test/doc/emacs/emacs.texi" "/home/xfq/emacs-repo/main/test/manual/html_node/emacs")
(if (member type (quote (nil "emacs" "emacs-node"))) (manual-html-node emacs (expand-file-name "emacs" html-node-dir)))
(let* ((dest (expand-file-name "manual" root)) (html-node-dir (expand-file-name "html_node" dest)) (html-mono-dir (expand-file-name "html_mono" dest)) (ps-dir (expand-file-name "ps" dest)) (pdf-dir (expand-file-name "pdf" dest)) (emacs (expand-file-name "doc/emacs/emacs.texi" root)) (elisp (expand-file-name "doc/lispref/elisp.texi" root)) (eintr (expand-file-name "doc/lispintro/emacs-lisp-intro.texi" root)) (misc (manual-misc-manuals root))) (if (file-directory-p dest) (progn (if (y-or-n-p (format "Directory %s exists, delete it first? " dest)) (delete-directory dest t) (user-error "Aborted")))) (if (member type (quote (nil "emacs" "emacs-node"))) (manual-html-node emacs (expand-file-name "emacs" html-node-dir))) (if (member type (quote (nil "emacs" "emacs-mono"))) (manual-html-mono emacs (expand-file-name "emacs.html" html-mono-dir))) (if (member type (quote (nil "emacs" "emacs-pdf" "pdf"))) (manual-pdf emacs (expand-file-name "emacs.pdf" pdf-dir))) (if (member type (quote (nil "emacs" "emacs-ps" "ps"))) (manual-ps emacs (expand-file-name "emacs.ps" ps-dir))) (if (member type (quote (nil "elisp" "elisp-node"))) (manual-html-node elisp (expand-file-name "elisp" html-node-dir))) (if (member type (quote (nil "elisp" "elisp-mono"))) (manual-html-mono elisp (expand-file-name "elisp.html" html-mono-dir))) (if (member type (quote (nil "elisp" "elisp-pdf" "pdf"))) (manual-pdf elisp (expand-file-name "elisp.pdf" pdf-dir))) (if (member type (quote (nil "elisp" "elisp-ps" "ps"))) (manual-ps elisp (expand-file-name "elisp.ps" ps-dir))) (if (member type (quote (nil "eintr" "eintr-node"))) (manual-html-node eintr (expand-file-name "eintr" html-node-dir))) (if (member type (quote (nil "eintr" "eintr-node"))) (manual-html-mono eintr (expand-file-name "eintr.html" html-mono-dir))) (if (member type (quote (nil "eintr" "eintr-pdf" "pdf"))) (manual-pdf eintr (expand-file-name "eintr.pdf" pdf-dir))) (if (member type (quote (nil "eintr" "eintr-ps" "ps"))) (manual-ps eintr (expand-file-name "eintr.ps" ps-dir))) (let ((--dolist-tail-- misc) manual) (while --dolist-tail-- (setq manual (car --dolist-tail--)) (if (member type (cons nil (cons manual (quote ...)))) (manual-misc-html manual root html-node-dir html-mono-dir)) (setq --dolist-tail-- (cdr --dolist-tail--)))) (message "Manuals created in %s" dest))
make-manuals("~/emacs-repo/main/test/" nil)
call-interactively(make-manuals record nil)
command-execute(make-manuals record)
execute-extended-command(nil "make-manuals")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
[-- Attachment #3: Abbrevs.html --]
[-- Type: text/html, Size: 6368 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cannot generate web manuals
2013-12-29 4:04 Cannot generate web manuals Xue Fuqiao
@ 2013-12-29 5:53 ` Thien-Thi Nguyen
2013-12-29 15:43 ` Eli Zaretskii
2013-12-29 20:13 ` Glenn Morris
2 siblings, 0 replies; 8+ messages in thread
From: Thien-Thi Nguyen @ 2013-12-29 5:53 UTC (permalink / raw)
To: Xue Fuqiao; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]
() Xue Fuqiao <xfq.free@gmail.com>
() Sun, 29 Dec 2013 12:04:59 +0800
Maybe we should wrap it with something like
`with-demoted-errors', or remove the erroneous `search-forward' line in
`manual-html-fix-headers'. Should I file a bug report?
Any fix that concerns only the ‘search-forward’ expression is not
desirable; we must not think of the code as absolutely wrong, but
instead, in what cases is it right and in what cases is it wrong.
To do that, we need to understand its function and its context.
It looks like the purpose of the fragment:
(search-forward "<meta http-equiv=\"Content-Style")
(setq opoint (match-beginning 0))
(search-forward "</head>")
(delete-region opoint (match-beginning 0))
is to delete that ‘meta’ element, so the best fix would be to not bother
trying to delete it if it's already not there. Why haul water if there
is no fire?
--
Thien-Thi Nguyen
GPG key: 4C807502
(if you're human and you know it)
read my lisp: (responsep (questions 'technical)
(not (via 'mailing-list)))
=> nil
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cannot generate web manuals
2013-12-29 4:04 Cannot generate web manuals Xue Fuqiao
2013-12-29 5:53 ` Thien-Thi Nguyen
@ 2013-12-29 15:43 ` Eli Zaretskii
2013-12-29 20:13 ` Glenn Morris
2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2013-12-29 15:43 UTC (permalink / raw)
To: Xue Fuqiao; +Cc: emacs-devel
> Date: Sun, 29 Dec 2013 12:04:59 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
>
> How was
> http://www.gnu.org/software/emacs/manual/html_mono/elisp.html generated?
By running makeinfo --html, would be my guess.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cannot generate web manuals
2013-12-29 4:04 Cannot generate web manuals Xue Fuqiao
2013-12-29 5:53 ` Thien-Thi Nguyen
2013-12-29 15:43 ` Eli Zaretskii
@ 2013-12-29 20:13 ` Glenn Morris
2013-12-29 23:32 ` Xue Fuqiao
2 siblings, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2013-12-29 20:13 UTC (permalink / raw)
To: Xue Fuqiao; +Cc: emacs-devel
Xue Fuqiao wrote:
> with `make-manuals' in admin/admin.el, but met an error. I've attached
> the backtrace.
>
> I invoked this command without using prefix argument (which means to
> generate all kinds of manuals: HTML, PDF, and PostScript). The error
> occurred when generating the "emacs-node" manual (which is the first
> step).
It works fine for me with makeinfo 4.13. Perhaps something is different
in makeinfo 5.
> Should I file a bug report?
Depends if you want someone to fix it at some point, or if you just want
a chat.
> BTW perhaps we should use something like `make-progress-reporter' to
> report the progress of this function, since it'll take a long time.
Why bother? It's obvious when it's working.
> I'll also start to work on generating PDF and PostScript versions of
> doc/misc manuals as requested by Jambunathan K[fn:1] later.
I would not bother if I were you. To date we intentionally only provide
the main manuals in non-html formats. It is a pain to keep multiple
formats up-to-date, for little benefit IMO.
> I also have a question here: `manual-html-mono' does not generate the
> manual for lispref. How was
> http://www.gnu.org/software/emacs/manual/html_mono/elisp.html generated?
Using M-x make-manuals. I don't know why you think it doesn't make
html_mono/elisp.html.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cannot generate web manuals
2013-12-29 20:13 ` Glenn Morris
@ 2013-12-29 23:32 ` Xue Fuqiao
2013-12-30 1:26 ` Glenn Morris
0 siblings, 1 reply; 8+ messages in thread
From: Xue Fuqiao @ 2013-12-29 23:32 UTC (permalink / raw)
To: Glenn Morris; +Cc: emacs-devel
On Mon, Dec 30, 2013 at 4:13 AM, Glenn Morris <rgm@gnu.org> wrote:
> Xue Fuqiao wrote:
>
>> with `make-manuals' in admin/admin.el, but met an error. I've attached
>> the backtrace.
>>
>> I invoked this command without using prefix argument (which means to
>> generate all kinds of manuals: HTML, PDF, and PostScript). The error
>> occurred when generating the "emacs-node" manual (which is the first
>> step).
>
> It works fine for me with makeinfo 4.13. Perhaps something is different
> in makeinfo 5.
>
>> Should I file a bug report?
>
> Depends if you want someone to fix it at some point, or if you just want
> a chat.
Done as #16295.
>> BTW perhaps we should use something like `make-progress-reporter' to
>> report the progress of this function, since it'll take a long time.
>
> Why bother? It's obvious when it's working.
This way the user (maintainer) can estimate remaining time and clearly
see that Emacs is busy working, not hung. Anyway, this is only my opinion.
>> I'll also start to work on generating PDF and PostScript versions of
>> doc/misc manuals as requested by Jambunathan K[fn:1] later.
>
> I would not bother if I were you. To date we intentionally only provide
> the main manuals in non-html formats. It is a pain to keep multiple
> formats up-to-date, for little benefit IMO.
Why? Can't we just use the same method used by emacs/lispref/eintr for
`(manual-misc-manuals)' and just press `M-x make-manuals'?
>> I also have a question here: `manual-html-mono' does not generate the
>> manual for lispref. How was
>> http://www.gnu.org/software/emacs/manual/html_mono/elisp.html generated?
>
> Using M-x make-manuals. I don't know why you think it doesn't make
> html_mono/elisp.html.
You're right. But why does `manual-html-mono' and `manual-html-node'
only include (by "makeinfo -I") `doc/emacs' and `doc/misc'? I did't see
lispref there.
--
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cannot generate web manuals
2013-12-29 23:32 ` Xue Fuqiao
@ 2013-12-30 1:26 ` Glenn Morris
2013-12-30 3:47 ` Stephen J. Turnbull
2013-12-30 14:28 ` Xue Fuqiao
0 siblings, 2 replies; 8+ messages in thread
From: Glenn Morris @ 2013-12-30 1:26 UTC (permalink / raw)
To: Xue Fuqiao; +Cc: emacs-devel
Xue Fuqiao wrote:
>> I would not bother if I were you. To date we intentionally only provide
>> the main manuals in non-html formats. It is a pain to keep multiple
>> formats up-to-date, for little benefit IMO.
>
> Why? Can't we just use the same method used by emacs/lispref/eintr for
> `(manual-misc-manuals)' and just press `M-x make-manuals'?
Of course you _can_ do that, I'm saying it's pointless.
Does any distribution package the pdf versions of those files?
Is there anyone who really wants the pdf version and does not have
access to TeX?
I guarantee you that if you only do some, someone will complain about
the ones you did not do. So you'll have to do them all. And update all
formats, at every release.
> But why does `manual-html-mono' and `manual-html-node' only include
> (by "makeinfo -I") `doc/emacs' and `doc/misc'?
Because those are the only directories from which we need to pick up
included files (emacsver.texi and texinfo.tex).
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cannot generate web manuals
2013-12-30 1:26 ` Glenn Morris
@ 2013-12-30 3:47 ` Stephen J. Turnbull
2013-12-30 14:28 ` Xue Fuqiao
1 sibling, 0 replies; 8+ messages in thread
From: Stephen J. Turnbull @ 2013-12-30 3:47 UTC (permalink / raw)
To: Glenn Morris; +Cc: Xue Fuqiao, emacs-devel
Glenn Morris writes:
> Xue Fuqiao wrote:
>
> >> I would not bother if I were you. To date we intentionally only provide
> >> the main manuals in non-html formats. It is a pain to keep multiple
> >> formats up-to-date, for little benefit IMO.
> >
> > Why? Can't we just use the same method used by emacs/lispref/eintr for
> > `(manual-misc-manuals)' and just press `M-x make-manuals'?
>
> Of course you _can_ do that, I'm saying it's pointless.
Considering the existence of readthedocs.org, yep, it's pointless.
Of course, RTDO doesn't support Texinfo, which might be a problem.
But wait! The RTDO site is free software (MIT license, so GPL-able if
you wish) and requires only free software (Python and Django) to run.
You already have the code for making docs (in the Makefiles), which is
undoubtedly (haven't actually checked, but...) the smallest part of
the site anyway.
> Does any distribution package the pdf versions of those files?
Not that I know of, but readthedocs.org does.
> Is there anyone who really wants the pdf version and does not have
> access to TeX?
Windows users, Mac users, tablet users. (Being able to install via
Cygwin or MacPorts or from source is not "having access", and AFAIK
TeX hasn't been ported to iOS -- tell me I'm wrong, Mitsuharu! -- or
Android.)
> I guarantee you that if you only do some, someone will complain about
> the ones you did not do. So you'll have to do them all. And update all
> formats, at every release.
Mechanical process, should not require human intervention.
readthedocs.gnu.org, anybody?
(Not me, I'm fine with Info -- I only read Emacs docs when in Emacs
anyway.)
Steve
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cannot generate web manuals
2013-12-30 1:26 ` Glenn Morris
2013-12-30 3:47 ` Stephen J. Turnbull
@ 2013-12-30 14:28 ` Xue Fuqiao
1 sibling, 0 replies; 8+ messages in thread
From: Xue Fuqiao @ 2013-12-30 14:28 UTC (permalink / raw)
To: Glenn Morris; +Cc: emacs-devel
On Mon, Dec 30, 2013 at 9:26 AM, Glenn Morris <rgm@gnu.org> wrote:
> Is there anyone who really wants the pdf version and does not have
> access to TeX?
I agree with Stephen here. And TeX systems (TeX Live, MacTeX, MiKTeX,
younameit) are too large. I seldom install them unless really necessary.
> I guarantee you that if you only do some, someone will complain about
> the ones you did not do. So you'll have to do them all. And update all
> formats, at every release.
I don't think automating this process is very hard.
>> But why does `manual-html-mono' and `manual-html-node' only include
>> (by "makeinfo -I") `doc/emacs' and `doc/misc'?
>
> Because those are the only directories from which we need to pick up
> included files (emacsver.texi and texinfo.tex).
I see. Thank you.
--
http://www.gnu.org/software/emacs/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-12-30 14:28 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-29 4:04 Cannot generate web manuals Xue Fuqiao
2013-12-29 5:53 ` Thien-Thi Nguyen
2013-12-29 15:43 ` Eli Zaretskii
2013-12-29 20:13 ` Glenn Morris
2013-12-29 23:32 ` Xue Fuqiao
2013-12-30 1:26 ` Glenn Morris
2013-12-30 3:47 ` Stephen J. Turnbull
2013-12-30 14:28 ` Xue Fuqiao
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).