|
1 | 1 | ((texinfo-mode |
2 | 2 | . ((before-save-hook |
3 | 3 | . (lambda () |
4 | | - (with-locale-environment "en_US.utf8" |
5 | | - (let ((day (string-trim (format-time-string "%e" (current-time)))) |
6 | | - (month (capitalize (format-time-string "%B" (current-time)))) |
7 | | - (year (format-time-string "%Y" (current-time)))) |
8 | | - (save-excursion |
9 | | - (goto-char (point-min)) |
10 | | - (when (re-search-forward "\\(@set UPDATED [[:word:]]+ [[:digit:]]+, [[:digit:]]+\\)" nil t) |
11 | | - (replace-match (format "@set UPDATED %s %s, %s" month day year) nil t nil nil)) |
12 | | - (goto-char (point-min)) |
13 | | - (when (re-search-forward "\\(@set UPDATED-MONTH [[:word:]]+ [[:digit:]]+\\)" nil t) |
14 | | - (replace-match (format "@set UPDATED-MONTH %s %s" month year) nil t nil nil)) |
15 | | - (goto-char (point-min)) |
16 | | - (when (re-search-forward "\\(Printed [[:word:]]+ [[:digit:]]+, [[:digit:]]+\.\\)" nil t) |
17 | | - (replace-match (format "Printed %s %s, %s." month day year) nil t nil nil)) |
18 | | - (goto-char (point-min)) |
19 | | - (when (re-search-forward "\\([[:word:]]+ [[:digit:]]+, [[:digit:]]+ @c AUTO-REPLACE-ON-SAVE\\)" nil t) |
20 | | - (replace-match (format "%s %s, %s @c AUTO-REPLACE-ON-SAVE" month day year) nil t nil nil)))))))))) |
| 4 | + (let ((our-set-env |
| 5 | + (lambda () (let ((day (string-trim (format-time-string "%e" (current-time)))) |
| 6 | + (month (capitalize (format-time-string "%B" (current-time)))) |
| 7 | + (year (format-time-string "%Y" (current-time)))) |
| 8 | + (save-excursion |
| 9 | + (goto-char (point-min)) |
| 10 | + (when (re-search-forward "\\(@set UPDATED [[:word:]]+ [[:digit:]]+, [[:digit:]]+\\)" nil t) |
| 11 | + (replace-match (format "@set UPDATED %s %s, %s" month day year) nil t nil nil)) |
| 12 | + (goto-char (point-min)) |
| 13 | + (when (re-search-forward "\\(@set UPDATED-MONTH [[:word:]]+ [[:digit:]]+\\)" nil t) |
| 14 | + (replace-match (format "@set UPDATED-MONTH %s %s" month year) nil t nil nil)) |
| 15 | + (goto-char (point-min)) |
| 16 | + (when (re-search-forward "\\(Printed [[:word:]]+ [[:digit:]]+, [[:digit:]]+\.\\)" nil t) |
| 17 | + (replace-match (format "Printed %s %s, %s." month day year) nil t nil nil)) |
| 18 | + (goto-char (point-min)) |
| 19 | + (when (re-search-forward "\\([[:word:]]+ [[:digit:]]+, [[:digit:]]+ @c AUTO-REPLACE-ON-SAVE\\)" nil t) |
| 20 | + (replace-match (format "%s %s, %s @c AUTO-REPLACE-ON-SAVE" month day year) nil t nil nil))))))) |
| 21 | + (if (fboundp 'with-locale-environment) |
| 22 | + (with-locale-environment "en_US.utf8" |
| 23 | + (funcall our-set-env)) |
| 24 | + (funcall our-set-env)))))))) |
0 commit comments