Просмотр исходного кода

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 7 лет назад
Родитель
Сommit
9fd562f35a
1 измененных файлов с 7 добавлено и 2 удалено
  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)))