浏览代码

org-colview: Tiny refactoring

* lisp/org-colview.el (org-columns--collect-values): Tiny refactoring.
Nicolas Goaziou 9 年之前
父节点
当前提交
ab38d15186
共有 1 个文件被更改,包括 20 次插入20 次删除
  1. 20 20
      lisp/org-colview.el

+ 20 - 20
lisp/org-colview.el

@@ -248,26 +248,26 @@ Return a list of triplets (SPEC VALUE DISPLAYED) suitable for
 
 This function assumes `org-columns-current-fmt-compiled' is
 initialized."
-  (mapcar
-   (lambda (spec)
-     (pcase spec
-       (`(,p . ,_)
-	(let* ((v (or (cdr
-		       (assoc spec (get-text-property (point) 'org-summaries)))
-		      (org-entry-get (point) p 'selective t)
-		      (and agenda
-			   ;; Effort property is not defined.  Try to
-			   ;; use appointment duration.
-			   org-agenda-columns-add-appointments-to-effort-sum
-			   (string= p (upcase org-effort-property))
-			   (get-text-property (point) 'duration)
-			   (org-propertize
-			    (org-minutes-to-clocksum-string
-			     (get-text-property (point) 'duration))
-			    'face 'org-warning))
-		      "")))
-	  (list spec v (org-columns--displayed-value spec v))))))
-   org-columns-current-fmt-compiled))
+  (let ((summaries (get-text-property (point) 'org-summaries)))
+    (mapcar
+     (lambda (spec)
+       (pcase spec
+	 (`(,p . ,_)
+	  (let* ((v (or (cdr (assoc spec summaries))
+			(org-entry-get (point) p 'selective t)
+			(and agenda
+			     ;; Effort property is not defined.  Try
+			     ;; to use appointment duration.
+			     org-agenda-columns-add-appointments-to-effort-sum
+			     (string= p (upcase org-effort-property))
+			     (get-text-property (point) 'duration)
+			     (org-propertize
+			      (org-minutes-to-clocksum-string
+			       (get-text-property (point) 'duration))
+			      'face 'org-warning))
+			"")))
+	    (list spec v (org-columns--displayed-value spec v))))))
+     org-columns-current-fmt-compiled)))
 
 (defun org-columns--set-widths (cache)
   "Compute the maximum column widths from the format and CACHE.