all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: William Denton <wtd@pobox.com>
To: emacs-orgmode@gnu.org
Subject: Org functions in source blocks
Date: Fri, 9 Dec 2022 15:41:44 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2212091527010.89774@shell3.miskatonic.org> (raw)

I ran org-lookup-all in a source block, but it didn't give any output.  I think 
I don't know something basic about Org or Lisp (likely both) and I hope someone 
can point out what's going on.

For example, I have this table, and I can count how many times x appears:

#+name: test_table
|   | A |
|---+---|
| ! | A |
|   | x |
|   |   |
|   | x |
|   | x |
|---+---|
| # | 3 |
#+TBLFM: $2='(length(org-lookup-all "x" '(@I..@II) nil))

I can do the count from another table, referring to a remote table:

#+name: summary
| A |
|---|
| 3 |
#+TBLFM: @2$1='(length(org-lookup-all "x" '(remote(test_table, @I$A..@II$A)) nil))

But running org-lookup-all on its own like this gives result nil, not something 
with some xs in it.  Why not?

#+begin_src emacs-lisp :results raw
(org-lookup-all "x" '(remote(test_table, @I$A..@II$A)) nil)
#+end_src


Thanks,

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada


             reply	other threads:[~2022-12-09 20:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 20:41 William Denton [this message]
2022-12-10  2:28 ` Org functions in source blocks Max Nikulin
2022-12-12  3:23   ` William Denton
2022-12-13 15:05     ` Max Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2212091527010.89774@shell3.miskatonic.org \
    --to=wtd@pobox.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.