From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Tobias Zawada <i@tn-home.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Enhancement: Changing default setting of source block header line switches [9.0.5 (9.0.5-elpa @ /home/naehring/.emacs.d/elpa/org-20170210/)]
Date: Mon, 28 Aug 2017 10:12:05 +0200 [thread overview]
Message-ID: <87d17gt8kq.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87mv8idrff.fsf@smtp.1und1.de> (Tobias Zawada's message of "Thu, 06 Jul 2017 08:12:52 +0200")
Hello,
Tobias Zawada <i@tn-home.de> writes:
> At first I would like to ask whether it is already possible to change
> the default settings of the source block header line switches.
>
> The question
>
>> Is it possible to define source block switches globally in org mode?
It is only possible for some of them (i.e., "l" and "i").
> at https://emacs.stackexchange.com/questions/33971/is-it-possible-to-define-source-block-switches-globally-in-org-mode
> demonstrates the usefulness of this feature.
This is Emacs. It takes 3 seconds to register a macro (or to write
a regexp) and have "-n" applied on all the blocks.
Of course, a global setting is handier in this case. However, there is
no way to negate a switch, so it would ultimately get in the way.
> Reading part of the orgmode-manual (http://orgmode.org/manual/Literal-examples.html#Literal-examples), scanning the customization options,
> and inspecting the source code gave me the impression that this is not
> implemented yet. So, I am filing that as an enhancement request.
>
> 1. It should be possible to customize the default settings of the
> switches
> 2. It should be possible to change the default settings of the switches
> tree-locally through setting a property. That includes file-local
> settings if one sets the property before the first headline.
> 3. Explicit inner settings should override outer settings, e.g.,
> tree-local settings override the customization options and explicit headline
> switches override the tree-local settings.
> 4. For each switch there should also be a negative switch. E.g., if line
> numbering is enabled through the customization option it should be
> possible to disable it with a tree-local setting or with the source
> block headline switches.
What you are looking for is a change of the switch syntax. Actually,
merging switch and header arguments would bring automatically 2 3 4,
e.g.,
#+begin_src emacs-lisp :n t
...
#+end_src
or
#+begin_src emacs-lisp :n 10
...
#+end_src
or
#+begin_src emacs-lisp :n nil
...
#+end_src
This is backward incompatible, tho. But, more importantly, it introduces
a slight shift in the source blocks paradigm. Unlike header arguments,
switches do not depend on Babel. E.g.,
#+begin_src emacs-lisp :exports code
...
#+end_src
and
#+header: :exports code
#+begin_src emacs-lisp
...
#+end_src
are equivalent, but not
#+begin_src emacs-lisp -n
...
#+end_src
and
#+header: -n
#+begin_src emacs-lisp
...
#+end_src
We could make a special case for :n :k :l :i :r, i.e., explicitly forbid
them in #+header: lines, or handle them at the parser level.
What do you think? Would you want to work on this?
Regards,
--
Nicolas Goaziou
prev parent reply other threads:[~2017-08-28 8:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 6:12 Enhancement: Changing default setting of source block header line switches [9.0.5 (9.0.5-elpa @ /home/naehring/.emacs.d/elpa/org-20170210/)] Tobias Zawada
2017-07-06 7:03 ` Rasmus
2017-07-06 7:33 ` Tobias Zawada
2017-08-28 8:12 ` Nicolas Goaziou [this message]
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=87d17gt8kq.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=i@tn-home.de \
/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.