diff --git a/lisp/org-colview.el b/lisp/org-colview.el index d132bf6..b312d35 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -698,20 +698,30 @@ around it." (org-columns-display-here (cdr x))) cache))))) +(defcustom org-columns-custom-summary-function nil + "A user-defined custom summary function. +This function takes one argument: a list containing the values of +all children for the summarized property. This function should +return a number." + :group 'org-link + :type 'function) + (defvar org-columns-compile-map - '(("none" none +) - (":" add_times +) - ("+" add_numbers +) - ("$" currency +) - ("X" checkbox +) - ("X/" checkbox-n-of-m +) - ("X%" checkbox-percent +) - ("max" max_numbers max) - ("min" min_numbers min) - ("mean" mean_numbers (lambda (&rest x) (/ (apply '+ x) (float (length x))))) - (":max" max_times max) - (":min" min_times min) - (":mean" mean_times (lambda (&rest x) (/ (apply '+ x) (float (length x)))))) + '(("none" none +) + (":" add_times +) + ("+" add_numbers +) + ("$" currency +) + ("X" checkbox +) + ("X/" checkbox-n-of-m +) + ("X%" checkbox-percent +) + ("max" max_numbers max) + ("min" min_numbers min) + ("mean" mean_numbers (lambda (&rest x) (/ (apply '+ x) (float (length x))))) + (":max" max_times max) + (":min" min_times min) + (":mean" mean_times (lambda (&rest x) (/ (apply '+ x) (float (length x))))) + ("custom" custom_function (lambda (&rest x) + (funcall org-columns-custom-summary-function x)))) "Operator <-> format,function map. Used to compile/uncompile columns format and completing read in interactive function org-columns-new.")