branch: externals/org
commit ff5ac40c8d13bedfba799d695b554381d5a81581
Author: Slawomir Grochowski <[email protected]>
Commit: Slawomir Grochowski <[email protected]>

    ; org-colview: Simplify property spec update handling
    
    * lisp/org-colview.el (org-columns-compute): Use
    `org-columns--spec-property' instead of matching the compiled spec
    shape.  Clear `update-property-p' unconditionally after a matching
    spec.
    
    The previous pattern match only used the property slot from the compiled
    spec, so the accessor makes the condition explicit without depending on
    the cons shape at the call site.  The guarded assignment was equivalent:
    after the first match, `update-property-p' is nil, and assigning nil to
    an already nil variable has no effect.
    
    Refactoring: Simplify Conditional Expression.
    
    No behavior change.
---
 lisp/org-colview.el | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 42d5b3b70d..e689906a9c 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1494,16 +1494,15 @@ column specification."
   (let ((update-property-p t)
        (upcase-prop (upcase property)))
     (dolist (spec org-columns-current-fmt-compiled)
-      (pcase spec
-       (`(,(pred (equal upcase-prop)) . ,_)
-        (org-columns--compute-spec spec update-property-p)
-         ;; Only the first matching spec can update the property drawer,
-         ;; because the drawer has a single value for each property.  For
-         ;; example, with column format "%A{min} %A{max}", both summaries
-         ;; are stored in the `org-summaries' text property, but only
-         ;; %A{min} updates the :A: property; %A{max} is computed for
-         ;; display only.
-         (when update-property-p (setq update-property-p nil)))))))
+      (when (equal (org-columns--spec-property spec) upcase-prop)
+       (org-columns--compute-spec spec update-property-p)
+       ;; Only the first matching spec can update the property drawer,
+       ;; because the drawer has a single value for each property.  For
+       ;; example, with column format "%A{min} %A{max}", both summaries
+       ;; are stored in the `org-summaries' text property, but only
+       ;; %A{min} updates the :A: property; %A{max} is computed for
+       ;; display only.
+       (setq update-property-p nil)))))
 
 (defun org-columns-compute-all ()
   "Compute all columns that have operators defined."

Reply via email to