From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer Hansen Subject: How to calculate sum of property in tree? Date: Sat, 23 Apr 2016 11:22:18 +0200 Message-ID: <87a8kkaddh.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1attlo-00017e-1c for emacs-orgmode@gnu.org; Sat, 23 Apr 2016 05:22:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1attlk-0003z3-P0 for emacs-orgmode@gnu.org; Sat, 23 Apr 2016 05:22:31 -0400 Received: from plane.gmane.org ([80.91.229.3]:49774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1attlk-0003yz-Iu for emacs-orgmode@gnu.org; Sat, 23 Apr 2016 05:22:28 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1attli-0002yg-81 for emacs-orgmode@gnu.org; Sat, 23 Apr 2016 11:22:26 +0200 Received: from xdsl-87-78-230-108.netcologne.de ([87.78.230.108]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Apr 2016 11:22:26 +0200 Received: from rainer.hansen by xdsl-87-78-230-108.netcologne.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 23 Apr 2016 11:22:26 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi, I would like Emacs to calculate the price for the travel cost (21.90). This should be calculated as sum of the values of the property "Price" in the elements of the tree. How do I do that in Emacs Lisp? ---------------------------------------------- * Travel cost -- 21.90 EUR ** Train Eusirchen -- Bonn, src_emacs-lisp{(org-entry-get (point) "Price")} EUR :PROPERTIES: :Price: 7.70 :END: ** Bus Euskirchen -- Stotzheim, src_emacs-lisp{(org-entry-get (point) "Price")} EUR :PROPERTIES: :Price: 2.40 :END: ** Taxi Bonn, src_emacs-lisp{(org-entry-get (point) "Price")} EUR :PROPERTIES: :Price: 11.80 :END: ---------------------------------------------- Thanks! Rainer