Mercurial > emacs
comparison lisp/add-log.el @ 78333:f200f7a4baf0
(change-log-redate): Remove (not needed anymore and
doesn't appear to work).
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Wed, 25 Jul 2007 21:46:01 +0000 |
parents | 9355f9b7bbff |
children | 8c1044b7c90f b98604865ea0 |
comparison
equal
deleted
inserted
replaced
78332:8242c904a1aa | 78333:f200f7a4baf0 |
---|---|
1102 ;; Move to the end of it to terminate outer loop. | 1102 ;; Move to the end of it to terminate outer loop. |
1103 (with-current-buffer other-buf | 1103 (with-current-buffer other-buf |
1104 (goto-char (point-max))) | 1104 (goto-char (point-max))) |
1105 (insert-buffer-substring other-buf start))))))) | 1105 (insert-buffer-substring other-buf start))))))) |
1106 | 1106 |
1107 ;;;###autoload | |
1108 (defun change-log-redate () | |
1109 "Fix any old-style date entries in the current log file to default format." | |
1110 (interactive) | |
1111 (require 'timezone) | |
1112 (save-excursion | |
1113 (goto-char (point-min)) | |
1114 (while (re-search-forward "^\\sw.........[0-9:+ ]*" nil t) | |
1115 (unless (= 12 (- (match-end 0) (match-beginning 0))) | |
1116 (let* ((date (save-match-data | |
1117 (timezone-fix-time (match-string 0) nil nil))) | |
1118 (zone (if (consp (aref date 6)) | |
1119 (nth 1 (aref date 6))))) | |
1120 (replace-match (format-time-string | |
1121 "%Y-%m-%d " | |
1122 (encode-time (aref date 5) | |
1123 (aref date 4) | |
1124 (aref date 3) | |
1125 (aref date 2) | |
1126 (aref date 1) | |
1127 (aref date 0) | |
1128 zone)))))))) | |
1129 | |
1130 (provide 'add-log) | 1107 (provide 'add-log) |
1131 | 1108 |
1132 ;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762 | 1109 ;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762 |
1133 ;;; add-log.el ends here | 1110 ;;; add-log.el ends here |