From: Sam Steingold Date: Tue, 31 Oct 2017 21:01:39 +0000 (-0400) Subject: The user can now specify the time stamp format. X-Git-Tag: emacs-27.0.90~6204 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=733da54c30a2fceb40a7f1a4bb7d03c82cd716a1;p=emacs.git The user can now specify the time stamp format. * lisp/textmodes/remember.el (remember-time-format): New user variable. (remember-append-to-file): Pass it to `format-time-string' instead of calling `current-time-string'. --- diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index b20ee8fee84..dafc0b2dca6 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -402,11 +402,19 @@ exists) might be changed." :type 'string :group 'remember) +(defcustom remember-time-format "%a %b %d %H:%M:%S %Y" + "The format for time stamp, passed to `format-time-string'. +The default emulates `current-time-string' for backward compatibility." + :type 'string + :group 'remember + :version "27.1") + (defun remember-append-to-file () "Remember, with description DESC, the given TEXT." (let* ((text (buffer-string)) (desc (remember-buffer-desc)) - (remember-text (concat "\n" remember-leader-text (current-time-string) + (remember-text (concat "\n" remember-leader-text + (format-time-string remember-time-format) " (" desc ")\n\n" text (save-excursion (goto-char (point-max)) (if (bolp) nil "\n"))))