summaryrefslogtreecommitdiff
path: root/lisp/time-stamp.el
AgeCommit message (Collapse)Author
2024-01-02; Add 2024 to copyright yearsPo Lu
2023-01-01; Add 2023 to copyright years.Eli Zaretskii
2022-01-01; Add 2022 to copyright years.Eli Zaretskii
2021-11-09time-stamp: %F is "file name" not "pathname" + other docStephen Gildea
* 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.
2021-10-03; * lisp/time-stamp.el (time-stamp-format): Doc string.Stephen Gildea
2021-10-01; * lisp/time-stamp.el: Fix wording in some documentation strings.Stephen Gildea
2021-09-26; Clarify and simplify time-stamp commentsStephen Gildea
* lisp/time-stamp.el (time-stamp-end, time-stamp-string-preprocess, time-stamp-formatz-from-parsed-options): Simplify doc. * test/lisp/time-stamp-tests.el (time-stamp-custom-pattern): Refactor to set limit-number only once.
2021-08-25; * lisp/time-stamp.el: Doc string wording improvements.Stephen Gildea
2021-08-23; * lisp/time-stamp.el: Improve doc strings.Stephen Gildea
Thanks to VEB for her help with the clarity of the documentation.
2021-06-21time-stamp: add principled, expressive %zStephen Gildea
* lisp/time-stamp.el (time-stamp-formatz-from-parsed-options): New function for time zone offset formatting ("%z" variants). * test/lisp/time-stamp-tests.el (formatz*): New unit tests to cover the new implementation of %5z.
2021-05-30time-stamp: fix minor bug when parsing option combosStephen Gildea
* lisp/time-stamp.el (time-stamp-string-preprocess): Handle digit options correctly to avoid overcounting colon options. * test/lisp/time-stamp-tests.el (time-stamp-format-time-zone-offset): Add a new test case that would have caught the option-parsing error.
2021-05-30time-stamp: refactor time-stamp-string-preprocessStephen Gildea
* lisp/time-stamp.el (time-stamp-string-preprocess): Reduce lifetime of some loop-local variables to be less error-prone.
2021-01-01Update copyright year to 2021Paul Eggert
Run "TZ=UTC0 admin/update-copyright".
2020-11-16Use lexical-binding in time-stamp.elStefan Kangas
* lisp/time-stamp.el: Use lexical-binding. Remove redundant :group args.
2020-01-24; Clarify what time-stamp-active enablesStephen Gildea
Fix documentation strings and comments for time-stamp. Most notably: * lisp/time-stamp.el (time-stamp-active): in the doc string, clarify that time-stamp-active does not add time-stamp to any hook.
2020-01-01Update copyright year to 2020Paul Eggert
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2019-11-13time-stamp: update support for time zone numeric offsetStephen Gildea
* time-stamp.el (time-stamp-string-preprocess): Change new format for numeric time zone from %:z to %5z to match format-time-string better. (time-stamp-format): Document support for numeric time zone. See discussion in bug#32931. * NEWS: Mention time-stamp-format %5z.
2019-11-06time-stamp: add support for time zone numeric offsetStephen Gildea
* time-stamp.el: Implement %:z as expanding to the numeric time zone offset, to address the feature request of bug#32931. Do not document it yet, to discourage compatibility problems in mixed Emacs 26 and Emacs 27 environments. Documentation will be added in a subsequent release at least two years later. (We cannot yet use %z for numeric time zone because in Emacs 26 it was documented to do something else.) * time-stamp-tests.el (time-stamp-test-format-time-zone): expand this test and break it into two tests, time-stamp-test-format-time-zone-name and time-stamp-test-format-time-zone-offset.
2019-10-27time-stamp-time-zone: update customizationStephen Gildea
* 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.
2019-10-13Minor tweaks to time-stamp documentation stringsStephen Gildea
* time-stamp.el (time-stamp): Reformat the explanation of the variables that affect time-stamp, for easier reading. In particular, wrap the documentation to 75 characters, so that it displays neatly as a before-save-hook customization option. * time-stamp-tests.el (with-time-stamp-test-env): Use imperative voice, per checkdoc.
2019-10-10Remove tabs from time-stamp-format documentationStephen Gildea
* time-stamp.el (time-stamp-format): Untabify the doc string, so the two-column layout displays consistently in several contexts, in particular when displayed by customize-variable.
2019-10-09time-stamp: revert recent change to "%04y"Stephen Gildea
* time-stamp.el (time-stamp-string-preprocess): Revert change to "%04y" format made 2 weeks ago by commit 0e56883878 (the previous commit to this file). Although undocumented, "%04y" was discovered to be in use in the wild (2016) and had not issued a warning that it would change. Add a warning that it will change. * time-stamp-tests.el (time-stamp-test-year-2digit): add test of "%04y"
2019-09-30Move undocumented time-stamp formats closer to format-time-stringStephen Gildea
* time-stamp.el (time-stamp-string-preprocess): Update some undocumented formatting characters of time-stamp format for closer (still incomplete) alignment with format-time-string. They have displayed a warning since Emacs 20 (released in 1997), so it is unlikely anyone is using them. * time-stamp-tests.el: Update tests to match new expectations.
2019-09-30time-stamp doc: recommend formats closer to format-time-stringStephen Gildea
* time-stamp.el (time-stamp-format, time-stamp-pattern): Update recommended (documented) formats. No code changes, just documentation. All recommended formats are compatible at least as far back as Emacs 22.1 (released in 2007) and are now closer to compatibility with format-time-string. * time-stamp-tests.el: Update test comments to match.
2019-09-22Expand time-stamp unit tests to cover all formatting optionsStephen Gildea
* time-stamp-tests.el: Expand unit tests to cover all formatting options. These tests validate time-stamp-pattern formatting that has existed since at least Emacs 22 (released in 2007). The tests cover both documented behavior and behavior implemented to support future migrations. * time-stamp.el (time-stamp-string): Add a second argument (TIME) to open a testing seam. Have the unit tests call this public function. * time-stamp.el (time-stamp-string, time-stamp-string-preprocess): Remove the second pass through time-string--format. (Previously both functions called it.) It was used only to handle "%", but this is now handled by having time-stamp-string-preprocess not double it. Not doubling the "%" in time-stamp-string-preprocess fixes the padding of "%2%", which was discovered by the new unit tests to be wrong.
2019-07-26Doc clarification in time-stamp-patternLars Ingebrigtsen
* lisp/time-stamp.el (time-stamp-pattern): Try to document what the examples mean (bug#26335).
2019-05-26Update author/maintainer infoPaul Eggert
Update email addresses and fix spellings of some author and maintainer names.
2019-01-01Update copyright year to 2019Paul Eggert
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2018-01-01Update copyright year to 2018Paul Eggert
Run admin/update-copyright.
2017-09-13Prefer HTTPS to FTP and HTTP in documentationPaul Eggert
Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
2017-02-12Simplify time-stamp mail host usageGlenn Morris
* lisp/time-stamp.el (time-stamp-mail-host-name): Remove function. (time-stamp-string-preprocess): Handle "h" (mail host) directly.
2017-01-01Merge from origin/emacs-25Paul Eggert
2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
2016-12-31Update copyright year to 2017Paul Eggert
Run admin/update-copyright.
2016-02-22Merge from origin/emacs-25John Wiegley
a9c48d5 Additional fixes for file notification 6bd9d69 Fix documentation of 'global-disable-point-adjustment' 8c22ac9 ; Spelling fix 2975784 Set file modes of pinentry socket for extra safety 2667b3e Clarify GnuPG version compatibility chapter 5e34c36 Revert "Change the default socket location for pinentry" e19c1c3 Kill off xref--display-history 5698947 Keep the xref buffer visible until the user quits it explicitly e34fbde Change the default socket location for pinentry 5f89658 Mention how to enable pinentry feature db51224 Sync with gnulib aa5a794 Remove `semanticdb-save-all-db-idle' from `auto-save-hook' 2d8b2fd Restore point when writing semantic table to disk 27d3430 Mention pinentry.el in epa manual 5baa001 Fix Bug#22736 7261355 Grammar fix in doc string d0f3b18 Naming fix for consistency 74ec92d Prefer customized value for GnuPG executable ea0b604 Fix memory reservation on MS-Windows c5f72aa Update NextStep readme and add wish list. 6de26a7 Report also result in `file-notify--test-event-handler' 5d17ae7 Improve file-notify-test08-watched-file-in-watched-dir 1cb1268 Fix todo-mode item date editing bugs 1e996cf Fix "[:upper:]" for non-ASCII characters 896f993 Allow customising the article mode cursor behavior 24c1c1d Use pop-to-buffer-same-window in woman.el 2a75f64 New filenotify test for bug#22736 c9bccf7 Report critical battery errors d675db9 Make eww message toggling message clearer 5e0bb40 * lisp/calc/calc-units.el (math-standard-units): Update to 2014 CODATA adjustment. fa8fd65 ; Improve character-folding entries in NEWS 3722a69 Fix bugs in window resizing code 289d5c6 Fix decoding DOS EOL in a unibyte buffer 2abcb06 Correct c-parse-state cache manipulation error. 14aec91 Take advantage of new GnuPG version check function e80c2a7 Make GnuPG version check robuster 15a9464 Fix x-load-color-file pointer signedness 132dbf0 * lisp/time-stamp.el (time-stamp-time-zone): Fix doc string punct. 78ab6f1 Follow convention for greek letter constants. 106b5bb Add Stefan-Boltzmann constant to calc units table. b96baa8 * lisp/calc/calc-units.el (math-build-units-table-buffer): Use special-mode. 5f91cf9 Avoid loading cl-lib for term/xterm.elc, eg in -Q -nw. (Bug#22669) 2d40f7d Fix soffice UserInstallation-URL for Windows b1a3ebe Fix display of <pre> elements 57d0e3d ; * lisp/help-fns.el: Remove outdated comment. 7a0628d ; * admin/make-tarball.txt: Mention cleaning.
2016-02-16* lisp/time-stamp.el (time-stamp-time-zone): Fix doc string punct.Paul Eggert
2016-01-20Remove handling of non-string time-stamp formats, obsolete for 20 years.Glenn Morris
* 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.
2016-01-14; * lisp/time-stamp.el: Remove active time-stamp comment.Glenn Morris
It was cute, but it's not needed as an example, and causes spurious diffs/conflicts for those with time-stamping enabled.
2016-01-12Fix time-stamp-time-zone bugs introduced in JulyPaul Eggert
This fixes a bug introduced when the July changes to format-time-string installed, as the changes were not correctly handled in this module (Bug#22302). Also, document time stamp time zones. * lisp/time-stamp.el (time-stamp-time-zone): Document values better. (time-stamp--format): New private function. (time-stamp-string, time-stamp-string-preprocess) (time-stamp-do-number): Use it. * doc/emacs/files.texi (Time Stamps): Mention time zones. * doc/misc/autotype.texi (Timestamps): Document time-stamp-time-zone.
2016-01-01Update copyright year to 2016Paul Eggert
Run admin/update-copyright.
2015-11-17Fix docstring quoting problems with ‘ '’Paul Eggert
Problem reported by Artur Malabarba in: http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html Most of these fixes are to documentation; many involve fixing longstanding quoting glitches that are independent of the recent substitute-command-keys changes. The changes to code are: * lisp/cedet/mode-local.el (mode-local-augment-function-help) (describe-mode-local-overload): Substitute docstrings before displaying them. * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): Quote the generated docstring for later substitution.
2015-08-24Prefer directed to neutral quotesPaul Eggert
Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-07-26New optional ZONE arg for format-time-string etc.Paul Eggert
This simplifies time conversions in other time zones. It also prevents display-time-world tampering with TZ (Bug#21020). * admin/admin.el (add-release-logs): Use improved add-log-time-format API. * admin/merge-gnulib (GNULIB_MODULES): Add time_rz, timegm. (GNULIB_TOOL_FLAGS): Avoid flexmember, setenv, unsetenv. * configure.ac (tzalloc): Remove test for this, since Emacs no longer uses HAVE_TZALLOC directly. * doc/lispref/os.texi (Time of Day, Time Conversion) (Time Parsing): * etc/NEWS: Document the new behavior. Merge from gnulib, incorporating: 2015-07-25 strftime: fix newly-introduced bug on Solaris 2015-07-23 fprintftime, strftime: use timezone_t args * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/strftime.c, lib/strftime.h, lib/time.in.h, m4/sys_time_h.m4: * m4/time_h.m4: Update from gnulib. * lib/time_rz.c, lib/timegm.c, m4/time_rz.m4, m4/timegm.m4: New files from gnulib. * lisp/time-stamp.el (time-stamp-string): * lisp/time.el (display-time-world-list) (display-time-world-display): Use new API, with time zone arg. * lisp/time.el (display-time-world-display): Fix race when current-time advances while we're running. * lisp/vc/add-log.el (add-log-iso8601-time-zone) (add-log-iso8601-time-string): Accept optional time zone arg. * lisp/vc/add-log.el (add-change-log-entry): * lisp/vc/log-edit.el (log-edit-changelog-ours-p): Use new arg. * nt/gnulib.mk: Propagate lib/gnulib.mk changes here. Add rules for the time module, since they're now needed for tzalloc etc. * src/conf_post.h (getenv_TZ, setenv_TZ): New macros. (emacs_getenv_TZ, emacs_setenv_TZ): New decls. * src/editfns.c: Include errno.h. (set_time_zone_rule): Omit unnecessary forward decl. (initial_tz): Remove, replacing with ... (local_tz, wall_clock_tz, utc_tz): New static vars and constants. (tzeqlen): New constant; prefer it to (sizeof "TZ=" - 1). (emacs_localtime_rz, emacs_mktime_z, xtzalloc, xtzfree) (tzlookup): New static functions. (init_editfns): New arg DUMPING. All uses changed. (init_editfns): Omit most initialization if dumping, not if !initialized. Initialize wall_clock_tz and local_tz. (emacs_nmemftime, format_time_string): Time zone argument can now be any time zone, not just a boolean for UTC or local time. All callers changed. (Fformat_time_string, Fencode_time, Fcurrent_time_string) (Fcurrent_time_zone): New optional arg ZONE. (Fdecode_time, Fset_time_zone_rule): ZONE arg can now also take the same form as with the other new additions. (decode_time_zone): Remove; no longer needed. (tzvalbuf): Now file-scope. (emacs_getenv_TZ, emacs_setenv_TZ): New functions. (syms_of_editfns): Define Qwall. * src/editfns.c (mktime_z) [!HAVE_TZALLOC]: * src/systime.h (mktime_z, timezone_t, tzalloc, tzfree) [!HAVE_TZALLOC]: Remove; now supplied by gnulib. * src/emacs.c (main): * src/lisp.h (init_editfns): Adjust to init_editfns API change.
2015-01-01Update copyright year to 2015Paul Eggert
Run admin/update-copyright.
2014-01-01Update copyright year to 2014 by running admin/update-copyright.Paul Eggert
2013-01-01Update copyright notices for 2013.Paul Eggert
2012-09-17Update docstrings and comments to use "init file" terminology.Chong Yidong
* bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes. * comint.el (comint-prompt-read-only): * custom.el (defcustom): * hi-lock.el (hi-lock-mode): * ibuffer.el (ibuffer-formats): * ielm.el (ielm-prompt-read-only): * novice.el (disable-command): * saveplace.el (toggle-save-place): * speedbar.el (speedbar-supported-extension-expressions): * startup.el (auto-save-list-file-prefix, init-file-user) (after-init-hook, inhibit-startup-echo-area-message): * strokes.el (strokes-help): * time-stamp.el (time-stamp): * calendar/calendar.el (calendar, diary-file): * calendar/diary-lib.el (diary-mail-entries, diary) (diary-list-entries-hook): * calendar/holidays.el (holidays, calendar-holidays): * calendar/lunar.el (lunar-phases): * calendar/solar.el (sunrise-sunset): * emulation/edt.el (edt-load-keys): * emulation/viper.el (viper-mode): * eshell/em-alias.el (eshell-command-aliases-list): * eshell/esh-util.el (eshell-convert-numeric-arguments): * international/ogonek.el (ogonek-information): * net/tramp-cmds.el (tramp-bug): * net/quickurl.el (quickurl-reread-hook-postfix): * play/decipher.el (decipher-font-lock-keywords): * progmodes/cc-styles.el (c-set-style): * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern): * progmodes/inf-lisp.el (inferior-lisp-prompt): * progmodes/octave-mod.el (octave-mode): * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password): * progmodes/verilog-mode.el (verilog-read-defines): * textmodes/two-column.el (2C-mode): Likewise.
2012-01-05Add 2012 to FSF copyright years for Emacs filesGlenn Morris
2011-08-08Lisp code shouldn't use set-time-zone-rule except through setenv.Chong Yidong
* time.el (display-time-world-list, display-time-world-display): * time-stamp.el (time-stamp-string): * vc/add-log.el (add-change-log-entry): Use setenv instead of set-time-zone-rule. * src/editfns.c (Fset_time_zone_rule): Document relationship with the setenv function. Fixes: debbugs:7337
2011-04-19lisp/*.el: Lexical-binding cleanup.Juanma Barranquero
2011-01-26Refill some long/short copyright headers.Glenn Morris