;ELC ;;; compiled by rms@mole.gnu.ai.mit.edu on Fri Jan 26 02:05:21 1996 ;;; from file /home/fsf/rms/e19/lisp/time-stamp.el ;;; emacs version 19.30.90.1. ;;; 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.29"))) (error "`time-stamp.el' was compiled for Emacs 19.29 or later")) #@158 *Non-nil to enable time-stamping of buffers by \[time-stamp]. Can be toggled by \[time-stamp-toggle-active]. See also the variable time-stamp-warn-inactive. (defvar time-stamp-active t (#$ . -479)) #@210 *Non-nil to have \[time-stamp] warn if a buffer did not get time-stamped. A warning is printed if time-stamp-active is nil and the buffer contains a time stamp template that would otherwise have been updated. (defvar time-stamp-warn-inactive t (#$ . -684)) #@1053 *Template for the string inserted by \[time-stamp]. 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 %: %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" (defvar time-stamp-format "%02y/%02m/%02d %02H:%02M:%02S %u" (#$ . -949)) #@525 Lines of a file searched; positive counts from start, negative from end. The patterns `time-stamp-start' and `time-stamp-end' must be found on one of the first (last) `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 (#$ . 2082)) #@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:[ ]+\\\\?[\"<]+" (#$ . 2658)) #@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 "\\\\?[\">]" (#$ . 3130)) #@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 "À‰‰‰ ;ƒœ;ƒœŠŒ~ˆÈVƒ,e‰bˆyˆ`‚7d‰bˆyˆ`\nbˆ` Wƒ˜É Ê#ƒ˜`Àˆ` \nbˆÉ Ê#ƒ”\fƒ‹È” \n |ˆ\nbˆÎ cˆ` \nbˆÏÐ Ñ#ƒ‡Ò\n \"ˆ)‚’ƒ’Ñ`)‚:*‚¤ÔÕ!ˆÖ×!ˆ ƒ°ÔØ!ˆÖ×!ˆ,À‡" [nil search-end start need-to-warn case-fold-search time-stamp-start time-stamp-end time-stamp-line-limit 0 re-search-forward move line-end time-stamp-active end time-stamp-string search-forward " " t untabify time-stamp-warn-inactive message "time-stamp-start or time-stamp-end is not a string" sit-for 1 "Warning: time-stamp-active is off; did not time-stamp buffer."] 4 (#$ . 3710) nil]) #@139 Toggle time-stamp-active, setting whether \[time-stamp] updates a buffer. 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 (#$ . 5055) "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 (#$ . 5399)]) #@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))) (#$ . 5594)) (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))) (#$ . 6034)) (byte-code "ÀÁ\nBÁ‡" [["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"] time-stamp-weekday-full-names current-load-list] 2) #@55 List of strings used to denote morning and afternoon. (defconst time-stamp-am-pm (quote ("am" "pm")) (#$ . 6369)) #@62 String to use when the buffer is not associated with a file. (defconst time-stamp-no-file "(no file)" (#$ . 6489)) #@233 Uses a FORMAT to format date, time, file, and user information. Optional second argument TIME will be used instead of the current time. See the description of the variable `time-stamp-format' for a description of the format string. (defalias 'time-stamp-strftime #[(format &optional time) ";ƒ ‚ƒÁ!‚Á \nGÃĉÅĉ‰Ã \n \f  Wƒ‰\n H\f\n\fÐ=ƒw T  T‰ Wƒb\n H‚cÃ\fÑ\fXƒsÒ\fY„O\n  OÑ\fXƒ‰Ò\fY„\fÓ=„\fÔ=„\fÕ=„\fÖ=„\f×=„\fØ=„\fÙ=„\fÚ=„\fÛ=ƒØ Ü=„ØT‰„\fÝ=ƒö Ü=„öÃVƒöS‰‚ÃVƒ# Wƒ# T \f  Wƒ\n H‚Ã\f‚{\fÐ=ƒ.Þ‚\fß=„<\fà=ƒ^!âÃãO$\"AH%\fß=ƒW%‚Z%–)‚\fæ=„l\fç=ƒŽ(âéêO+\"AH%\fæ=ƒ‡%‚Š%–)‚\fì=ƒŸíîïO!‚\fð=ƒ°íñòO!‚\fó=ƒáíñòO!‰4õWƒÍ4ö\\‚Ý4öVƒÛ4öZ‚Ý4)‚\f÷=ƒõâéêO+\"A‚\fø=ƒíùúO!‚\fû=„\fü=ƒ?öíñòO!Vƒ&=@‚*=A@%\fû=ƒ8%‚;%–)‚\fþ=ƒRíÿ@O!‚\fA=ƒhâÃãO$\"A‚\fB=ƒ}íCÄO!‚\fD=„\fE=ƒ¿FG!… G!A@‰%„©Å%\fD=ƒ¸%—‚»%–)‚\fH=ƒÛIƒÖJI!‚K‚\fL=ƒîI†K‚\fM=ƒþN ‚\fO=ƒP ‚\fQ=…R Řƒ)‚}‰S§ƒ:ì‚=M#†DÅ\"‰TGí!U‰VUVƒq;ƒgTÃUO‚sTU[ÄO‚sT+‚}W\f!P\n T‰ ‚5\n.\n‡" [time current-time-string format 0 nil "" paren-level field-result field-width field-index result prev-char cur-char ind fmt-len time-string 37 48 57 46 44 58 64 45 43 32 35 40 92 41 "%" 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 time-stamp-am-pm 83 17 19 119 121 -4 122 90 fboundp current-time-zone 102 buffer-file-name file-name-nondirectory time-stamp-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] 11 (#$ . 6611)]) #@255 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. (defalias 'time-stamp-mail-host-name #[nil "ÀÁ!ƒ ;ƒ † ÀÂ!ƒ\n;ƒ\n† à ‡" [boundp mail-host-address time-stamp-mail-host system-name] 2 (#$ . 8562)]) #@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 (#$ . 8980)]) #@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 (#$ . 9455)]) #@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 (#$ . 9751)]) #@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 (#$ . 10038)]) #@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 (#$ . 10258)]) #@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 (#$ . 10515)]) #@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 (#$ . 10776)]) #@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 (#$ . 11037)]) #@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 (#$ . 11288)]) #@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 (#$ . 11441)]) (provide (quote time-stamp))