aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gildea2021-11-09 20:09:22 -0800
committerStephen Gildea2021-11-09 20:11:07 -0800
commit8d81ab374da4d159cd05cd8caaaae2390829ccee (patch)
tree5d92ebdeb674223b227cc56fdd8b7a48ea5d96dd
parentbeaa7e14f39734eae845aa23b32b854338308ba1 (diff)
downloademacs-8d81ab374da4d159cd05cd8caaaae2390829ccee.tar.gz
emacs-8d81ab374da4d159cd05cd8caaaae2390829ccee.zip
time-stamp: %F is "file name" not "pathname" + other doc
* lisp/time-stamp.el (time-stamp-format): doc 'file' instead of 'path'. * test/lisp/time-stamp-tests.el (formatz, format-time-offset): Clarify the difference and similarity between these two test helpers.
-rw-r--r--lisp/time-stamp.el4
-rw-r--r--test/lisp/time-stamp-tests.el11
2 files changed, 8 insertions, 7 deletions
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index 178e490fb7d..04e736d027c 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -65,7 +65,7 @@ with %, as follows.
65 65
66Non-date items: 66Non-date items:
67%% a literal percent character: `%' 67%% a literal percent character: `%'
68%f file name without directory %F gives absolute pathname 68%f file name without directory %F absolute file name
69%l login name %L full name of logged-in user 69%l login name %L full name of logged-in user
70%q unqualified host name %Q fully-qualified host name 70%q unqualified host name %Q fully-qualified host name
71%h mail host name 71%h mail host name
@@ -661,7 +661,7 @@ and all `time-stamp-format' compatibility."
661 (if buffer-file-name 661 (if buffer-file-name
662 (file-name-nondirectory buffer-file-name) 662 (file-name-nondirectory buffer-file-name)
663 time-stamp-no-file)) 663 time-stamp-no-file))
664 ((eq cur-char ?F) ;buffer-file-name, full path 664 ((eq cur-char ?F) ;buffer-file-name, absolute name
665 (or buffer-file-name 665 (or buffer-file-name
666 time-stamp-no-file)) 666 time-stamp-no-file))
667 ((eq cur-char ?s) ;system name, legacy 667 ((eq cur-char ?s) ;system name, legacy
diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el
index fa9edcbd407..cb446eb486e 100644
--- a/test/lisp/time-stamp-tests.el
+++ b/test/lisp/time-stamp-tests.el
@@ -704,9 +704,10 @@
704;;;; Setup for tests of time offset formatting with %z 704;;;; Setup for tests of time offset formatting with %z
705 705
706(defun formatz (format zone) 706(defun formatz (format zone)
707 "Uses time FORMAT string to format the offset of ZONE, returning the result. 707 "Uses FORMAT to format the offset of ZONE, returning the result.
708FORMAT is \"%z\" or a variation. 708FORMAT must be time format \"%z\" or some variation thereof.
709ZONE is as the ZONE argument of the `format-time-string' function." 709ZONE is as the ZONE argument of the `format-time-string' function.
710This function is called by 99% of the `time-stamp' \"%z\" unit tests."
710 (with-time-stamp-test-env 711 (with-time-stamp-test-env
711 (let ((time-stamp-time-zone zone)) 712 (let ((time-stamp-time-zone zone))
712 ;; Call your favorite time formatter here. 713 ;; Call your favorite time formatter here.
@@ -718,9 +719,9 @@ ZONE is as the ZONE argument of the `format-time-string' function."
718 719
719(defun format-time-offset (format offset-secs) 720(defun format-time-offset (format offset-secs)
720 "Uses FORMAT to format the time zone represented by OFFSET-SECS. 721 "Uses FORMAT to format the time zone represented by OFFSET-SECS.
721FORMAT must be \"%z\", possibly with a flag and padding. 722FORMAT must be time format \"%z\" or some variation thereof.
722This function is a wrapper around `time-stamp-formatz-from-parsed-options' 723This function is a wrapper around `time-stamp-formatz-from-parsed-options'
723and is used for testing." 724and is called by some low-level `time-stamp' \"%z\" unit tests."
724 ;; This wrapper adds a simple regexp-based parser that handles only 725 ;; This wrapper adds a simple regexp-based parser that handles only
725 ;; %z and variants. In normal use, time-stamp-formatz-from-parsed-options 726 ;; %z and variants. In normal use, time-stamp-formatz-from-parsed-options
726 ;; is called from a parser that handles all time string formats. 727 ;; is called from a parser that handles all time string formats.