Re: Get current table row data as list

2022-10-04 Thread Felix Dorner
Okay I found org-table-get (line column), which is already very helpful.

On Wed, Oct 5, 2022 at 6:17 AM Felix Dorner  wrote:

> When point is in a table, I can run (org-element-at-point) and get a
> table-row:
>
> table-row (:type standard :begin 4932 :end 5151 :contents-begin 4933
> :contents-end 5150 :post-blank 0 :post-affiliated 4932 :parent (table
> (:begin 4546 :end 6818 :type org :tblfm nil :contents-begin 4562
> :contents-end 6816 :value nil :post-blank 2 :post-affiliated 4562 :name
> secrets :parent nil
>
> Is there a helper or another way so that I can get the elements of that
> row as a list or do I have to extract the fields manually by walking over
> text?
>
> Thanks,
> Felix
>
>

-- 
Linux. The choice of a GNU generation.


Get current table row data as list

2022-10-04 Thread Felix Dorner
When point is in a table, I can run (org-element-at-point) and get a
table-row:

table-row (:type standard :begin 4932 :end 5151 :contents-begin 4933
:contents-end 5150 :post-blank 0 :post-affiliated 4932 :parent (table
(:begin 4546 :end 6818 :type org :tblfm nil :contents-begin 4562
:contents-end 6816 :value nil :post-blank 2 :post-affiliated 4562 :name
secrets :parent nil

Is there a helper or another way so that I can get the elements of that row
as a list or do I have to extract the fields manually by walking over text?

Thanks,
Felix


Re: Call code block via link?

2022-10-04 Thread Felix Dorner
Eric,

>
>  [[elisp:(some elisp sexp)][Click here to do X]]
>
> Neat! When I open the link I always get a message each time, "Execute ...
as elisp?" Is there a way to get rid of that message?


-- 
Linux. The choice of a GNU generation.


Re: Concatenating results

2022-10-03 Thread Felix Dorner
On Mon, Oct 3, 2022 at 11:28 AM Ihor Radchenko  wrote:

>
> #+begin_src emacs-lisp :noweb yes
>
> Thank you Ihor.
Felix



-- 
Linux. The choice of a GNU generation.


Re: Concatenating results

2022-10-03 Thread Felix Dorner
On Mon, Oct 3, 2022 at 10:44 AM Ihor Radchenko  wrote:

> #+name: block1
> #+begin_src emacs-lisp :results table
> '((1 2) (3 4))
> #+end_src
>
> #+name: block2
> #+begin_src emacs-lisp :results table
> '((5 6) (7 8))
> #+end_src
>
>
> #+begin_src emacs-lisp
> (append
> '<>
> '<>)
> #+end_src
>

I get an error with this:
executing Emacs-Lisp code block...
progn: Symbol’s value as variable is void: >>


Concatenating results

2022-10-03 Thread Felix Dorner
I have a list of N source blocks, of which each produces a table, and all
these tables have the same column count. What is the easiest way to now
make a single table which is the result of calling all these blocks and
concatenating the result?

Essentially, would be also the same as N CALL together but all append to
the same result instead of a result for each CALL.

Btw thanks, this Org stuff is all so mind blowing.

-- 
Linux. The choice of a GNU generation.


Call code block via link?

2022-09-09 Thread Felix Dorner
I have a silenced codeblock, that I postprocess to push the result (a
password) onto the kill-ring, and then returns "Password copied" (showing
in the status line). This works very nicely. I'm now looking for the cherry
on the cake: I'd like to render the #+CALL as a link, e.g. something like,
[Copy the secret thing]. Clicking/following the link would execute the call
and my password ready to paste elsewhere. Feasible?

-- 
Linux. The choice of a GNU generation.


Secrets in org-babel

2022-09-05 Thread Felix Dorner
New org user, fascinated by org-babel, but stumbled over something I have
no good solution for: I have mostly shell blocks, and very often have to
retrieve secrets from aws secretsmanager before I can do anything useful,
e.g. query a database in several places. What I've been doing is to put the
secret retrieval into a named block and can then inject the secret into
other blocks with a parameter that calls that block. But then, the secret
value is also echoed to the messages buffer, which I'd like to avoid? I'd
also like to avoid repeating the secrets-retrieval code all over the place.
Thanks for any tips.

Felix



-- 
Linux. The choice of a GNU generation.