emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [FR] Adding explicitly negative :results Type option
@ 2024-06-04  3:57 Weaver Marquez
  2024-06-04 13:28 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Weaver Marquez @ 2024-06-04  3:57 UTC (permalink / raw)
  To: emacs-orgmode

There is behavior that only happens if `:results' Type is not set at all.
I'd like to request a new Type option that would easily negate a
default arg without having to clear the default header args variable.

By Type, I mean these:
<https://orgmode.org/manual/Results-of-Evaluation.html#Type-1>

Case 1: With no default header args
  ,---- elisp
  | (concat "My String")

  ,---- result
  | My String

Case 2: With default `:results scalar'

  ,---- elisp
  | (concat "My String")

  ,---- result
  | "My String"


Being new to Library of Babel, my default header args are
`:results value vector replace'. However, I had trouble with this
code block from `elot' used to add a SETUPFILE on HTML export:

`foo.org'
,----
| #+call: theme-readtheorg()
`----

`theme-readtheorg()'
,----
| (concat "#+SETUPFILE: " (file-name-directory (locate-library
"elot")) "theme-readtheorg.setup")
`----

Which won't work if the /Type/ value is set by default.

I think this would be useful even if the better solution is getting used
to setting buffer/header local variables. It could also help library authors
ensure that a certain code block like above will work as intended.


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

* Re: [FR] Adding explicitly negative :results Type option
  2024-06-04  3:57 [FR] Adding explicitly negative :results Type option Weaver Marquez
@ 2024-06-04 13:28 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-06-04 13:28 UTC (permalink / raw)
  To: Weaver Marquez; +Cc: emacs-orgmode

Weaver Marquez <weavermarquez0@gmail.com> writes:

> There is behavior that only happens if `:results' Type is not set at all.
> I'd like to request a new Type option that would easily negate a
> default arg without having to clear the default header args variable.
>
> By Type, I mean these:
> <https://orgmode.org/manual/Results-of-Evaluation.html#Type-1>
>
> Case 1: With no default header args
>   ,---- elisp
>   | (concat "My String")
>
>   ,---- result
>   | My String
>
> Case 2: With default `:results scalar'
>
>   ,---- elisp
>   | (concat "My String")
>
>   ,---- result
>   | "My String"
> ...
> I think this would be useful even if the better solution is getting used
> to setting buffer/header local variables. It could also help library authors
> ensure that a certain code block like above will work as intended.

What about introducing an additional :results Type option - :results
auto? We will also make it the default.

Then, you can use :results auto to override whatever result type is
inferred from parent heading/global option/variable.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2024-06-04 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-04  3:57 [FR] Adding explicitly negative :results Type option Weaver Marquez
2024-06-04 13:28 ` Ihor Radchenko

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