aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-16 05:29:01 +0000
committerRichard M. Stallman1997-07-16 05:29:01 +0000
commitd097058598b7172f37939f31d425c0789eac8527 (patch)
tree8433ecab5bf918f6717ab0adea78f039c9bdbaee
parent65fda17c7ab0fd41622fc780fb3bf883fc19a5e0 (diff)
downloademacs-d097058598b7172f37939f31d425c0789eac8527.tar.gz
emacs-d097058598b7172f37939f31d425c0789eac8527.zip
(texinfo-format-buffer-1): Insert, here,
the info about what file this is and what it was made from, just before returning. (texinfo-format-setfilename): Generate no output.
-rw-r--r--lisp/textmodes/texinfmt.el51
1 files changed, 28 insertions, 23 deletions
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index ffc8b1fb1e6..885a0625901 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -357,11 +357,18 @@ Info-split to do these manually."
357 (error "Texinfo file needs an `@setfilename FILENAME' line.")) 357 (error "Texinfo file needs an `@setfilename FILENAME' line."))
358 (setq texinfo-command-end (point)) 358 (setq texinfo-command-end (point))
359 (setq outfile (texinfo-parse-line-arg))) 359 (setq outfile (texinfo-parse-line-arg)))
360
360 (find-file outfile) 361 (find-file outfile)
361 (texinfo-mode) 362 (texinfo-mode)
363 (erase-buffer)
364
365 (message "Formatting Info file: %s" outfile)
366 (setq texinfo-format-filename
367 (file-name-nondirectory (expand-file-name outfile)))
368
362 (setq fill-column fill-column-for-info) 369 (setq fill-column fill-column-for-info)
363 (set-syntax-table texinfo-format-syntax-table) 370 (set-syntax-table texinfo-format-syntax-table)
364 (erase-buffer) 371
365 (insert-buffer-substring input-buffer) 372 (insert-buffer-substring input-buffer)
366 (message "Converting %s to Info format..." (buffer-name input-buffer)) 373 (message "Converting %s to Info format..." (buffer-name input-buffer))
367 374
@@ -410,8 +417,26 @@ Info-split to do these manually."
410 (insert "\n")) 417 (insert "\n"))
411 ;; Scan the whole buffer, converting to Info format. 418 ;; Scan the whole buffer, converting to Info format.
412 (texinfo-format-scan) 419 (texinfo-format-scan)
413 ;; Return data for indices.
414 (goto-char (point-min)) 420 (goto-char (point-min))
421 ;; Insert info about how this file was made.
422 (insert "Info file: "
423 texinfo-format-filename ", -*-Text-*-\n"
424 "produced by `texinfo-format-buffer'\n"
425 ;; Date string removed so that regression testing is easier.
426 ;; "on "
427 ;; (insert (format-time-string "%e %b %Y")) " "
428 "from file"
429 (if (buffer-file-name input-buffer)
430 (concat " `"
431 (file-name-sans-versions
432 (file-name-nondirectory
433 (buffer-file-name input-buffer)))
434 "'")
435 (concat "buffer `" (buffer-name input-buffer) "'"))
436 "\nusing `texinfmt.el' version "
437 texinfmt-version
438 ".\n\n")
439 ;; Return data for indices.
415 (list outfile 440 (list outfile
416 texinfo-vindex texinfo-findex texinfo-cindex 441 texinfo-vindex texinfo-findex texinfo-cindex
417 texinfo-pindex texinfo-tindex texinfo-kindex))) 442 texinfo-pindex texinfo-tindex texinfo-kindex)))
@@ -1068,27 +1093,7 @@ Leave point after argument."
1068;; specially. 1093;; specially.
1069(put 'setfilename 'texinfo-format 'texinfo-format-setfilename) 1094(put 'setfilename 'texinfo-format 'texinfo-format-setfilename)
1070(defun texinfo-format-setfilename () 1095(defun texinfo-format-setfilename ()
1071 (let ((arg (texinfo-parse-arg-discard))) 1096 (texinfo-parse-arg-discard))
1072 (message "Formatting Info file: %s" arg)
1073 (setq texinfo-format-filename
1074 (file-name-nondirectory (expand-file-name arg)))
1075 (insert "Info file: "
1076 texinfo-format-filename ", -*-Text-*-\n"
1077 "produced by `texinfo-format-buffer'\n"
1078 ;; Date string removed so that regression testing is easier.
1079 ;; "on "
1080 ;; (insert (format-time-string "%e %b %Y")) " "
1081 "from file"
1082 (if (buffer-file-name input-buffer)
1083 (concat " `"
1084 (file-name-sans-versions
1085 (file-name-nondirectory
1086 (buffer-file-name input-buffer)))
1087 "'")
1088 (concat "buffer `" (buffer-name input-buffer) "'"))
1089 "\nusing `texinfmt.el' version "
1090 texinfmt-version
1091 ".\n\n")))
1092 1097
1093;;; @node, @menu, @detailmenu 1098;;; @node, @menu, @detailmenu
1094 1099