comparison lisp/textmodes/texinfmt.el @ 15680:0f1c12e35879

(texinfo-format-today): Avoid race condition by getting current time only once.
author Karl Heuer <kwzh@gnu.org>
date Mon, 15 Jul 1996 20:26:39 +0000
parents 83f275dcd93a
children eb812636dcb5
comparison
equal deleted inserted replaced
15679:4942f03c75f8 15680:0f1c12e35879
889 (message "Formatting Info file: %s" arg) 889 (message "Formatting Info file: %s" arg)
890 (setq texinfo-format-filename 890 (setq texinfo-format-filename
891 (file-name-nondirectory (expand-file-name arg))) 891 (file-name-nondirectory (expand-file-name arg)))
892 (insert "Info file: " 892 (insert "Info file: "
893 texinfo-format-filename ", -*-Text-*-\n" 893 texinfo-format-filename ", -*-Text-*-\n"
894 ;; Date string removed so that regression testing is easier.
895 ;; "produced on "
896 ;; (substring (current-time-string) 8 10) " "
897 ;; (substring (current-time-string) 4 7) " "
898 ;; (substring (current-time-string) -4) " "
899 "produced by `texinfo-format-buffer'\n" 894 "produced by `texinfo-format-buffer'\n"
900 "from file" 895 "from file"
901 (if (buffer-file-name input-buffer) 896 (if (buffer-file-name input-buffer)
902 (concat " `" 897 (concat " `"
903 (file-name-sans-versions 898 (file-name-sans-versions
1566 1561
1567 ; Produces Day Month Year style of output. eg `1 Jan 1900' 1562 ; Produces Day Month Year style of output. eg `1 Jan 1900'
1568 ; The `@today{}' command requires a pair of braces, like `@dots{}'. 1563 ; The `@today{}' command requires a pair of braces, like `@dots{}'.
1569 (defun texinfo-format-today () 1564 (defun texinfo-format-today ()
1570 (texinfo-parse-arg-discard) 1565 (texinfo-parse-arg-discard)
1571 (insert (format "%s %s %s" 1566 (insert (format-time-string "%e %b %Y")))
1572 (substring (current-time-string) 8 10)
1573 (substring (current-time-string) 4 7)
1574 (substring (current-time-string) -4))))
1575 1567
1576 1568
1577 ;;; @ignore 1569 ;;; @ignore
1578 1570
1579 (put 'ignore 'texinfo-format 'texinfo-format-ignore) 1571 (put 'ignore 'texinfo-format 'texinfo-format-ignore)