diff options
| author | Stephen Gildea | 2019-10-27 08:20:13 -0700 |
|---|---|---|
| committer | Stephen Gildea | 2019-10-27 08:21:16 -0700 |
| commit | 113ff954dbcd24325bd674b7294d54a7c8394d42 (patch) | |
| tree | 2c62f2a9c64999fcd97d022db0fdf8e10c305fb9 /lisp | |
| parent | fc0f98a8a87ca48b4c3fb0e66d1bd1e2dcc9aa19 (diff) | |
| download | emacs-113ff954dbcd24325bd674b7294d54a7c8394d42.tar.gz emacs-113ff954dbcd24325bd674b7294d54a7c8394d42.zip | |
time-stamp-time-zone: update customization
* time-stamp.el (time-stamp-time-zone): Support customization with
an integer offset (a new possible value of the ZONE argument to
format-time-string in Emacs 27).
Update the safe-local-variable predicate from string-or-null-p
(describing time-stamp-time-zone's domain before 2015) to new
predicate time-stamp-zone-type-p (describing the current domain).
* time-stamp-tests.el (time-stamp-test-helper-zone-type-p): New test.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/time-stamp.el | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 094ef915265..6b1ff3e618c 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el | |||
| @@ -109,10 +109,26 @@ Its format is that of the ZONE argument of the `format-time-string' function." | |||
| 109 | :type '(choice (const :tag "Emacs local time" nil) | 109 | :type '(choice (const :tag "Emacs local time" nil) |
| 110 | (const :tag "Universal Time" t) | 110 | (const :tag "Universal Time" t) |
| 111 | (const :tag "system wall clock time" wall) | 111 | (const :tag "system wall clock time" wall) |
| 112 | (string :tag "TZ environment variable value")) | 112 | (string :tag "TZ environment variable value") |
| 113 | (list :tag "Offset and name" | ||
| 114 | (integer :tag "Offset (seconds east of UTC)") | ||
| 115 | (string :tag "Time zone abbreviation")) | ||
| 116 | (integer :tag "Offset (seconds east of UTC)")) | ||
| 113 | :group 'time-stamp | 117 | :group 'time-stamp |
| 114 | :version "20.1") | 118 | :version "20.1") |
| 115 | ;;;###autoload(put 'time-stamp-time-zone 'safe-local-variable 'string-or-null-p) | 119 | ;;;###autoload(put 'time-stamp-time-zone 'safe-local-variable 'time-stamp-zone-type-p) |
| 120 | |||
| 121 | ;;;###autoload | ||
| 122 | (defun time-stamp-zone-type-p (zone) | ||
| 123 | "Return whether or not ZONE is of the correct type for a timezone rule. | ||
| 124 | Valid ZONE values are described in the documentation of `format-time-string'." | ||
| 125 | (or (memq zone '(nil t wall)) | ||
| 126 | (stringp zone) | ||
| 127 | (and (consp zone) | ||
| 128 | (integerp (car zone)) | ||
| 129 | (consp (cdr zone)) | ||
| 130 | (stringp (cadr zone))) | ||
| 131 | (integerp zone))) | ||
| 116 | 132 | ||
| 117 | ;;; Do not change time-stamp-line-limit, time-stamp-start, | 133 | ;;; Do not change time-stamp-line-limit, time-stamp-start, |
| 118 | ;;; time-stamp-end, time-stamp-pattern, time-stamp-inserts-lines, | 134 | ;;; time-stamp-end, time-stamp-pattern, time-stamp-inserts-lines, |