emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Table formula reference and macro replacement
@ 2017-08-17  4:17 Vikas Rawal
  2017-08-17 14:23 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Vikas Rawal @ 2017-08-17  4:17 UTC (permalink / raw)
  To: org-mode mailing list

The idea is to pick contents of a table cell and use it in a paragraph.

Is it possible to have a macro like {{{remote(NAME-OR-ID,REF)}}} ?

The above does not work, but am I missing something?

Vikas

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

* Re: Table formula reference and macro replacement
  2017-08-17  4:17 Table formula reference and macro replacement Vikas Rawal
@ 2017-08-17 14:23 ` Nicolas Goaziou
  2017-08-18  0:25   ` Vikas Rawal
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2017-08-17 14:23 UTC (permalink / raw)
  To: Vikas Rawal; +Cc: org-mode mailing list

Hello,

Vikas Rawal <vikaslists@agrarianresearch.org> writes:

> The idea is to pick contents of a table cell and use it in a paragraph.
>
> Is it possible to have a macro like {{{remote(NAME-OR-ID,REF)}}} ?
>
> The above does not work, but am I missing something?

You could try:

--8<---------------cut here---------------start------------->8---
#+macro: remote src_emacs-lisp{(org-table-get-remote-range "$1" "$2")}

Example:

#+name: foo
| 1 | 2 |
| 3 | 4 |

The macro call: {{{remote(foo, @1$2)}}}
--8<---------------cut here---------------end--------------->8---

Regards,

-- 
Nicolas Goaziou

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

* Re: Table formula reference and macro replacement
  2017-08-17 14:23 ` Nicolas Goaziou
@ 2017-08-18  0:25   ` Vikas Rawal
  0 siblings, 0 replies; 3+ messages in thread
From: Vikas Rawal @ 2017-08-18  0:25 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode mailing list

> 
> You could try:
> 
> --8<---------------cut here---------------start------------->8---
> #+macro: remote src_emacs-lisp{(org-table-get-remote-range "$1" "$2")}
> 
> Example:
> 
> #+name: foo
> | 1 | 2 |
> | 3 | 4 |
> 
> The macro call: {{{remote(foo, @1$2)}}}
> --8<---------------cut here---------------end--------------->8—
> 

Beautiful!

Vikas

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

end of thread, other threads:[~2017-08-18  0:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-17  4:17 Table formula reference and macro replacement Vikas Rawal
2017-08-17 14:23 ` Nicolas Goaziou
2017-08-18  0:25   ` Vikas Rawal

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).