From mboxrd@z Thu Jan 1 00:00:00 1970 From: Niclas Borlin Subject: org-mode table element selection WITH blanks elements Date: Thu, 20 Jun 2019 15:37:36 +0200 Message-ID: <9dead773-714b-cfe0-fa5c-aebcbba09ec4@cs.umu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56686) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdxKa-000204-6v for emacs-orgmode@gnu.org; Thu, 20 Jun 2019 09:42:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdxGA-0006hj-5p for emacs-orgmode@gnu.org; Thu, 20 Jun 2019 09:38:12 -0400 Received: from mail.cs.umu.se ([130.239.40.25]:46893) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hdxG9-0006g0-UB for emacs-orgmode@gnu.org; Thu, 20 Jun 2019 09:37:50 -0400 Received: from localhost (localhost [127.0.0.1]) by amavisd-new (Postfix) with ESMTP id 45V2tn62hrz42 for ; Thu, 20 Jun 2019 15:37:37 +0200 (CEST) Received: from mail.cs.umu.se ([127.0.0.1]) by localhost (mail-vm.cs.umu.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fF6oih-viEGc for ; Thu, 20 Jun 2019 15:37:37 +0200 (CEST) Received: from [192.168.0.103] (h-104-2.A251.priv.bahnhof.se [79.136.104.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: niclas) by mail.cs.umu.se (Postfix) with ESMTPSA id 45V2tn1fVSz34 for ; Thu, 20 Jun 2019 15:37:37 +0200 (CEST) Content-Language: en-US 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, How do you send a list of elements from a table, including blank cells,=20 to an elisp function? I have the table below with points on exam questions in columns 2-4. The=20 second row contains the maximum number of points for each question. The=20 student rows contain the actual points received. I want to compute the=20 maximum possible sum for a student, to be updated while I grade the=20 questions. I have written an elisp function that takes two lists as arguments and=20 does the necessary computations. However, the standard selection=20 argument ignores blank elements. In the function call below, the=20 function will receive the (fontified) lists '("3" "4") '("6" "4" "6")=20 and '("6" "2") '("6" "4" "6"), respectively. I need a selection where=20 each blank element is kept as, e.g., fontified "". Thus, I would like=20 the function to receive '("3" "4" "") '("6" "4" "6"), etc. Is that possible? Have tried google and the org manual to no avail. #+NAME: PTS | | Q1| Q2| Q3| | Max | |-----------+---+---+---+-----+-----| | | 6 | 4 | 6 | Sum | Sum | |-----------+---+---+---+-----+-----| | Student 1 | 3 | 4 | | 7 | 13 | | Student 2 | 6 | | 2 | 8 | 12 | #+TBLFM: @3$6..@>$6=3D'(sum-with-defaults '(@0$2..@0$4) '(@2$2..@2$4))) Thanks, /Niclas B=C3=B6rlin -- Niclas Borlin, PhD email: Niclas.Borlin@cs.umu.se Department of Computing Science phone: +46 (0)90-786 68 32 Umea University fax: +46 (0)90-580 14 SE-901 87 Umea, SWEDEN lat/long: 63.49 N, 20.19 E