aboutsummaryrefslogtreecommitdiffstats
path: root/admin/admin.el
diff options
context:
space:
mode:
authorJoakim Verona2013-07-14 11:04:49 +0200
committerJoakim Verona2013-07-14 11:04:49 +0200
commit0bb9bb0841d89fff09820a57369df4cb01b16b43 (patch)
tree832bf9fa8415eef0ce464d22b3ee1300cfa90bb1 /admin/admin.el
parent3718127221fbbc31f8ebd027ab7c95403dbe9118 (diff)
parent3af1c8684ed6e48fbc21481d129e9aa164752c6e (diff)
downloademacs-0bb9bb0841d89fff09820a57369df4cb01b16b43.tar.gz
emacs-0bb9bb0841d89fff09820a57369df4cb01b16b43.zip
Merge branch 'trunk' into xwidget
Conflicts: src/xdisp.c
Diffstat (limited to 'admin/admin.el')
-rw-r--r--admin/admin.el132
1 files changed, 83 insertions, 49 deletions
diff --git a/admin/admin.el b/admin/admin.el
index 2bc4955810d..9c0015fc413 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -193,58 +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.
214Interactively with a prefix argument, prompt for TYPE.
215Optional 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 (ps-dir (expand-file-name "ps" dest))) 232 (ps-dir (expand-file-name "ps" 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.
203 (when (file-directory-p dest) 240 (when (file-directory-p dest)
204 (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))
205 (delete-directory dest t) 242 (delete-directory dest t)
206 (error "Aborted"))) 243 (user-error "Aborted")))
207 (make-directory dest) 244 (if (member type '(nil "emacs" "emacs-node"))
208 (make-directory html-node-dir) 245 (manual-html-node emacs (expand-file-name "emacs" html-node-dir)))
209 (make-directory html-mono-dir) 246 (if (member type '(nil "emacs" "emacs-mono"))
210 (make-directory ps-dir) 247 (manual-html-mono emacs (expand-file-name "emacs.html" html-mono-dir)))
211 ;; Emacs manual 248 (if (member type '(nil "emacs" "emacs-pdf" "pdf"))
212 (let ((texi (expand-file-name "doc/emacs/emacs.texi" root))) 249 (manual-pdf emacs (expand-file-name "emacs.pdf" pdf-dir)))
213 (manual-html-node texi (expand-file-name "emacs" html-node-dir)) 250 (if (member type '(nil "emacs" "emacs-ps" "ps"))
214 (manual-html-mono texi (expand-file-name "emacs.html" html-mono-dir)) 251 (manual-ps emacs (expand-file-name "emacs.ps" ps-dir)))
215 (manual-pdf texi (expand-file-name "emacs.pdf" dest)) 252 (if (member type '(nil "elisp" "elisp-node"))
216 (manual-ps texi (expand-file-name "emacs.ps" ps-dir))) 253 (manual-html-node elisp (expand-file-name "elisp" html-node-dir)))
217 ;; Lisp manual 254 (if (member type '(nil "elisp" "elisp-mono"))
218 (let ((texi (expand-file-name "doc/lispref/elisp.texi" root))) 255 (manual-html-mono elisp (expand-file-name "elisp.html" html-mono-dir)))
219 (manual-html-node texi (expand-file-name "elisp" html-node-dir)) 256 (if (member type '(nil "elisp" "elisp-pdf" "pdf"))
220 (manual-html-mono texi (expand-file-name "elisp.html" html-mono-dir)) 257 (manual-pdf elisp (expand-file-name "elisp.pdf" pdf-dir)))
221 (manual-pdf texi (expand-file-name "elisp.pdf" dest)) 258 (if (member type '(nil "elisp" "elisp-ps" "ps"))
222 (manual-ps texi (expand-file-name "elisp.ps" ps-dir))) 259 (manual-ps elisp (expand-file-name "elisp.ps" ps-dir)))
223 (let ((texi (expand-file-name "doc/lispintro/emacs-lisp-intro.texi" root)) 260 (if (member type '(nil "eintr" "eintr-node"))
224 (dest (expand-file-name "emacs-lisp-intro" dest)) 261 (manual-html-node eintr (expand-file-name "eintr" html-node-dir)))
225 dest2) 262 (if (member type '(nil "eintr" "eintr-node"))
226 ;; Mimic the atypical directory layout used for emacs-lisp-intro. 263 (manual-html-mono eintr (expand-file-name "eintr.html" html-mono-dir)))
227 (make-directory dest) 264 (if (member type '(nil "eintr" "eintr-pdf" "pdf"))
228 (make-directory (setq dest2 (expand-file-name "html_node" dest))) 265 (manual-pdf eintr (expand-file-name "eintr.pdf" pdf-dir)))
229 (manual-html-node texi dest2) 266 (if (member type '(nil "eintr" "eintr-ps" "ps"))
230 (make-directory (setq dest2 (expand-file-name "html_mono" dest))) 267 (manual-ps eintr (expand-file-name "eintr.ps" ps-dir)))
231 (manual-html-mono texi (expand-file-name "emacs-lisp-intro.html" dest2))
232 (manual-pdf texi (expand-file-name "emacs-lisp-intro.pdf" dest))
233 (make-directory (setq dest2 (expand-file-name "ps" dest)))
234 (manual-ps texi (expand-file-name "emacs-lisp-intro.ps" dest2)))
235 ;; Misc manuals 268 ;; Misc manuals
236 (let ((manuals '("ada-mode" "auth" "autotype" "bovine" "calc" "cc-mode" 269 (dolist (manual misc)
237 "cl" "dbus" "dired-x" "ebrowse" "ede" "ediff" 270 (if (member type `(nil ,manual "misc"))
238 "edt" "eieio" "emacs-gnutls" "emacs-mime" "epa" "erc" "ert" 271 (manual-misc-html manual root html-node-dir html-mono-dir)))
239 "eshell" "eudc" "faq" "flymake" "forms"
240 "gnus" "htmlfontify" "idlwave" "info"
241 "mairix-el" "message" "mh-e" "newsticker"
242 "nxml-mode" "org" "pcl-cvs" "pgg" "rcirc"
243 "reftex" "remember" "sasl" "sc" "semantic"
244 "ses" "sieve" "smtpmail" "speedbar" "srecode" "tramp"
245 "url" "vip" "viper" "widget" "wisent" "woman")))
246 (dolist (manual manuals)
247 (manual-misc-html manual root html-node-dir html-mono-dir)))
248 (message "Manuals created in %s" dest))) 272 (message "Manuals created in %s" dest)))
249 273
250(defconst manual-doctype-string 274(defconst manual-doctype-string
@@ -259,10 +283,15 @@ Root must be the root of an Emacs source tree."
259<meta name=\"DC.title\" content=\"gnu.org\">\n\n") 283<meta name=\"DC.title\" content=\"gnu.org\">\n\n")
260 284
261(defconst manual-style-string "<style type=\"text/css\"> 285(defconst manual-style-string "<style type=\"text/css\">
262@import url('/s/emacs/manual.css');\n</style>\n") 286@import url('/software/emacs/manual.css');\n</style>\n")
263 287
264(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)
265 (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)))
266 (manual-html-node texi (expand-file-name name html-node-dir)) 295 (manual-html-node texi (expand-file-name name html-node-dir))
267 (manual-html-mono texi (expand-file-name (concat name ".html") 296 (manual-html-mono texi (expand-file-name (concat name ".html")
268 html-mono-dir)))) 297 html-mono-dir))))
@@ -272,6 +301,7 @@ Root must be the root of an Emacs source tree."
272This function also edits the HTML files so that they validate as 301This function also edits the HTML files so that they validate as
273HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using 302HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
274the @import directive." 303the @import directive."
304 (make-directory (or (file-name-directory dest) ".") t)
275 (call-process "makeinfo" nil nil nil 305 (call-process "makeinfo" nil nil nil
276 "-D" "WWW_GNU_ORG" 306 "-D" "WWW_GNU_ORG"
277 "-I" (expand-file-name "../emacs" 307 "-I" (expand-file-name "../emacs"
@@ -298,6 +328,7 @@ HTML 4.01 Transitional, and pulls in the gnu.org stylesheet using
298the @import directive." 328the @import directive."
299 (unless (file-exists-p texi-file) 329 (unless (file-exists-p texi-file)
300 (error "Manual file %s not found" texi-file)) 330 (error "Manual file %s not found" texi-file))
331 (make-directory dir t)
301 (call-process "makeinfo" nil nil nil 332 (call-process "makeinfo" nil nil nil
302 "-D" "WWW_GNU_ORG" 333 "-D" "WWW_GNU_ORG"
303 "-I" (expand-file-name "../emacs" 334 "-I" (expand-file-name "../emacs"
@@ -334,6 +365,7 @@ the @import directive."
334 365
335(defun manual-pdf (texi-file dest) 366(defun manual-pdf (texi-file dest)
336 "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)
337 (let ((default-directory (file-name-directory texi-file))) 369 (let ((default-directory (file-name-directory texi-file)))
338 (call-process "texi2pdf" nil nil nil 370 (call-process "texi2pdf" nil nil nil
339 "-I" "../emacs" "-I" "../misc" 371 "-I" "../emacs" "-I" "../misc"
@@ -341,6 +373,7 @@ the @import directive."
341 373
342(defun manual-ps (texi-file dest) 374(defun manual-ps (texi-file dest)
343 "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)
344 (let ((dvi-dest (concat (file-name-sans-extension dest) ".dvi")) 377 (let ((dvi-dest (concat (file-name-sans-extension dest) ".dvi"))
345 (default-directory (file-name-directory texi-file))) 378 (default-directory (file-name-directory texi-file)))
346 (call-process "texi2dvi" nil nil nil 379 (call-process "texi2dvi" nil nil nil
@@ -452,7 +485,8 @@ the @import directive."
452 (setq done t)) 485 (setq done t))
453 (t 486 (t
454 (if (eobp) 487 (if (eobp)
455 (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)))
456 (unless open-td 490 (unless open-td
457 (setq done t)))) 491 (setq done t))))
458 (forward-line 1)))) 492 (forward-line 1))))