summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-07-03 13:23:09 +0200
committerBastien Guerry <bzg@altern.org>2011-07-03 13:23:09 +0200
commit16faa2b6c1cf10d1a652c44563a54b0a999ba920 (patch)
tree7a6cfc13990de77289d04d2df1d733e7ea26ae27
parenta14815aa924108f226fedcbf315c061880984ef7 (diff)
downloadorg-mode-16faa2b6c1cf10d1a652c44563a54b0a999ba920.tar.gz
org-macs.el: new function `org-format-seconds'.
* install/git/org-mode/lisp/org-table.el (org-table-time-seconds-to-string): use `org-format-seconds' instead of `format-seconds'. * install/git/org-mode/lisp/org-macs.el (org-format-seconds): handle case where `format-seconds' does not exist.
-rw-r--r--lisp/org-macs.el6
-rw-r--r--lisp/org-table.el6
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 6d52866..6425977 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -361,6 +361,12 @@ The number of levels is controlled by `org-inlinetask-min-level'"
(nstars (if org-odd-levels-only (1- (* limit-level 2)) limit-level)))
(format "\\*\\{1,%d\\} " nstars))))
+(defun org-format-seconds (string seconds)
+ "Compatibility function replacing format-seconds"
+ (if (fboundp 'format-seconds)
+ (format-seconds string seconds)
+ (format-time-string string (seconds-to-time seconds))))
+
(provide 'org-macs)
;; arch-tag: 7e6a73ce-aac9-4fc0-9b30-ce6f89dc6668
diff --git a/lisp/org-table.el b/lisp/org-table.el
index e277f57..a7fc863 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -3220,9 +3220,9 @@ For example: 28 -> AB."
(defun org-table-time-seconds-to-string (secs)
"Convert a number of seconds to a time string."
- (cond ((>= secs 3600) (format-seconds "%h:%.2m:%.2s" secs))
- ((>= secs 60) (format-seconds "%m:%.2s" secs))
- (t (format-seconds "%s" secs))))
+ (cond ((>= secs 3600) (org-format-seconds "%h:%.2m:%.2s" secs))
+ ((>= secs 60) (org-format-seconds "%m:%.2s" secs))
+ (t (org-format-seconds "%s" secs))))
(defun org-table-fedit-convert-buffer (function)
"Convert all references in this buffer, using FUNCTION."