;ELC ;;; compiled by roland@churchy.gnu.ai.mit.edu on Fri Jun 2 23:09:44 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/time-stamp.el ;;; emacs version 19.28.92.3. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.28.90"))) (error "`time-stamp.el' was compiled for Emacs 19.29 or later")) #@139 *Non-nil to enable time-stamping of files. Can be toggled by \[time-stamp-toggle-active]. See also the variable time-stamp-warn-inactive. (defvar time-stamp-active t (#$ . -489)) #@63 *Non-nil to have time-stamp warn if time-stamp-active is nil. (defvar time-stamp-warn-inactive t (#$ . -674)) #@542 *Template for the string inserted by the time-stamp function. Value may be a string or a list. (Lists are supported only for backward compatibility.) A string is used verbatim except for character sequences beginning with %. See the documentation for the function time-stamp-strftime for a list of %-escapes. Each element of a list is called as a function and the results are concatenated together separated by spaces. List elements may also be strings, which are included verbatim. Spaces are not inserted around literal strings. (defvar time-stamp-format "%02y/%02m/%02d %02H:%02M:%02S %u" (#$ . -791)) #@507 Number of lines at the beginning of a file that are searched. The patterns `time-stamp-start' and `time-stamp-end' must be found on one of the first `time-stamp-line-limit' lines of the file for the file to be time-stamped by \[time-stamp]. Do not change `time-stamp-line-limit', `time-stamp-start', or `time-stamp-end' for yourself or you will be incompatible with other people's files! If you must change them for some application, do so in the local variables section of the time-stamped file itself. (defvar time-stamp-line-limit 8 (#$ . 1413)) #@398 Regexp after which the time stamp is written by \[time-stamp]. See also the variables `time-stamp-end' and `time-stamp-line-limit'. Do not change `time-stamp-line-limit', `time-stamp-start', or `time-stamp-end' for yourself or you will be incompatible with other people's files! If you must change them for some application, do so in the local variables section of the time-stamped file itself. (defvar time-stamp-start "Time-stamp:[ ]+\\\\?[\"<]+" (#$ . 1971)) #@525 Regexp marking the text after the time stamp. \[time-stamp] deletes the text between the first match of `time-stamp-start' and the following match of `time-stamp-end' on the same line, then writes the time stamp specified by `time-stamp-format' between them. Do not change `time-stamp-line-limit', `time-stamp-start', or `time-stamp-end' for yourself or you will be incompatible with other people's files! If you must change them for some application, do so in the local variables section of the time-stamped file itself. (defvar time-stamp-end "\\\\?[\">]" (#$ . 2443)) #@730 Update the time stamp string in the buffer. If you put a time stamp template anywhere in the first 8 lines of a file, it can be updated every time you save the file. See the top of `time-stamp.el' for a sample. The template looks like one of the following: Time-stamp: <> Time-stamp: " " The time stamp is written between the brackets or quotes, resulting in Time-stamp: <95/01/18 10:20:51 gildea> Only does its thing if the variable time-stamp-active is non-nil. Typically used on write-file-hooks for automatic time-stamping. The format of the time stamp is determined by the variable time-stamp-format. The variables time-stamp-line-limit, time-stamp-start, and time-stamp-end control finding the template. (defalias 'time-stamp #[nil " ;q\f;q~eb y`)#m`\f`)#l eʔ  |b c` b #a \")ll)*y!! !!*" [nil need-to-warn case-fold-search time-stamp-start time-stamp-end re-search-forward time-stamp-line-limit t start time-stamp-active 0 end time-stamp-string search-forward " " untabify time-stamp-warn-inactive message "time-stamp-start or time-stamp-end is not a string" sit-for 1 "Warning: did not time-stamp buffer."] 4 (#$ . 3023) nil]) #@129 Toggle time-stamp-active, which enables time stamping of files. With arg, turn time stamping on if and only if arg is positive. (defalias 'time-stamp-toggle-active #[(&optional arg) " ?!V Ƃ\"" [arg time-stamp-active prefix-numeric-value 0 message "time-stamp is now %s." "active" "off"] 3 (#$ . 4269) "P"]) #@58 Generate the new string to be inserted by \[time-stamp]. (defalias 'time-stamp-string #[nil "; !\"" [time-stamp-format time-stamp-strftime time-stamp-fconcat " "] 3 (#$ . 4603)]) #@35 Alist of months and their number. (defconst time-stamp-month-numbers (quote (("Jan" . 1) ("Feb" . 2) ("Mar" . 3) ("Apr" . 4) ("May" . 5) ("Jun" . 6) ("Jul" . 7) ("Aug" . 8) ("Sep" . 9) ("Oct" . 10) ("Nov" . 11) ("Dec" . 12))) (#$ . 4798)) (byte-code "\nB" [["(zero)" "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"] time-stamp-month-full-names current-load-list] 2) #@37 Alist of weekdays and their number. (defconst time-stamp-weekday-numbers (quote (("Sun" . 0) ("Mon" . 1) ("Tue" . 2) ("Wed" . 3) ("Thu" . 4) ("Fri" . 5) ("Sat" . 6))) (#$ . 5238)) (byte-code "\nB" [["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"] time-stamp-weekday-full-names current-load-list] 2) #@1043 Uses a FORMAT to format date, time, file, and user information. Optional second argument TIME will be used instead of the current time. Characters in the format are copied literally except for %-directives: %a weekday name: `Monday'. %A gives uppercase: `MONDAY' %b month name: `January'. %B gives uppercase: `JANUARY' %d day of month %H 24-hour clock hour %I 12-hour clock hour %m month number %M minute %p `am' or `pm'. %P gives uppercase: `AM' or `PM' %S seconds %w day number of week, Sunday is 0 %y year: `1995' %z time zone name: `est'. %Z gives uppercase: `EST' Non-date items: %% a literal percent character: `%' %f file name without directory %F gives absolute pathname %s system name %u user's login name %h mail host name Decimal digits between the % and the type character specify the field width. Strings are truncated on the right; numbers on the left. A leading zero causes numbers to be zero-filled. For example, to get the format used by the `date' command, use "%3a %3b %2d %02H:%02M:%02S %Z %y" (defalias 'time-stamp-strftime #[(format &optional time) "; ! \nGĉ \n \f  \fW\n H\n \n= T\fW T T \n H\n\nXk\nYR\n O\n=~тL\n=\n= O\"AH\n=)L\n=\n= O\"AH\n=)L\n= O!L\n= O!L\n=1 O!'W'\\-'V+'Z-')L\n=E O\"AL\n=V O!L\n=d\n= O!Vtu\n=)L\n= O!L\n= O\"AL\n= O!L\n=\n=!!A@\n=)L\n= = =!LL\n@==LL\nA=/B L\nC=?D L\nE=LF ŘZ‰Gk߂nA#u\"HG!IJIV;HIOHI[OH+K\n!P  T / ." [time current-time-string format 0 nil "" field-result field-width field-index result cur-char ind fmt-len time-string 37 48 57 "%" 97 65 time-stamp-weekday-full-names assoc 3 time-stamp-weekday-numbers name 98 66 time-stamp-month-full-names 4 7 time-stamp-month-numbers 100 string-to-int 8 10 72 11 13 73 hour 1 12 109 77 14 16 112 80 "am" "pm" 83 17 19 119 121 -4 122 90 fboundp current-time-zone 102 buffer-file-name file-name-nondirectory "(no file)" 70 115 system-name 117 user-login-name 104 time-stamp-mail-host-name "%%%s%c" padded-result desired-length initial-length char-to-string] 9 (#$ . 5575)]) #@320 Return the name of the host where the user receives mail. This is the value of `mail-host-address' if bound and a string, otherwise the value of `time-stamp-mail-host' (for versions of Emacs before 19.29) otherwise the value of the function system-name. This function may be usefully referenced by `time-stamp-format'. (defalias 'time-stamp-mail-host-name #[nil "! ; !\n;\n " [boundp mail-host-address time-stamp-mail-host system-name] 2 (#$ . 8042)]) #@305 Similar to (mapconcat 'funcall LIST SEP) but LIST allows literals. If an element of LIST is a symbol, it is funcalled to get the string to use; the separator SEP is used between two strings obtained by funcalling a symbol. Otherwise the element itself is inserted; no separator is used around literals. (defalias 'time-stamp-fconcat #[(list sep) "\f/\f@9!\n P \f@ P( \f@P\fA *" ["" nil insert-sep-p return-string list sep t] 3 (#$ . 8525)]) #@63 Return the current date as a string in "Month DD, YYYY" form. (defalias 'time-stamp-month-dd-yyyy #[nil " \f O\"AH O! O$)" [current-time-string date format "%s %d, %s" time-stamp-month-full-names assoc 4 7 time-stamp-month-numbers string-to-int 8 10 -4 nil] 7 (#$ . 9000)]) #@125 Return the current date as a string in "Mon DD YYYY" form. The first character of DD is space if the value is less than 10. (defalias 'time-stamp-mon-dd-yyyy #[nil "  O O! O$)" [current-time-string date format "%s %2d %s" 4 7 string-to-int 8 10 -4 nil] 7 (#$ . 9296)]) #@58 Return the current date as a string in "DD Mon YY" form. (defalias 'time-stamp-dd-mon-yy #[nil "  O! O O$)" [current-time-string date format "%02d %s %s" string-to-int 8 10 4 7 -2 nil] 7 (#$ . 9583)]) #@57 Return the current date as a string in "YY/MM/DD" form. (defalias 'time-stamp-yy/mm/dd #[nil "  O O \"A O!$)" [current-time-string date format "%s/%02d/%02d" -2 nil assoc 4 7 time-stamp-month-numbers string-to-int 8 10] 8 (#$ . 9802)]) #@59 Return the current date as a string in "YYYY/MM/DD" form. (defalias 'time-stamp-yyyy/mm/dd #[nil "  O O \"A O!$)" [current-time-string date format "%s/%02d/%02d" -4 nil assoc 4 7 time-stamp-month-numbers string-to-int 8 10] 8 (#$ . 10058)]) #@59 Return the current date as a string in "YYYY-MM-DD" form. (defalias 'time-stamp-yyyy-mm-dd #[nil "  O O \"A O!$)" [current-time-string date format "%s-%02d-%02d" -4 nil assoc 4 7 time-stamp-month-numbers string-to-int 8 10] 8 (#$ . 10319)]) #@55 Return the current date as a string in "YYMMDD" form. (defalias 'time-stamp-yymmdd #[nil "  O O \"A O!$)" [current-time-string date format "%s%02d%02d" -2 nil assoc 4 7 time-stamp-month-numbers string-to-int 8 10] 8 (#$ . 10580)]) #@57 Return the current time as a string in "HH:MM:SS" form. (defalias 'time-stamp-hh:mm:ss #[nil " O" [current-time-string 11 19] 3 (#$ . 10831)]) #@53 Return the current time as a string in "HHMM" form. (defalias 'time-stamp-hhmm #[nil " O OP)" [current-time-string date 11 13 14 16] 5 (#$ . 10984)]) (provide (quote time-stamp))