Org-mode meta results

2023-02-17 Thread Galaxy Being
I can't get this to play the meta game in an org-mode buffer

#+begin_src emacs-lisp
(defun print-elements-of-list (list)
  "Print each element of LIST on a line of its own."
  (while list
(print (car list))
(setq list (cdr list
#+end_src

#+RESULTS:
: print-elements-of-list

#+begin_src emacs-lisp
(setq animals '("gazelle" "giraffe" "lion" "tiger"))
#+end_src

#+RESULTS:
| gazelle | giraffe | lion | tiger |

#+begin_src emacs-lisp :results verbatim
animals
#+end_src

#+RESULTS:
: ("gazelle" "giraffe" "lion" "tiger")

#+name: animal_list
#+begin_src emacs-lisp :results output list
(print-elements-of-list animals)
#+end_src

#+RESULTS: animal_list
: - "gazelle"
: - "giraffe"
: - "lion"
: - "tiger"

#+begin_src emacs-lisp :var alist=animal_list() :results list
alist
#+end_src

#+RESULTS:
: - "gazelle"
: - "giraffe"
: - "lion"
: - "tiger"

#+begin_src emacs-lisp :var alist=animal_list()
(mapcar (lambda (x) (concat x "foo")) alist)
#+end_src

I'm getting an error from evaluating the last block:

Wrong type argument: sequencep, 10.

I'm fairly sure that alist by this point is not actually an elisp list. But
what does animal_list() contain then? It's the output of my
print-elements-of-list function. Is there a way to "look under the hood" at
what a named block animal_list() contains?

-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Re: Template for ob- packages?

2023-02-17 Thread Galaxy Being
Yes, I'll try to have a look. My Emacs gig so far has been user/power user
and "investigator" of Babel languages. Right now I'm on Prolog. I'll learn
some of ob-prolog's capabilities first.

On Thu, Feb 16, 2023 at 3:16 PM Matt  wrote:

>
>   On Thu, 16 Feb 2023 16:10:51 -0500  Galaxy Being  wrote ---
>  > Is there a generic starter template for writing an ob- package, some
> sort of example code?
>
> Yes:
> https://git.sr.ht/~bzg/worg/tree/master/item/org-contrib/babel/ob-template.el
>
> When I started learned Babel, I took notes with the hope of expanding it
> into a Worg article.  Here are the notes:
> https://excalamus.com/2021-11-03-org_babel.html
>
> If you're interested in fleshing out the notes into proper documentation,
> I'd be happy to help.
>


-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Template for ob- packages?

2023-02-16 Thread Galaxy Being
Is there a generic starter template for writing an ob- package, some sort
of example code?

⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


ob-groovy.el must be hand-loaded?

2022-12-21 Thread Galaxy Being
Don't know why, but in my "spare time" I snoop around Babel. So I've
revisited Groovy in Babel and have found a bizarre situation where, yes,
there appears an ob-groovy.el in my ~/.emacs.d/elpa/org-9.6/ , but I have
to do a specific load-file to get it seen and functioning. And no, it's not
because of a naming issue in my

 (org-babel-do-load-languages
 (quote org-babel-load-languages)
 (quote ((emacs-lisp . t)
  (groovy . t)
   ...
  )))

form. I've renamed it apache-groovy and it errored out specifically not
finding ob-groovy.el. But again, if I don't specifically load the org-9.6
ob-groovy.el, I get "can't find program groovy" upon block C-c C-c.

-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Latest MathJax?

2022-12-12 Thread Galaxy Being
I just perused my org-html-mathjax-options and the path seems outdated

'((path "
https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS_HTML";)
  (scale "100")
  (align "center")
  (font "TeX")
  (linebreaks "false")
  (autonumber "AMS")
  (indent "0em")
  (multlinewidth "85%")
  (tagindent ".8em")
  (tagside "right"))

Shouldn't it be

https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

Is that up to me to change in my own org-html-mathjax-options? I'm not
doing any header arguments in org-mode buffers, no #+HTML_MATHJAX: stuff.
Basically, I'd like a different font for my LaTex/MathJax markup.

⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Re: Supress title on html export

2022-12-02 Thread Galaxy Being
BTW, this would seem to suggest org-mode has some built-in "master CSS".
Or, how does org-mode know about the class/ID .title? In my case, I use my
own CSS that I put in the header, and yes, it has a .title. Still, how does
bare-bones default html export know about .title?

On Wed, Nov 30, 2022 at 6:43 PM Rudolf Adamkovič  wrote:

> Galaxy Being  writes:
>
> > Yes, leaving it blank suppresses it, but then my browser needs a page
> > title for searching. I'm trying to have and not display a title.
>
> Using CSS, for example:
>
> #+html_head_extra:  .title { display: none; } 
>
> Rudy
> --
> "Genius is 1% inspiration and 99% perspiration."
> -- Thomas Alva Edison, 1932
>
> Rudolf Adamkovič  [he/him]
> Studenohorská 25
> 84103 Bratislava
> Slovakia
>


-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Supress title on html export

2022-11-30 Thread Galaxy Being
I found this
,
but apparently it no longer applies. Any ideas how to not display a title
-- besides leaving #+TITLE: blank? Yes, leaving it blank suppresses it, but
then my browser needs a page title for searching. I'm trying to have and
not display a title.

-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Re: How to keep getting org updates

2021-10-13 Thread Galaxy Being
Appreciate the help and encouragement. This pinning business ... seems like
musical chairs with different suggestions here and there. Should I use this

suggestion,
or maybe this

one, or...? And where is the maintained list of packages? I see
.../elpa/archives/ but don't see anything else. Sorry to be a help vampire,
but I've never gotten past "casual Emacs user" status and don't think I
ever will with my hectic schedule.

On Wed, Oct 13, 2021 at 4:55 AM Greg Minshall  wrote:

> > The install instructions on the main org page were not very clear, to
> > say the least.
>
> yes, that does sound messy.  sorry your experience was so unfortunate.
>
> i guess one question for the list: is there a general solution to the
> "20200912" > "9.5" issue?  or, "now" that we are only distributing via
> [git repository and] gnu elpa, will that issue disappear?  does this
> new-fangled concept of "semantic versioning" come into play here?
>
> possibly in the info pages we could have a section on
> "re-installing/upgrading", to help people navigate this process.  (once
> we, ourselves, have a map.)
>
> cheers, Greg
>


-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Re: How to keep getting org updates

2021-10-12 Thread Galaxy Being
What do you mean by 'inning' org to the ELPA repository?

What I've done was to remove the last line in my init.el for ...
orgmode.org/elpa, restarted, then tried through list-packages to D org --
which seemed to comply, but never removed org-20210920 from the elpa
directory. Not being gone, the old version kept reinstalling itself. So I
finally manually moved org-20210920 somewhere else. But then repeated
restarts never brought org-9.5 into the list-packages listing, despite
having gnu/elpa in my init.el. But I did manage to "trick" 9.5 in by
installing an org package with org, naturally, needed as a dependent. It
offered some other version, but the "other version" install window knew
about latest-greatest 9.5, which I chose, thereby "tricking" 9.5 to be
installed. Org-9.5 is now listed only as a dependency in list-packages, of
all things. I commented out my org-plus-contrib, not knowing how to proceed
with it. The install instructions on the main org page were not
very clear, to say the least.

On Tue, Oct 12, 2021 at 1:33 AM Tim Cross  wrote:

>
> Galaxy Being  writes:
>
> > This is in my init.el
> >
> > ...
> > (setq package-archives '(("ELPA"  . "http://tromey.com/elpa/";)
> > ("gnu"   . "http://elpa.gnu.org/packages/";)
> > ("melpa" . "https://melpa.org/packages/";)
> > ("org"   . "https://orgmode.org/elpa/";)))
> > ...
> >
> > I'm guessing the last line is no more and should be removed? In any
> case, not getting 9.5 when I do a package update.
>
> The 9.5 version is in GNU ELPA. However, if you have a version from
> orgmode.org or melpa, the version number is probably the release date
> e.g. 20211001 or example, and package.el will see that as a later
> version to 9.5 (because 20211001 is a larger number!).
>
> My suggestion would be to uninstall any version you have installed and
> then install the 9.5 version from ELPA. I would also remove the
> orgmode.org repository as you mention. It may also be worthwhile
> 'inning' org to the ELPA repository (which should mean package.el will
> only look at the ELPA repository when looking for updates (and not, for
> example, MELPA).
>
> If your running the emacs 28 pretest, it already includes 9.5
>
>

-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


How to keep getting org updates

2021-10-11 Thread Galaxy Being
This is in my init.el

...
(setq package-archives '(("ELPA"  . "http://tromey.com/elpa/";)
("gnu"   . "http://elpa.gnu.org/packages/";)
("melpa" . "https://melpa.org/packages/";)
("org"   . "https://orgmode.org/elpa/";)))
...

I'm guessing the last line is no more and should be removed? In any case,
not getting 9.5 when I do a package update.


-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Re: Formatting content in a footnote for ox-tufte

2021-06-03 Thread Galaxy Being
I just discovered that the ox-tufte handling of footnote formatting is
different from normal org mode formatting. Normal footnotes take source
blocks while ox-tufte ignores them and all other blocks as well.

On Wed, Jun 2, 2021 at 11:22 AM Galaxy Being  wrote:

> I'm using the org tufte <https://github.com/dakrone/ox-tufte> ox-tufte
> and started tweaking the underlying tufte.css
> <https://edwardtufte.github.io/tufte-css/>to my needs. It's really meant
> for org html export, not like the more elaborate org-to-latex Tufte
> formatting from org mode luminary Thomas Dye. As such, it gives you the
> Tufte look-and-feel with fonts and the famed sidenote/margin note feature
> -- all for just making a footnote (that appears beside its link in the text
> rather than the usual at the bottom of the page). The margin note
> capability is gnarlier in that it is just a link in the main text that then
> appears to the right of the main text
>
> [[mn:1][Here is some text that will appear as a side column block]][[mn:2][And
> putting one right after the first one makes it look like a new paragraph]]
>
> Obviously, this is a limiting factor on how elaborate and expressive these
> side columns can be, especially the margin note which has your content
> inside the link. However, the sidenote as a redirected footnote isn't too
> bad. Still, I'd like to be able to fully format what goes into a footnote
> without jumping through a lot of hoops. Here's an example of one footnote
> as sidenote that comes out looking okay despite the kludginess
>
> [fn:1] Star chart for \\
> \\
> file:./images//Celestial_map_Hyi.png \\
> \\
> Just text for a few lines of text that is just meant as filler, not
> anything important. Just here to show how text looks in a
> sidenote. Cool, I think this is enough.\\
> \\
> ~foldr :: (a → b → b) → b → [a] → b~ \\
> ~foldr f e [ ] = e~\\
> ~foldr f e (x : xs) = f x (foldr f e xs)~ \\
> \begin{align*}
> v = \frac{x}{t}
> \end{align*}
> [[
> https://learning.edx.org/course/course-v1:EPFLx+MatlabeOctaveBeginnersX+1T2017/home][MatLab
> <https://learning.edx.org/course/course-v1:EPFLx+MatlabeOctaveBeginnersX+1T2017/home%5D%5BMatLab>
> and Octave training]]
>
> For one, I couldn't get any sort of normal org block formatting (e.g.,
> #+BEGIN_example...) for the code snippet to be recognized. Is there any
> sort of "normal" content formatting for org footnotes? Obviously, the worst
> is the margin note [[mn:... situation. That simply needs to be redone.
> But a margin note differs from a sidenote only because the margin note is
> not numbered. I tried the org-footnote-auto-label set to confirm, but it
> always reverts back to plain numbering.
>
> Any ideas for improvement appreciated. This would be a really good-looking
> org html export option if it was bit more user-friendly.
>
> ⨽
> Lawrence Bottorff
> Grand Marais, MN, USA
> borg...@gmail.com
>


-- 
⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Formatting content in a footnote for ox-tufte

2021-06-02 Thread Galaxy Being
I'm using the org tufte  ox-tufte and
started tweaking the underlying tufte.css
to my needs. It's really meant
for org html export, not like the more elaborate org-to-latex Tufte
formatting from org mode luminary Thomas Dye. As such, it gives you the
Tufte look-and-feel with fonts and the famed sidenote/margin note feature
-- all for just making a footnote (that appears beside its link in the text
rather than the usual at the bottom of the page). The margin note
capability is gnarlier in that it is just a link in the main text that then
appears to the right of the main text

[[mn:1][Here is some text that will appear as a side column block]][[mn:2][And
putting one right after the first one makes it look like a new paragraph]]

Obviously, this is a limiting factor on how elaborate and expressive these
side columns can be, especially the margin note which has your content
inside the link. However, the sidenote as a redirected footnote isn't too
bad. Still, I'd like to be able to fully format what goes into a footnote
without jumping through a lot of hoops. Here's an example of one footnote
as sidenote that comes out looking okay despite the kludginess

[fn:1] Star chart for \\
\\
file:./images//Celestial_map_Hyi.png \\
\\
Just text for a few lines of text that is just meant as filler, not
anything important. Just here to show how text looks in a
sidenote. Cool, I think this is enough.\\
\\
~foldr :: (a → b → b) → b → [a] → b~ \\
~foldr f e [ ] = e~\\
~foldr f e (x : xs) = f x (foldr f e xs)~ \\
\begin{align*}
v = \frac{x}{t}
\end{align*}
[[
https://learning.edx.org/course/course-v1:EPFLx+MatlabeOctaveBeginnersX+1T2017/home][MatLab
and Octave training]]

For one, I couldn't get any sort of normal org block formatting (e.g.,
#+BEGIN_example...) for the code snippet to be recognized. Is there any
sort of "normal" content formatting for org footnotes? Obviously, the worst
is the margin note [[mn:... situation. That simply needs to be redone. But
a margin note differs from a sidenote only because the margin note is not
numbered. I tried the org-footnote-auto-label set to confirm, but it always
reverts back to plain numbering.

Any ideas for improvement appreciated. This would be a really good-looking
org html export option if it was bit more user-friendly.

⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Format babel code block for export?

2021-06-01 Thread Galaxy Being
I have this

#+begin_src haskell :results silent :exports code
:{
maximum'' :: (Ord a) => [a] -> a
maximum'' = foldl1 (\x acc -> if x > acc then x else acc)
:}
#+end_src

but on export to HTML (or LaTex) I'd like to suppress the :{ and :} to just
show the code

maximum'' :: (Ord a) => [a] -> a
maximum'' = foldl1 (\x acc -> if x > acc then x else acc)

Also, this

#+begin_src haskell :results verbatim :exports both
maximum'' [1,3,5,2,4]
#+end_src

I'd like to export the code part with a > REPL prompt included, e.g.,

> maximum'' [1,3,5,2,4]

I once saw some similar tricks, but I've searched and searched and can't
find them again. There's probably other html export formatting I'd like
too, but if anyone can point me to that mystery doc I'd appreciate it.

⨽
Lawrence Bottorff
Grand Marais, MN, USA
borg...@gmail.com


Re: Custom org-mode tags: What is the limit?

2021-02-12 Thread Galaxy Being
I realize the wording before is bad. Here's a revamp:

How many global, persistent tags can you have with org-mode? I seem to have
org-tag-alist with its fast tag selection maxed out at 26. Is that the
limit for it, lower-case letters in the alphabet? I would like to have
potentially hundreds of tags as tags seem to be vaguely the same as a book
index. And I would like this large body of tags available globally. I see
there is an org-tag-persistent-alist but how does this differ from the
org-tag-alist? I suppose org-tag-persistent-alist can't have fast selection
keys? I realize, of course, you can simply make up any symbol, place it
within colons and there's your tag; but I'm looking for a way to have
persistent global tags by the hundreds.

On Thu, Feb 11, 2021 at 10:35 PM Galaxy Being  wrote:

> How many custom, self-made tags can you have with org-mode? org-tag-alist
> seems maxed out at 26. Is that the limit? On a heading, I can C-c C-c and a
> (helm?) buffer comes up with my 26 tag choices. So can you only create as
> many tags as there are lower-case letters in the alphabet. Is this true? I
> would like to have potentially hundreds of tags as tags seem to be vaguely
> the same as a book index.
>
> LB
>


Custom org-mode tags: What is the limit?

2021-02-11 Thread Galaxy Being
How many custom, self-made tags can you have with org-mode? org-tag-alist
seems maxed out at 26. Is that the limit? On a heading, I can C-c C-c and a
(helm?) buffer comes up with my 26 tag choices. So can you only create as
many tags as there are lower-case letters in the alphabet. Is this true? I
would like to have potentially hundreds of tags as tags seem to be vaguely
the same as a book index.

LB