emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org e52c531e17 2/2: Merge branch 'bugfix'


From: ELPA Syncer
Subject: [elpa] externals/org e52c531e17 2/2: Merge branch 'bugfix'
Date: Sun, 5 Mar 2023 07:58:19 -0500 (EST)

branch: externals/org
commit e52c531e174ec9f9c207a8697213ea1e33197fd9
Merge: 913e40a5bb 3d817c52c9
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    Merge branch 'bugfix'
---
 lisp/org-clock.el              |  4 ++--
 testing/lisp/test-org-clock.el | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index d464585360..a300df8ff4 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -728,9 +728,9 @@ If not, show simply the clocked time like 01:50."
                                'org-mode-line-clock-overrun
                              'org-mode-line-clock)))
               (effort-str (org-duration-from-minutes effort-in-minutes)))
-         (format (propertize " [%s/%s] (%s)" 'face 'org-mode-line-clock)
+         (format (propertize "[%s/%s] (%s) " 'face 'org-mode-line-clock)
                  work-done-str effort-str org-clock-heading))
-      (format (propertize " [%s] (%s)" 'face 'org-mode-line-clock)
+      (format (propertize "[%s] (%s) " 'face 'org-mode-line-clock)
              (org-duration-from-minutes clocked-time)
              org-clock-heading))))
 
diff --git a/testing/lisp/test-org-clock.el b/testing/lisp/test-org-clock.el
index f732e471a3..a1ca9e25bb 100644
--- a/testing/lisp/test-org-clock.el
+++ b/testing/lisp/test-org-clock.el
@@ -1276,5 +1276,40 @@ CLOCK: [2012-03-29 Thu 16:00]--[2012-03-29 Thu 17:00] => 
 1:00"
           (test-org-clock-clocktable-contents
            (format ":hidefiles t :scope (lambda () (list %S))" the-file))))))))
 
+;;; Mode line
+
+(ert-deftest test-org-clock/mode-line ()
+  "Test mode line string ends in a space.
+
+\"Elements that are added to [the mode line] should normally end
+in a space (to ensure that consecutive 'global-mode-string'
+elements display properly)\" per Emacs manual, Section 24.4.4
+Variables Used in the Mode Line."
+  ;; Test the variant without effort.
+  (should
+   (equal
+    "<before> [0:00] (Heading) <after> "
+    (org-test-with-temp-text
+        "* Heading"
+      (org-clock-in)
+      (prog1 (concat "<before> "
+                     (org-clock-get-clock-string)
+                     "<after> ")
+        (org-clock-out)))))
+  ;; Test the variant with effort.
+  (should
+   (equal
+    "<before> [0:00/1:00] (Heading) <after> "
+    (org-test-with-temp-text
+        "* Heading
+:PROPERTIES:
+:EFFORT: 1h
+:END:"
+      (org-clock-in)
+      (prog1 (concat "<before> "
+                     (org-clock-get-clock-string)
+                     "<after> ")
+        (org-clock-out))))))
+
 (provide 'test-org-clock)
 ;;; test-org-clock.el end here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]