]> code.delx.au - gnu-emacs/commitdiff
Remove handling of non-string time-stamp formats, obsolete for 20 years.
authorGlenn Morris <rgm@gnu.org>
Thu, 21 Jan 2016 01:11:16 +0000 (20:11 -0500)
committerGlenn Morris <rgm@gnu.org>
Thu, 21 Jan 2016 01:11:16 +0000 (20:11 -0500)
* lisp/time-stamp.el (time-stamp-format): Doc fix.
(time-stamp-old-format-warn, time-stamp-fconcat): Remove.
(time-stamp-string): Ignore non-string formats.

; * etc/NEWS: Mention this.

etc/NEWS
lisp/time-stamp.el

index 9fbe6955c8281852c87f86091785b195fa4aec60..a95ceaddde78e88a648f18e104c044d03e0365e5 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -59,6 +59,9 @@ in these situations.
 
 *** The kqueue library is integrated for *BSD and Mac OS X machines.
 
+---
+** Support for non-string values of `time-stamp-format' has been removed.
+
 ** Tramp
 
 *** New connection method "sg", which allows to edit files under
index d58942c3a2b0dbcf8c2afe434c971c4782190525..79524fb7280ebd3352ff32c5305af426452895b2 100644 (file)
 
 (defcustom time-stamp-format "%:y-%02m-%02d %02H:%02M:%02S %u"
   "Format of the string inserted by \\[time-stamp].
-The value may be a string or a list.  Lists are supported only for
-backward compatibility; see variable `time-stamp-old-format-warn'.
-
-A string is used verbatim except for character sequences beginning
+This is a string, used verbatim except for character sequences beginning
 with %, as follows.  The values of non-numeric formatted items depend
 on the locale setting recorded in `system-time-locale' and
 `locale-coding-system'.  The examples here are for the default
@@ -107,17 +104,6 @@ otherwise would have been updated."
   :group 'time-stamp
   :version "19.29")
 
-(defcustom time-stamp-old-format-warn 'ask
-  "Action if `time-stamp-format' is an old-style list.
-If `error', the format is not used.  If `ask', the user is queried about
-using the time-stamp-format.  If `warn', a warning is displayed.
-If nil, no notification is given."
-  :type '(choice (const :tag "Don't use the format" error)
-                 (const ask)
-                 (const warn)
-                (const :tag "No notification" nil))
-  :group 'time-stamp)
-
 (defcustom time-stamp-time-zone nil
   "The time zone to be used by \\[time-stamp].
 Its format is that of the ZONE argument of the `format-time-string' function,"
@@ -420,26 +406,14 @@ With ARG, turn time stamping on if and only if arg is positive."
   "Generate the new string to be inserted by \\[time-stamp].
 Optionally use format TS-FORMAT instead of `time-stamp-format' to
 format the string."
-  (or ts-format
-      (setq ts-format time-stamp-format))
-  (if (stringp ts-format)
-      (time-stamp--format (time-stamp-string-preprocess ts-format) nil)
-    ;; handle version 1 compatibility
-    (cond ((or (eq time-stamp-old-format-warn 'error)
-              (and (eq time-stamp-old-format-warn 'ask)
-                   (not (y-or-n-p "Use non-string time-stamp-format? "))))
-          (message "Warning: no time-stamp: time-stamp-format not a string")
-          (sit-for 1)
-          nil)
-         (t
-          (cond ((eq time-stamp-old-format-warn 'warn)
-                 (message "Obsolescent time-stamp-format type; should be string")
-                 (sit-for 1)))
-          (time-stamp-fconcat ts-format " ")))))
+  (if (stringp (or ts-format (setq ts-format time-stamp-format)))
+      (time-stamp--format (time-stamp-string-preprocess ts-format) nil)))
+
 
 (defconst time-stamp-no-file "(no file)"
   "String to use when the buffer is not associated with a file.")
 
+;;; FIXME This comment was written in 1996!
 ;;; time-stamp is transitioning to using the new, expanded capabilities
 ;;; of format-time-string.  During the process, this function implements
 ;;; intermediate, compatible formats and complains about old, soon to
@@ -676,28 +650,6 @@ otherwise the value of the function `system-name'."
           mail-host-address)
       (system-name)))
 
-;;; the rest of this file is for version 1 compatibility
-
-(defun time-stamp-fconcat (list sep)
-  "Similar to (mapconcat \\='funcall LIST SEP) but LIST allows literals.
-If an element of LIST is a symbol, it is funcalled to get the string to use;
-the separator SEP is used between two strings obtained by funcalling a
-symbol.  Otherwise the element itself is inserted; no separator is used
-around literals."
-  (let ((return-string "")
-       (insert-sep-p nil))
-    (while list
-      (cond ((symbolp (car list))
-            (if insert-sep-p
-                (setq return-string (concat return-string sep)))
-            (setq return-string (concat return-string (funcall (car list))))
-            (setq insert-sep-p t))
-           (t
-            (setq return-string (concat return-string (car list)))
-            (setq insert-sep-p nil)))
-      (setq list (cdr list)))
-    return-string))
-
 (provide 'time-stamp)
 
 ;;; time-stamp.el ends here