diff options
author | Nicholas D Steeves <sten@debian.org> | 2023-06-03 20:59:02 -0400 |
---|---|---|
committer | Nicholas D Steeves <sten@debian.org> | 2023-06-03 20:59:02 -0400 |
commit | 625f3e22b6cb3aff30948c5a89156b623feb4dfc (patch) | |
tree | c9256671d4f749b9b21ba598b9f567b4ce92da2d | |
parent | e3e0c9af4a29c5d00b9c29f53a7d78f266670972 (diff) | |
parent | d0cebebb301b5de93e9c5228a91e3e4f5d41902b (diff) |
Merge upstream tag 'release_0.4.1'
-rw-r--r-- | lisp/ob-asymptote.el | 2 | ||||
-rw-r--r-- | lisp/org-contrib.el | 2 | ||||
-rw-r--r-- | lisp/org-expiry.el | 25 |
3 files changed, 19 insertions, 10 deletions
diff --git a/lisp/ob-asymptote.el b/lisp/ob-asymptote.el index 6df51d0..55811bd 100644 --- a/lisp/ob-asymptote.el +++ b/lisp/ob-asymptote.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2009-2021 Free Software Foundation, Inc. ;; Author: Eric Schulte -;; Maintainer: Luc Pellissier <luc.pellissier@crans.org> +;; Maintainer: Jarmo Hurri <jarmo.hurri@iki.fi> ;; Keywords: literate programming, reproducible research ;; Homepage: https://git.sr.ht/~bzg/org-contrib diff --git a/lisp/org-contrib.el b/lisp/org-contrib.el index fd1398c..5eb6bfa 100644 --- a/lisp/org-contrib.el +++ b/lisp/org-contrib.el @@ -5,7 +5,7 @@ ;; Author: Bastien Guerry <bzg@gnu.org> ;; Homepage: https://git.sr.ht/~bzg/org-contrib ;; Package-Requires: ((emacs "25.1") (org "9.4.6")) -;; Version: 0.4 +;; Version: 0.4.1 ;; Keywords: org ;; SPDX-License-Identifier: GPL-3.0-or-later diff --git a/lisp/org-expiry.el b/lisp/org-expiry.el index 98ad58a..c3dad28 100644 --- a/lisp/org-expiry.el +++ b/lisp/org-expiry.el @@ -282,6 +282,9 @@ The expiry process will run the function defined by processed expired)))))) ;;; Insert created/expiry property: +(defun org-expiry-format-timestamp (timestr inactive) + "Properly format TIMESTR into an org (in)active timestamp" + (format (if inactive "[%s]" "<%s>") timestr)) (defun org-expiry-insert-created (&optional arg) "Insert or update a property with the creation date. @@ -299,10 +302,13 @@ update the date." (setq d-hour (format-time-string "%H:%M" d-time)) (setq timestr ;; two C-u prefixes will call org-read-date - (if (equal arg '(16)) - (concat "<" (org-read-date - nil nil nil nil d-time d-hour) ">") - (format-time-string (cdr org-time-stamp-formats)))) + (concat "<" + (if (equal arg '(16)) + (org-read-date nil nil nil nil d-time d-hour) + (format-time-string + (replace-regexp-in-string "\\(^<\\|>$\\)" "" + (cdr org-time-stamp-formats)))) + ">")) ;; maybe transform to inactive timestamp (if org-expiry-inactive-timestamps (setq timestr (concat "[" (substring timestr 1 -1) "]"))) @@ -320,10 +326,13 @@ and insert today's date." (setq d-time (if d (org-time-string-to-time d) (current-time))) (setq d-hour (format-time-string "%H:%M" d-time)) - (setq timestr (if today - (format-time-string (cdr org-time-stamp-formats)) - (concat "<" (org-read-date - nil nil nil nil d-time d-hour) ">"))) + (setq timestr (concat "<" + (if today + (format-time-string + (replace-regexp-in-string "\\(^<\\|>$\\)" "" + (cdr org-time-stamp-formats))) + (org-read-date nil nil nil nil d-time d-hour)) + ">")) ;; maybe transform to inactive timestamp (if org-expiry-inactive-timestamps (setq timestr (concat "[" (substring timestr 1 -1) "]"))) |