Org and APL

2021-10-01 Thread Steven Harris
Hi All

I'm trying, not for the first time, to get my head around the APL
programming language.  This uses some strange glyphs to achieve its purpose.

I would like to write my notes and code snippets in an Org file or two and
ideally be able to write in a literate-programming style using org-babel.

1. Can anyone provide tips for simply adding APL text in an org-mode
document?
2. Has anyone had success with org-babel and APL integration?

Any flavour of APL is fine, GNU, Dyalog or whatever.

Thanks

Steven


Beginning with org-babel.

2022-02-24 Thread Steven Harris
Hi All

Ansible is a system configuration-management tool that is based on
"playbooks".  These are collections of mostly YAML files, but also Jinja2
templates and unix configuration files.  To execute one needs to run a unix
shell command with a python virtualenv set up and usually some environment
variables set.

Painfully much of this lives fragmented in a nested directory structure,
many of the files in which are named "main.yml".   Sometimes  the same
information has to be set in two places with incompatible formats , such as
a config file and an environment variable.

I am trying to bring some literate programming to bear on this can of worms
so have reached for Babel.  It's my first use of it.

The current problem is that I have a config file that I want to substitute
a value into.  I want the conf-mode highlighting.  Conf is not a
programming language of course, just a text format.

I'm trying something like

#+begin_src conf :tangle yes :noweb yes
  [defaults]
  private_key_file = <>
#+end_src

I have tried something similar to the SQL comment example in the
documentation to no avail and also setting :var headers. How can I
substitute a value here?

Cheers

Steven


Re: Get Grades Done: the joys of Org's simple power

2020-06-10 Thread Steven Harris
A simple tailored emacs docker image and a terminal emulator might do the
trick for Mr Prater.  I've recently used a docker image that is a self
contained Gnu Octave application accessed through a web browser in a
similar way that works for sighted folks.
epflsti/octave-x11-novnc-docker:latest

HTH
Steven


On Thu, 11 Jun 2020 at 13:57, George Mauer  wrote:

> You know...I believe some people have gotten emacs running in browser...
> You could do it by compiling it to wasm. So in theory you could create a
> completely in-browser emacs which is optimized primarily for org mode usage.
>
> Would be kind of an awesome thing for someone to tackle as it would
> greatly increase the reach of org. Not easy though. Could probably be a
> whole thesis project.
>
> Not sure how well it would work with screen readers and other
> accessibility tech though. That would be even more work
>
> On Wed, Jun 10, 2020, 10:24 PM Russell Adams 
> wrote:
>
>> On Wed, Jun 10, 2020 at 03:38:43PM -0500, Devin Prater wrote:
>> > Now, I do wish I could share these “self-grading” performance tests with
>> > others. I’ve tried exporting one to HTML, but the grade doesn’t seem to
>> update
>> > automatically like it does in Org-mode.
>>
>> Unfortunately updating the count is performed by a hook in Org when you
>> use C-c
>> C-c to check/uncheck a box. That information is static in the text, and
>> static
>> in html.
>>
>> I'm not aware of a built-in way to handle that case. Sorry.
>>
>> --
>> Russell Adamsrlad...@adamsinfoserv.com
>>
>> PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/
>>
>> Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>>
>>


Re: per-file (or, really, per buffer) allowing/disallowing code block execution

2022-09-06 Thread Steven Harris
There is a neat solution to this problem using

* Local Variables :noexport:

see the discussion at stackoverflow


Cheers,

Steven


On Wed, 7 Sept 2022 at 05:07, Greg Minshall  wrote:

> Fedja,
>
> > What I would like to have, to safely and easily use org-mode
> > as an interactive notebook, is to not have to overload this
> > function and to be asked only once per buffer/file whether to:
> > 1) Unconditionally allow executing all code blocks
> > 2) Unconditionally disallow executing all code blocks
> > 3) Ask for every block.
>
> i think that is an interesting idea, and maybe a more pleasant user
> interface than what we currently have.
>
> probably, for me, it would allow me to drop a number of buffer-local
> variable customizations, as i'm typically evaluating code in a given
> buffer over and over again (and, so, would be happy to pay the price of
> saying "yes" once per buffer (per emacs instance).
>
> i'd be curious to hear what the downsides might be, especially anyone
> who sees security-related downsides.
>
> Ihor,
>
> > 1) You can set org-confirm-babel-evaluate buffer-locally
> > 2) Same or set :eval no header arg. (see
> > https://orgmode.org/org.html#Evaluating-Code-Blocks)
> > 3) You can set :eval query header arg.
>
> for me the use case is 1) disabling all (or setting to "query") when,
> e.g., you are exporting some file you received via e-mail and so trust
> *none* of the code blocks; 2) enabling all for some file that you
> yourself maintain, and so trust *all* the code blocks.  at least
> initially, this seems a nice direction.
>
> cheers, Greg
>
>


Re: How to get shell source blocks to read my profile?

2021-03-15 Thread Steven Harris
Well on my mac Emacs is launched by Ruby.  I remember having to allow ruby
to do that two years ago when I set this up.

But thanks for sharing your expertise.  I've been a unixy admin for 20
years and didn't know a lot of that.

Cheers

Steven.

On Tue, 16 Mar 2021 at 07:34, Tim Cross  wrote:

>
> George Mauer  writes:
>
> > Thanks a lot! The interactive/non-interactive was indeed the core issue.
> Extra frustrating because it seems like supplying `--rcfile` does nothing
> if you
> > *do* use `-c` but *don't* use `-i`...ah ad-hoc cli design.
> >
>
> It certainly can seem rather ad hoc. However, it actually makes sense on
> some levels. If you use -c your telling the shell to execute a command
> and then exit. By definition, this is non-interactive. This is covered
> in the manual.
>
> Where it becomes confusing is when your mixing in different options as
> some override others. So, provided you include -i with -c, it will be
> forced into interactive i.e. -i overrides the non-interactive status
> added with -c. If you add -s, telling the shell to read input from
> stdin, you also override non-interactive status.
>
> The other possible solution to your situation is to ensure
> Emacs runs inside an environment which has all your exported variables
> i.e. inside your login shell environment. There are a few ways to do
> this, but probably the easiest is to create a script which opens a login
> shell, then calls Emacs (may need to use open - not sure) and Emacs will
> inherit your environment. Advantage is that processes you then spawn
> from within Emacs will also inherit that environment. You then add this
> script as the executable in the dock rather than calling Emacs directly.
>
> One thing to watch out for is that if your also using oh-my-zsh, it
> setups up some aliases with the name emacs which actually call
> emacsclient. This can be confusing as it means running just 'emacs' in
> the shell will run the alias and not actually run Emacs directly. Things
> can be even more confusing as there are also multiple ways to install
> Emacs on the mac and they are all slightly different with respect to how
> they setup things.
>
> What I find hardest with writing shell stuff is that I simply don't seem
> to do it much anymore. My brain cache is just too small and when I find
> it necessary to write a shell script again, all that knowledge has been
> flushed! Once upon a time, many moons ago, I could write shell scripts
> that used sed, awk, cut, uniq etc without even needing to look at the
> man pages. These days, I have to check the bash man page just to
> remember what the expr operators are!
>
> --
> Tim Cross
>
>