diff options
| author | Tom Tromey | 2013-07-06 23:18:58 -0600 |
|---|---|---|
| committer | Tom Tromey | 2013-07-06 23:18:58 -0600 |
| commit | 6dacdad5fcb278e5a16b38bb81786aac9ca27be4 (patch) | |
| tree | f5f331ea361ba0f99e0f9b638d183ad492a7da31 /admin/admin.el | |
| parent | 0a6f2ff0c8ceb29703e76cddd46ea3f176dd873a (diff) | |
| parent | 219afb88d9d484393418820d1c08dc93299110ec (diff) | |
| download | emacs-6dacdad5fcb278e5a16b38bb81786aac9ca27be4.tar.gz emacs-6dacdad5fcb278e5a16b38bb81786aac9ca27be4.zip | |
merge from trunk
this merges frmo trunk and fixes various build issues.
this needed a few ugly tweaks.
this hangs in "make check" now
Diffstat (limited to 'admin/admin.el')
| -rw-r--r-- | admin/admin.el | 188 |
1 files changed, 98 insertions, 90 deletions
diff --git a/admin/admin.el b/admin/admin.el index 8366207f5b0..927f68e978a 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -193,70 +193,82 @@ Root must be the root of an Emacs source tree." | |||
| 193 | 193 | ||
| 194 | ;;; Various bits of magic for generating the web manuals | 194 | ;;; Various bits of magic for generating the web manuals |
| 195 | 195 | ||
| 196 | (defun make-manuals (root) | 196 | (defun manual-misc-manuals (root) |
| 197 | "Generate the web manuals for the Emacs webpage." | 197 | "Return doc/misc manuals as list of strings." |
| 198 | (interactive "DEmacs root directory: ") | 198 | ;; Like `make -C doc/misc echo-info', but works if unconfigured. |
| 199 | (with-temp-buffer | ||
| 200 | (insert-file-contents (expand-file-name "doc/misc/Makefile.in" root)) | ||
| 201 | (search-forward "INFO_TARGETS = ") | ||
| 202 | (let ((start (point)) | ||
| 203 | res) | ||
| 204 | (end-of-line) | ||
| 205 | (while (and (looking-back "\\\\") | ||
| 206 | (zerop (forward-line 1))) | ||
| 207 | (end-of-line)) | ||
| 208 | (split-string (replace-regexp-in-string | ||
| 209 | "\\(\\\\\\|\\.info\\)" "" | ||
| 210 | (buffer-substring start (point))))))) | ||
| 211 | |||
| 212 | (defun make-manuals (root &optional type) | ||
| 213 | "Generate the web manuals for the Emacs webpage. | ||
| 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))))))) | ||
| 199 | (let* ((dest (expand-file-name "manual" root)) | 229 | (let* ((dest (expand-file-name "manual" root)) |
| 200 | (html-node-dir (expand-file-name "html_node" dest)) | 230 | (html-node-dir (expand-file-name "html_node" dest)) |
| 201 | (html-mono-dir (expand-file-name "html_mono" dest)) | 231 | (html-mono-dir (expand-file-name "html_mono" dest)) |
| 202 | (txt-dir (expand-file-name "text" dest)) | 232 | (ps-dir (expand-file-name "ps" dest)) |
| 203 | (dvi-dir (expand-file-name "dvi" dest)) | 233 | (pdf-dir (expand-file-name "pdf" dest)) |
| 204 | (ps-dir (expand-file-name "ps" 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. | ||
| 205 | (when (file-directory-p dest) | 240 | (when (file-directory-p dest) |
| 206 | (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)) |
| 207 | (delete-directory dest t) | 242 | (delete-directory dest t) |
| 208 | (error "Aborted"))) | 243 | (user-error "Aborted"))) |
| 209 | (make-directory dest) | 244 | (if (member type '(nil "emacs" "emacs-node")) |
| 210 | (make-directory html-node-dir) | 245 | (manual-html-node emacs (expand-file-name "emacs" html-node-dir))) |
| 211 | (make-directory html-mono-dir) | 246 | (if (member type '(nil "emacs" "emacs-mono")) |
| 212 | (make-directory txt-dir) | 247 | (manual-html-mono emacs (expand-file-name "emacs.html" html-mono-dir))) |
| 213 | (make-directory dvi-dir) | 248 | (if (member type '(nil "emacs" "emacs-pdf" "pdf")) |
| 214 | (make-directory ps-dir) | 249 | (manual-pdf emacs (expand-file-name "emacs.pdf" pdf-dir))) |
| 215 | ;; Emacs manual | 250 | (if (member type '(nil "emacs" "emacs-ps" "ps")) |
| 216 | (let ((texi (expand-file-name "doc/emacs/emacs.texi" root))) | 251 | (manual-ps emacs (expand-file-name "emacs.ps" ps-dir))) |
| 217 | (manual-html-node texi (expand-file-name "emacs" html-node-dir)) | 252 | (if (member type '(nil "elisp" "elisp-node")) |
| 218 | (manual-html-mono texi (expand-file-name "emacs.html" html-mono-dir)) | 253 | (manual-html-node elisp (expand-file-name "elisp" html-node-dir))) |
| 219 | (manual-txt texi (expand-file-name "emacs.txt" txt-dir)) | 254 | (if (member type '(nil "elisp" "elisp-mono")) |
| 220 | (manual-pdf texi (expand-file-name "emacs.pdf" dest)) | 255 | (manual-html-mono elisp (expand-file-name "elisp.html" html-mono-dir))) |
| 221 | (manual-dvi texi (expand-file-name "emacs.dvi" dvi-dir) | 256 | (if (member type '(nil "elisp" "elisp-pdf" "pdf")) |
| 222 | (expand-file-name "emacs.ps" ps-dir))) | 257 | (manual-pdf elisp (expand-file-name "elisp.pdf" pdf-dir))) |
| 223 | ;; Lisp manual | 258 | (if (member type '(nil "elisp" "elisp-ps" "ps")) |
| 224 | (let ((texi (expand-file-name "doc/lispref/elisp.texi" root))) | 259 | (manual-ps elisp (expand-file-name "elisp.ps" ps-dir))) |
| 225 | (manual-html-node texi (expand-file-name "elisp" html-node-dir)) | 260 | (if (member type '(nil "eintr" "eintr-node")) |
| 226 | (manual-html-mono texi (expand-file-name "elisp.html" html-mono-dir)) | 261 | (manual-html-node eintr (expand-file-name "eintr" html-node-dir))) |
| 227 | (manual-txt texi (expand-file-name "elisp.txt" txt-dir)) | 262 | (if (member type '(nil "eintr" "eintr-node")) |
| 228 | (manual-pdf texi (expand-file-name "elisp.pdf" dest)) | 263 | (manual-html-mono eintr (expand-file-name "eintr.html" html-mono-dir))) |
| 229 | (manual-dvi texi (expand-file-name "elisp.dvi" dvi-dir) | 264 | (if (member type '(nil "eintr" "eintr-pdf" "pdf")) |
| 230 | (expand-file-name "elisp.ps" ps-dir))) | 265 | (manual-pdf eintr (expand-file-name "eintr.pdf" pdf-dir))) |
| 231 | (let ((texi (expand-file-name "doc/lispintro/emacs-lisp-intro.texi" root)) | 266 | (if (member type '(nil "eintr" "eintr-ps" "ps")) |
| 232 | (dest (expand-file-name "emacs-lisp-intro" dest)) | 267 | (manual-ps eintr (expand-file-name "eintr.ps" ps-dir))) |
| 233 | dest2 dest3) | ||
| 234 | ;; Mimic the atypical directory layout used for emacs-lisp-intro. | ||
| 235 | (make-directory dest) | ||
| 236 | (make-directory (setq dest2 (expand-file-name "html_node" dest))) | ||
| 237 | (manual-html-node texi dest2) | ||
| 238 | (make-directory (setq dest2 (expand-file-name "html_mono" dest))) | ||
| 239 | (manual-html-mono texi (expand-file-name "emacs-lisp-intro.html" dest2)) | ||
| 240 | (make-directory (setq dest2 (expand-file-name "txt" dest))) | ||
| 241 | (manual-txt texi (expand-file-name "emacs-lisp-intro.txt" dest2)) | ||
| 242 | (manual-pdf texi (expand-file-name "emacs-lisp-intro.pdf" dest)) | ||
| 243 | (make-directory (setq dest2 (expand-file-name "dvi" dest))) | ||
| 244 | (make-directory (setq dest3 (expand-file-name "ps" dest))) | ||
| 245 | (manual-dvi texi (expand-file-name "emacs-lisp-intro.dvi" dest2) | ||
| 246 | (expand-file-name "emacs-lisp-intro.ps" dest3))) | ||
| 247 | ;; Misc manuals | 268 | ;; Misc manuals |
| 248 | (let ((manuals '("ada-mode" "auth" "autotype" "bovine" "calc" "cc-mode" | 269 | (dolist (manual misc) |
| 249 | "cl" "dbus" "dired-x" "ebrowse" "ede" "ediff" | 270 | (if (member type `(nil ,manual "misc")) |
| 250 | "edt" "eieio" "emacs-gnutls" "emacs-mime" "epa" "erc" "ert" | 271 | (manual-misc-html manual root html-node-dir html-mono-dir))) |
| 251 | "eshell" "eudc" "faq" "flymake" "forms" | ||
| 252 | "gnus" "htmlfontify" "idlwave" "info" | ||
| 253 | "mairix-el" "message" "mh-e" "newsticker" | ||
| 254 | "nxml-mode" "org" "pcl-cvs" "pgg" "rcirc" | ||
| 255 | "reftex" "remember" "sasl" "sc" "semantic" | ||
| 256 | "ses" "sieve" "smtpmail" "speedbar" "srecode" "tramp" | ||
| 257 | "url" "vip" "viper" "widget" "wisent" "woman"))) | ||
| 258 | (dolist (manual manuals) | ||
| 259 | (manual-misc-html manual root html-node-dir html-mono-dir))) | ||
| 260 | (message "Manuals created in %s" dest))) | 272 | (message "Manuals created in %s" dest))) |
| 261 | 273 | ||
| 262 | (defconst manual-doctype-string | 274 | (defconst manual-doctype-string |
| @@ -274,7 +286,12 @@ Root must be the root of an Emacs source tree." | |||
| 274 | @import url('/s/emacs/manual.css');\n</style>\n") | 286 | @import url('/s/emacs/manual.css');\n</style>\n") |
| 275 | 287 | ||
| 276 | (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) |
| 277 | (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))) | ||
| 278 | (manual-html-node texi (expand-file-name name html-node-dir)) | 295 | (manual-html-node texi (expand-file-name name html-node-dir)) |
| 279 | (manual-html-mono texi (expand-file-name (concat name ".html") | 296 | (manual-html-mono texi (expand-file-name (concat name ".html") |
| 280 | html-mono-dir)))) | 297 | html-mono-dir)))) |
| @@ -284,6 +301,7 @@ Root must be the root of an Emacs source tree." | |||
| 284 | 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 |
| 285 | 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 |
| 286 | the @import directive." | 303 | the @import directive." |
| 304 | (make-directory (or (file-name-directory dest) ".") t) | ||
| 287 | (call-process "makeinfo" nil nil nil | 305 | (call-process "makeinfo" nil nil nil |
| 288 | "-D" "WWW_GNU_ORG" | 306 | "-D" "WWW_GNU_ORG" |
| 289 | "-I" (expand-file-name "../emacs" | 307 | "-I" (expand-file-name "../emacs" |
| @@ -310,6 +328,7 @@ HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using | |||
| 310 | the @import directive." | 328 | the @import directive." |
| 311 | (unless (file-exists-p texi-file) | 329 | (unless (file-exists-p texi-file) |
| 312 | (error "Manual file %s not found" texi-file)) | 330 | (error "Manual file %s not found" texi-file)) |
| 331 | (make-directory dir t) | ||
| 313 | (call-process "makeinfo" nil nil nil | 332 | (call-process "makeinfo" nil nil nil |
| 314 | "-D" "WWW_GNU_ORG" | 333 | "-D" "WWW_GNU_ORG" |
| 315 | "-I" (expand-file-name "../emacs" | 334 | "-I" (expand-file-name "../emacs" |
| @@ -344,37 +363,25 @@ the @import directive." | |||
| 344 | (manual-html-fix-node-div)) | 363 | (manual-html-fix-node-div)) |
| 345 | (save-buffer)))))) | 364 | (save-buffer)))))) |
| 346 | 365 | ||
| 347 | (defun manual-txt (texi-file dest) | ||
| 348 | "Run Makeinfo on TEXI-FILE, emitting plaintext output to DEST." | ||
| 349 | (call-process "makeinfo" nil nil nil | ||
| 350 | "-I" (expand-file-name "../emacs" | ||
| 351 | (file-name-directory texi-file)) | ||
| 352 | "-I" (expand-file-name "../misc" | ||
| 353 | (file-name-directory texi-file)) | ||
| 354 | "--plaintext" "--no-split" texi-file "-o" dest) | ||
| 355 | (shell-command (concat "gzip -c " dest " > " (concat dest ".gz")))) | ||
| 356 | |||
| 357 | (defun manual-pdf (texi-file dest) | 366 | (defun manual-pdf (texi-file dest) |
| 358 | "Run texi2pdf on TEXI-FILE, emitting plaintext output to DEST." | 367 | "Run texi2pdf on TEXI-FILE, emitting pdf output to DEST." |
| 359 | (call-process "texi2pdf" nil nil nil | 368 | (make-directory (or (file-name-directory dest) ".") t) |
| 360 | "-I" (expand-file-name "../emacs" | 369 | (let ((default-directory (file-name-directory texi-file))) |
| 361 | (file-name-directory texi-file)) | 370 | (call-process "texi2pdf" nil nil nil |
| 362 | "-I" (expand-file-name "../misc" | 371 | "-I" "../emacs" "-I" "../misc" |
| 363 | (file-name-directory texi-file)) | 372 | texi-file "-o" dest))) |
| 364 | texi-file "-o" dest)) | 373 | |
| 365 | 374 | (defun manual-ps (texi-file dest) | |
| 366 | (defun manual-dvi (texi-file dest ps-dest) | 375 | "Generate a PostScript version of TEXI-FILE as DEST." |
| 367 | "Run texi2dvi on TEXI-FILE, emitting dvi output to DEST. | 376 | (make-directory (or (file-name-directory dest) ".") t) |
| 368 | Also generate PostScript output in PS-DEST." | 377 | (let ((dvi-dest (concat (file-name-sans-extension dest) ".dvi")) |
| 369 | (call-process "texi2dvi" nil nil nil | 378 | (default-directory (file-name-directory texi-file))) |
| 370 | "-I" (expand-file-name "../emacs" | 379 | (call-process "texi2dvi" nil nil nil |
| 371 | (file-name-directory texi-file)) | 380 | "-I" "../emacs" "-I" "../misc" |
| 372 | "-I" (expand-file-name "../misc" | 381 | texi-file "-o" dvi-dest) |
| 373 | (file-name-directory texi-file)) | 382 | (call-process "dvips" nil nil nil dvi-dest "-o" dest) |
| 374 | texi-file "-o" dest) | 383 | (delete-file dvi-dest) |
| 375 | (call-process "dvips" nil nil nil dest "-o" ps-dest) | 384 | (call-process "gzip" nil nil nil dest))) |
| 376 | (call-process "gzip" nil nil nil dest) | ||
| 377 | (call-process "gzip" nil nil nil ps-dest)) | ||
| 378 | 385 | ||
| 379 | (defun manual-html-fix-headers () | 386 | (defun manual-html-fix-headers () |
| 380 | "Fix up HTML headers for the Emacs manual in the current buffer." | 387 | "Fix up HTML headers for the Emacs manual in the current buffer." |
| @@ -478,7 +485,8 @@ Also generate PostScript output in PS-DEST." | |||
| 478 | (setq done t)) | 485 | (setq done t)) |
| 479 | (t | 486 | (t |
| 480 | (if (eobp) | 487 | (if (eobp) |
| 481 | (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))) | ||
| 482 | (unless open-td | 490 | (unless open-td |
| 483 | (setq done t)))) | 491 | (setq done t)))) |
| 484 | (forward-line 1)))) | 492 | (forward-line 1)))) |