emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-mode table element selection WITH blanks elements
@ 2019-06-20 13:37 Niclas Borlin
  2019-06-20 19:37 ` Nick Dokos
  0 siblings, 1 reply; 2+ messages in thread
From: Niclas Borlin @ 2019-06-20 13:37 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

How do you send a list of elements from a table, including blank cells, 
to an elisp function?

I have the table below with points on exam questions in columns 2-4. The 
second row contains the maximum number of points for each question. The 
student rows contain the actual points received. I want to compute the 
maximum possible sum for a student, to be updated while I grade the 
questions.

I have written an elisp function that takes two lists as arguments and 
does the necessary computations. However, the standard selection 
argument ignores blank elements. In the function call below, the 
function will receive the (fontified) lists '("3" "4") '("6" "4" "6") 
and '("6" "2") '("6" "4" "6"), respectively. I need a selection where 
each blank element is kept as, e.g., fontified "". Thus, I would like 
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='(sum-with-defaults '(@0$2..@0$4) '(@2$2..@2$4)))

Thanks,
/Niclas Börlin
--
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: org-mode table element selection WITH blanks elements
  2019-06-20 13:37 org-mode table element selection WITH blanks elements Niclas Borlin
@ 2019-06-20 19:37 ` Nick Dokos
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Dokos @ 2019-06-20 19:37 UTC (permalink / raw)
  To: emacs-orgmode

This was posted on the Emacs SE and I replied there:

   https://emacs.stackexchange.com/questions/51141/org-mode-table-element-selection-with-blanks
   
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-20 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-20 13:37 org-mode table element selection WITH blanks elements Niclas Borlin
2019-06-20 19:37 ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).