diff options
| author | Glenn Morris | 2013-07-06 11:28:54 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-07-06 11:28:54 -0700 |
| commit | c7197e5231b5dd232340bd6ca6f76072333b136c (patch) | |
| tree | aa3e7a0c4f4a1ccee56382cf6213ff546d800dc9 /admin | |
| parent | 1afb1d071576f7884a475c04955fc33126f70221 (diff) | |
| download | emacs-c7197e5231b5dd232340bd6ca6f76072333b136c.tar.gz emacs-c7197e5231b5dd232340bd6ca6f76072333b136c.zip | |
* admin.el (make-manuals): Add the option to only make certain output types.
(manual-misc-html): Special-case ccmode and efaq.
(manual-html-mono, manual-html-node, manual-pdf, manual-ps):
Move creation of output directory here from make-manuals.
(manual-html-fix-index-2): Avoid dynamic reference to `f'.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/ChangeLog | 5 | ||||
| -rw-r--r-- | admin/admin.el | 98 |
2 files changed, 70 insertions, 33 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog index b9c86da98cb..592a41968db 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -2,6 +2,11 @@ | |||
| 2 | 2 | ||
| 3 | * admin.el (manual-misc-manuals): New function. | 3 | * admin.el (manual-misc-manuals): New function. |
| 4 | (make-manuals): Avoid hard-coding list of misc manuals. | 4 | (make-manuals): Avoid hard-coding list of misc manuals. |
| 5 | Add the option to only make certain type(s) of output. | ||
| 6 | (manual-misc-html): Special-case ccmode and efaq. | ||
| 7 | (manual-html-mono, manual-html-node, manual-pdf, manual-ps): | ||
| 8 | Move creation of output directory here from make-manuals. | ||
| 9 | (manual-html-fix-index-2): Avoid dynamic reference to `f'. | ||
| 5 | 10 | ||
| 6 | 2013-07-05 Glenn Morris <rgm@gnu.org> | 11 | 2013-07-05 Glenn Morris <rgm@gnu.org> |
| 7 | 12 | ||
diff --git a/admin/admin.el b/admin/admin.el index a5625ff051d..927f68e978a 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -209,44 +209,66 @@ Root must be the root of an Emacs source tree." | |||
| 209 | "\\(\\\\\\|\\.info\\)" "" | 209 | "\\(\\\\\\|\\.info\\)" "" |
| 210 | (buffer-substring start (point))))))) | 210 | (buffer-substring start (point))))))) |
| 211 | 211 | ||
| 212 | (defun make-manuals (root) | 212 | (defun make-manuals (root &optional type) |
| 213 | "Generate the web manuals for the Emacs webpage." | 213 | "Generate the web manuals for the Emacs webpage. |
| 214 | (interactive "DEmacs root directory: ") | 214 | Interactively with a prefix argument, prompt for TYPE. |
| 215 | Optional argument TYPE is type of output (nil means all)." | ||
| 216 | (interactive (let ((root (read-directory-name "Emacs root directory: " | ||
| 217 | source-directory nil t))) | ||
| 218 | (list root | ||
| 219 | (if current-prefix-arg | ||
| 220 | (completing-read | ||
| 221 | "Type: " | ||
| 222 | (append | ||
| 223 | '("misc" "pdf" "ps") | ||
| 224 | (let (res) | ||
| 225 | (dolist (i '("emacs" "elisp" "eintr") res) | ||
| 226 | (dolist (j '("" "-mono" "-node" "-ps" "-pdf")) | ||
| 227 | (push (concat i j) res)))) | ||
| 228 | (manual-misc-manuals root))))))) | ||
| 215 | (let* ((dest (expand-file-name "manual" root)) | 229 | (let* ((dest (expand-file-name "manual" root)) |
| 216 | (html-node-dir (expand-file-name "html_node" dest)) | 230 | (html-node-dir (expand-file-name "html_node" dest)) |
| 217 | (html-mono-dir (expand-file-name "html_mono" dest)) | 231 | (html-mono-dir (expand-file-name "html_mono" dest)) |
| 218 | (ps-dir (expand-file-name "ps" dest)) | 232 | (ps-dir (expand-file-name "ps" dest)) |
| 219 | (pdf-dir (expand-file-name "pdf" dest))) | 233 | (pdf-dir (expand-file-name "pdf" dest)) |
| 234 | (emacs (expand-file-name "doc/emacs/emacs.texi" root)) | ||
| 235 | (elisp (expand-file-name "doc/lispref/elisp.texi" root)) | ||
| 236 | (eintr (expand-file-name "doc/lispintro/emacs-lisp-intro.texi" root)) | ||
| 237 | (misc (manual-misc-manuals root))) | ||
| 238 | ;; TODO this makes it non-continuable. | ||
| 239 | ;; Instead, delete the individual dest directory each time. | ||
| 220 | (when (file-directory-p dest) | 240 | (when (file-directory-p dest) |
| 221 | (if (y-or-n-p (format "Directory %s exists, delete it first?" dest)) | 241 | (if (y-or-n-p (format "Directory %s exists, delete it first? " dest)) |
| 222 | (delete-directory dest t) | 242 | (delete-directory dest t) |
| 223 | (error "Aborted"))) | 243 | (user-error "Aborted"))) |
| 224 | (make-directory dest) | 244 | (if (member type '(nil "emacs" "emacs-node")) |
| 225 | (make-directory html-node-dir) | 245 | (manual-html-node emacs (expand-file-name "emacs" html-node-dir))) |
| 226 | (make-directory html-mono-dir) | 246 | (if (member type '(nil "emacs" "emacs-mono")) |
| 227 | (make-directory ps-dir) | 247 | (manual-html-mono emacs (expand-file-name "emacs.html" html-mono-dir))) |
| 228 | (make-directory pdf-dir) | 248 | (if (member type '(nil "emacs" "emacs-pdf" "pdf")) |
| 229 | ;; Emacs manual | 249 | (manual-pdf emacs (expand-file-name "emacs.pdf" pdf-dir))) |
| 230 | (let ((texi (expand-file-name "doc/emacs/emacs.texi" root))) | 250 | (if (member type '(nil "emacs" "emacs-ps" "ps")) |
| 231 | (manual-html-node texi (expand-file-name "emacs" html-node-dir)) | 251 | (manual-ps emacs (expand-file-name "emacs.ps" ps-dir))) |
| 232 | (manual-html-mono texi (expand-file-name "emacs.html" html-mono-dir)) | 252 | (if (member type '(nil "elisp" "elisp-node")) |
| 233 | (manual-pdf texi (expand-file-name "emacs.pdf" pdf-dif)) | 253 | (manual-html-node elisp (expand-file-name "elisp" html-node-dir))) |
| 234 | (manual-ps texi (expand-file-name "emacs.ps" ps-dir))) | 254 | (if (member type '(nil "elisp" "elisp-mono")) |
| 235 | ;; Lisp manual | 255 | (manual-html-mono elisp (expand-file-name "elisp.html" html-mono-dir))) |
| 236 | (let ((texi (expand-file-name "doc/lispref/elisp.texi" root))) | 256 | (if (member type '(nil "elisp" "elisp-pdf" "pdf")) |
| 237 | (manual-html-node texi (expand-file-name "elisp" html-node-dir)) | 257 | (manual-pdf elisp (expand-file-name "elisp.pdf" pdf-dir))) |
| 238 | (manual-html-mono texi (expand-file-name "elisp.html" html-mono-dir)) | 258 | (if (member type '(nil "elisp" "elisp-ps" "ps")) |
| 239 | (manual-pdf texi (expand-file-name "elisp.pdf" pdf-dir)) | 259 | (manual-ps elisp (expand-file-name "elisp.ps" ps-dir))) |
| 240 | (manual-ps texi (expand-file-name "elisp.ps" ps-dir))) | 260 | (if (member type '(nil "eintr" "eintr-node")) |
| 241 | ;; Lisp intro. | 261 | (manual-html-node eintr (expand-file-name "eintr" html-node-dir))) |
| 242 | (let ((texi (expand-file-name "doc/lispintro/emacs-lisp-intro.texi" root))) | 262 | (if (member type '(nil "eintr" "eintr-node")) |
| 243 | (manual-html-node texi (expand-file-name "eintr" html-node-dir)) | 263 | (manual-html-mono eintr (expand-file-name "eintr.html" html-mono-dir))) |
| 244 | (manual-html-mono texi (expand-file-name "eintr.html" html-mono-dir)) | 264 | (if (member type '(nil "eintr" "eintr-pdf" "pdf")) |
| 245 | (manual-pdf texi (expand-file-name "eintr.pdf" pdf-dir)) | 265 | (manual-pdf eintr (expand-file-name "eintr.pdf" pdf-dir))) |
| 246 | (manual-ps texi (expand-file-name "eintr.ps" ps-dir))) | 266 | (if (member type '(nil "eintr" "eintr-ps" "ps")) |
| 267 | (manual-ps eintr (expand-file-name "eintr.ps" ps-dir))) | ||
| 247 | ;; Misc manuals | 268 | ;; Misc manuals |
| 248 | (dolist (manual (manual-misc-manuals root)) | 269 | (dolist (manual misc) |
| 249 | (manual-misc-html manual root html-node-dir html-mono-dir)) | 270 | (if (member type `(nil ,manual "misc")) |
| 271 | (manual-misc-html manual root html-node-dir html-mono-dir))) | ||
| 250 | (message "Manuals created in %s" dest))) | 272 | (message "Manuals created in %s" dest))) |
| 251 | 273 | ||
| 252 | (defconst manual-doctype-string | 274 | (defconst manual-doctype-string |
| @@ -264,7 +286,12 @@ Root must be the root of an Emacs source tree." | |||
| 264 | @import url('/s/emacs/manual.css');\n</style>\n") | 286 | @import url('/s/emacs/manual.css');\n</style>\n") |
| 265 | 287 | ||
| 266 | (defun manual-misc-html (name root html-node-dir html-mono-dir) | 288 | (defun manual-misc-html (name root html-node-dir html-mono-dir) |
| 267 | (let ((texi (expand-file-name (format "doc/misc/%s.texi" name) root))) | 289 | ;; Hack to deal with the cases where .texi creates a different .info. |
| 290 | ;; Blech. TODO Why not just rename the .texi files? | ||
| 291 | (let* ((texiname (cond ((equal name "ccmode") "cc-mode") | ||
| 292 | ((equal name "efaq") "faq") | ||
| 293 | (t name))) | ||
| 294 | (texi (expand-file-name (format "doc/misc/%s.texi" texiname) root))) | ||
| 268 | (manual-html-node texi (expand-file-name name html-node-dir)) | 295 | (manual-html-node texi (expand-file-name name html-node-dir)) |
| 269 | (manual-html-mono texi (expand-file-name (concat name ".html") | 296 | (manual-html-mono texi (expand-file-name (concat name ".html") |
| 270 | html-mono-dir)))) | 297 | html-mono-dir)))) |
| @@ -274,6 +301,7 @@ Root must be the root of an Emacs source tree." | |||
| 274 | This function also edits the HTML files so that they validate as | 301 | This function also edits the HTML files so that they validate as |
| 275 | HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using | 302 | HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using |
| 276 | the @import directive." | 303 | the @import directive." |
| 304 | (make-directory (or (file-name-directory dest) ".") t) | ||
| 277 | (call-process "makeinfo" nil nil nil | 305 | (call-process "makeinfo" nil nil nil |
| 278 | "-D" "WWW_GNU_ORG" | 306 | "-D" "WWW_GNU_ORG" |
| 279 | "-I" (expand-file-name "../emacs" | 307 | "-I" (expand-file-name "../emacs" |
| @@ -300,6 +328,7 @@ HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using | |||
| 300 | the @import directive." | 328 | the @import directive." |
| 301 | (unless (file-exists-p texi-file) | 329 | (unless (file-exists-p texi-file) |
| 302 | (error "Manual file %s not found" texi-file)) | 330 | (error "Manual file %s not found" texi-file)) |
| 331 | (make-directory dir t) | ||
| 303 | (call-process "makeinfo" nil nil nil | 332 | (call-process "makeinfo" nil nil nil |
| 304 | "-D" "WWW_GNU_ORG" | 333 | "-D" "WWW_GNU_ORG" |
| 305 | "-I" (expand-file-name "../emacs" | 334 | "-I" (expand-file-name "../emacs" |
| @@ -336,6 +365,7 @@ the @import directive." | |||
| 336 | 365 | ||
| 337 | (defun manual-pdf (texi-file dest) | 366 | (defun manual-pdf (texi-file dest) |
| 338 | "Run texi2pdf on TEXI-FILE, emitting pdf output to DEST." | 367 | "Run texi2pdf on TEXI-FILE, emitting pdf output to DEST." |
| 368 | (make-directory (or (file-name-directory dest) ".") t) | ||
| 339 | (let ((default-directory (file-name-directory texi-file))) | 369 | (let ((default-directory (file-name-directory texi-file))) |
| 340 | (call-process "texi2pdf" nil nil nil | 370 | (call-process "texi2pdf" nil nil nil |
| 341 | "-I" "../emacs" "-I" "../misc" | 371 | "-I" "../emacs" "-I" "../misc" |
| @@ -343,6 +373,7 @@ the @import directive." | |||
| 343 | 373 | ||
| 344 | (defun manual-ps (texi-file dest) | 374 | (defun manual-ps (texi-file dest) |
| 345 | "Generate a PostScript version of TEXI-FILE as DEST." | 375 | "Generate a PostScript version of TEXI-FILE as DEST." |
| 376 | (make-directory (or (file-name-directory dest) ".") t) | ||
| 346 | (let ((dvi-dest (concat (file-name-sans-extension dest) ".dvi")) | 377 | (let ((dvi-dest (concat (file-name-sans-extension dest) ".dvi")) |
| 347 | (default-directory (file-name-directory texi-file))) | 378 | (default-directory (file-name-directory texi-file))) |
| 348 | (call-process "texi2dvi" nil nil nil | 379 | (call-process "texi2dvi" nil nil nil |
| @@ -454,7 +485,8 @@ the @import directive." | |||
| 454 | (setq done t)) | 485 | (setq done t)) |
| 455 | (t | 486 | (t |
| 456 | (if (eobp) | 487 | (if (eobp) |
| 457 | (error "Parse error in %s" f)) ; f is bound in manual-html-node | 488 | (error "Parse error in %s" |
| 489 | (file-name-nondirectory buffer-file-name))) | ||
| 458 | (unless open-td | 490 | (unless open-td |
| 459 | (setq done t)))) | 491 | (setq done t)))) |
| 460 | (forward-line 1)))) | 492 | (forward-line 1)))) |