Org-mode mailing list
 help / color / mirror / Atom feed
* Bug: Effort is not displayed in mode line, patch attached [7.9.2 (7.9.2-181-ge8aaca-elpaplus @ /usr/local/share/emacs/24.2/lisp/org/)]
@ 2013-01-20 20:06 Vasil S. Diadov
  2013-01-23 13:49 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Vasil S. Diadov @ 2013-01-20 20:06 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 135 bytes --]


Efforts are not displayed in mode line due to wrong point position
during fetching 'org-effort property of the text.

Patch attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch for fixing issue with efforts --]
[-- Type: text/x-patch, Size: 1656 bytes --]

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 914f5ff..0b3d2fc 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1226,7 +1226,8 @@ make this the default behavior.)"
 			  "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
 			  (match-string 4)))
 			(t "???")))
-	    (setq org-clock-heading (org-propertize org-clock-heading
+            (setq org-clock-heading 
+                  (org-propertize org-clock-heading
 						    'face nil))
 	    (org-clock-find-position org-clock-in-resume)
 	    (cond
@@ -1241,7 +1242,10 @@ make this the default behavior.)"
 	      (setq org-clock-start-time
 		    (apply 'encode-time
 			   (org-parse-time-string (match-string 1))))
-	      (setq org-clock-effort (get-text-property (point) 'org-effort))
+              (setq org-clock-effort 
+                    (save-excursion
+                      (org-back-to-heading t)
+                      (get-text-property (point) 'org-effort)))
 	      (setq org-clock-total-time (org-clock-sum-current-item
 					  (org-clock-get-sum-start))))
 	     ((eq org-clock-in-resume 'auto-restart)
@@ -1261,7 +1265,10 @@ make this the default behavior.)"
 		(beginning-of-line 1)
 		(org-indent-line-to (- (org-get-indentation) 2)))
 	      (insert org-clock-string " ")
-	      (setq org-clock-effort (get-text-property (point) 'org-effort))
+              (setq org-clock-effort 
+                    (save-excursion
+                      (org-back-to-heading t)
+                      (get-text-property (point) 'org-effort)))
 	      (setq org-clock-total-time (org-clock-sum-current-item
 					  (org-clock-get-sum-start)))
 	      (setq org-clock-start-time

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: Effort is not displayed in mode line, patch attached [7.9.2 (7.9.2-181-ge8aaca-elpaplus @ /usr/local/share/emacs/24.2/lisp/org/)]
  2013-01-20 20:06 Bug: Effort is not displayed in mode line, patch attached [7.9.2 (7.9.2-181-ge8aaca-elpaplus @ /usr/local/share/emacs/24.2/lisp/org/)] Vasil S. Diadov
@ 2013-01-23 13:49 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2013-01-23 13:49 UTC (permalink / raw)
  To: Vasil S. Diadov; +Cc: emacs-orgmode

Hi Vasil,

vasil.s.d@gmail.com (Vasil S. Diadov) writes:

> Efforts are not displayed in mode line due to wrong point position
> during fetching 'org-effort property of the text.

thanks a lot for the patch, I fixed this a bit differently, but the
core idea is the same.

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-23 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-20 20:06 Bug: Effort is not displayed in mode line, patch attached [7.9.2 (7.9.2-181-ge8aaca-elpaplus @ /usr/local/share/emacs/24.2/lisp/org/)] Vasil S. Diadov
2013-01-23 13:49 ` Bastien

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git