diff options
| author | Gerd Moellmann | 2000-03-28 11:24:00 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-03-28 11:24:00 +0000 |
| commit | 07d505c1542656ba375ef4ea06206db8344dcabb (patch) | |
| tree | 62b2398e14f3c4bb87b2b717a731c9d34e2eee67 | |
| parent | e9b309ac910a5e3c13cca480b32a9231d76b2d9b (diff) | |
| download | emacs-07d505c1542656ba375ef4ea06206db8344dcabb.tar.gz emacs-07d505c1542656ba375ef4ea06206db8344dcabb.zip | |
(lm-last-modified-date): Add parameter
ISO-DATE. If non-nil, return date in ISO 8601 format.
| -rw-r--r-- | lisp/emacs-lisp/lisp-mnt.el | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 0fac9d944ae..2f50541fe6f 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el | |||
| @@ -287,21 +287,25 @@ The return value has the form (NAME . ADDRESS)." | |||
| 287 | (lm-with-file file | 287 | (lm-with-file file |
| 288 | (lm-header "created"))) | 288 | (lm-header "created"))) |
| 289 | 289 | ||
| 290 | (defun lm-last-modified-date (&optional file) | 290 | (defun lm-last-modified-date (&optional file iso-date) |
| 291 | "Return the modify-date given in file FILE, or current buffer if FILE is nil." | 291 | "Return the modify-date given in file FILE, or current buffer if FILE is nil. |
| 292 | ISO-DATE non-nil means return the date in ISO 8601 format." | ||
| 292 | (lm-with-file file | 293 | (lm-with-file file |
| 293 | (if (progn | 294 | (when (progn (goto-char (point-min)) |
| 294 | (goto-char (point-min)) | 295 | (re-search-forward |
| 295 | (re-search-forward | 296 | "\\$[I]d: [^ ]+ [^ ]+ \\([^/]+\\)/\\([^/]+\\)/\\([^ ]+\\) " |
| 296 | "\\$[I]d: [^ ]+ [^ ]+ \\([^/]+\\)/\\([^/]+\\)/\\([^ ]+\\) " | 297 | (lm-code-mark) t)) |
| 297 | (lm-code-mark) t)) | 298 | (let ((dd (match-string 3)) |
| 298 | (format "%s %s %s" | 299 | (mm (match-string 2)) |
| 299 | (match-string 3) | 300 | (yyyy (match-string 1))) |
| 300 | (nth (string-to-int | 301 | (if iso-date |
| 301 | (match-string 2)) | 302 | (format "%s-%s-%s" yyyy mm dd) |
| 302 | '("" "Jan" "Feb" "Mar" "Apr" "May" "Jun" | 303 | (format "%s %s %s" |
| 303 | "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) | 304 | dd |
| 304 | (match-string 1))))) | 305 | (nth (string-to-int mm) |
| 306 | '("" "Jan" "Feb" "Mar" "Apr" "May" "Jun" | ||
| 307 | "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")) | ||
| 308 | yyyy)))))) | ||
| 305 | 309 | ||
| 306 | (defun lm-version (&optional file) | 310 | (defun lm-version (&optional file) |
| 307 | "Return the version listed in file FILE, or current buffer if FILE is nil. | 311 | "Return the version listed in file FILE, or current buffer if FILE is nil. |
| @@ -474,4 +478,3 @@ Prompts for bug subject TOPIC. Leaves you in a mail buffer." | |||
| 474 | (provide 'lisp-mnt) | 478 | (provide 'lisp-mnt) |
| 475 | 479 | ||
| 476 | ;;; lisp-mnt.el ends here | 480 | ;;; lisp-mnt.el ends here |
| 477 | |||