Browse Source

org-colview: Update new summarized value only when necessary

* lisp/org-colview.el (org-columns--compute-spec): Make sure current
  and new values do not differ only by leading or trailing blanks
  before replacing the former by the latter.

Reported-by: Hendrik Tews <hendrik@askra.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113597>
Nicolas Goaziou 3 years ago
parent
commit
9fd562f35a
1 changed files with 7 additions and 2 deletions
  1. 7 2
      lisp/org-colview.el

+ 7 - 2
lisp/org-colview.el

@@ -1176,8 +1176,13 @@ properties drawers."
 	       ;; When PROPERTY exists in current node, even if empty,
 	       ;; but its value doesn't match the one computed, use
 	       ;; the latter instead.
-	       (when (and update value (not (equal value summary)))
-		 (org-entry-put (point) property summary)))
+	       ;;
+	       ;; Ignore leading or trailing white spaces that might
+	       ;; have been introduced in summary, since those are not
+	       ;; significant in properties value.
+	       (let ((new-value (org-trim summary)))
+		 (when (and update value (not (equal value new-value)))
+		   (org-entry-put (point) property new-value))))
 	     ;; Add current to current level accumulator.
 	     (when (or summary value-set)
 	       (push (or summary value) (aref lvals level)))