Re: :session for Julia in org babel?

2022-08-19 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> On Tuesday, 16 Aug 2022 at 21:21, Ihor Radchenko wrote:
>> Can you also update [Worg]
>
> I will do so, maybe tomorrow.  I assume that's okay as it's a separate
> repository?  and as I do not have submit access, I'll post a patch here,
> if that's okay?

Sure. You can submit the patch here, and I will apply it.

>> This will set the variable globally. You may want setq-local instead.
>
> I've put the setting into the (let ...) and it seems to work just fine.
> New patch attached.

Thanks!
Applied onto bugfix via 4dff42f6a adding a defvar to pacify the compiler
warnings.

-- 
Ihor Radchenko,
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



Re: [PATCH] Documentation and NEWS for ` org-latex-language-alist'

2022-08-19 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> I am attaching a new version of the patch.

Thanks!
Applied onto main via 243ded74b adding one sentence to the =LANGUAGE=
keyword description and changing the ctan links to https.

I have added a short description of what LANGUAGE keyword value is:
"Language code of the primary document language."

> Addendum: Just as I was going to send this email, I saw the other email
> from Maxim in this thread, who says:
>
>> Firefox may block downloading of a file through unencrypted http:
>> protocol if a link is opened from a https: page (HTML version of the
>> Org manual served from orgmode.org this case). The problem with CTAN
>> mirrors is that not all hosts have TLS certificates including their
>> CTAN names.
>
> I can't figure out how to link to the babel documentation in a way other
> than a link to CTAN. If this might be an inconvenience (due to https
> issues), perhaps we could simply put in the documentation something like
> 'see the Babel docs', or referencing the command 'texdoc -M
> babel', which opens the locally installed babel documentation. The
> problem is that not all GNU/Linux distributions include the
> documentation in their versions of TeX live. For example, Arch Linux
> does not include documentation in the official repos and must be
> installed separately via an AUR package.

I went with https. It does open at least in some cases. The problem with
CTAN certificates is not our problem. Users may still search the
relevant documents if the link is dead.

Note that we still have a number of http links in the manual. One may
want to fix them.

-- 
Ihor Radchenko,
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



[Feature Request] Create an org-md-toplevel-hlevel variable to allow users to set the level of top level headings in markdown export

2022-08-19 Thread Rohit Patnaik
Hello,

I've been exporting several of my org-mode notes to markdown recently, and I've 
been running into an issue where I've had to manually adjust the level of the 
top level headings in my exported notes because the wiki system I'm importing 
the notes to reserves h1 (i.e. #) for page titles, using h2s (i.e. ##) for 
sections within the page itself.

I noticed that ox-html.el has a org-html-toplevel-hlevel variable, which allows 
the user to set the heading level of top-level headings within the exported 
content. Would there be any problems with implementing a similar variable (e.g. 
org-md-toplevel-hlevel) to allow the user to set the heading level of top level 
headings within exported markdown content?

It looks like it would be a small change, and I'd be happy to implement it 
myself, but I thought I'd run it by the list to see if there were any major 
issues that might arise from making this change.

Thanks,
Rohit Patnaik



Re: [off topic] List all non-latin characters in a buffer

2022-08-19 Thread Uwe Brauer
>>> "JMM" == Juan Manuel Macías  writes:
Hi Juan


> Sorry for the offtopic, but I thought this homemade function I wrote
> some time ago for my work might perhaps be useful to some Orgers. When
> executed in a buffer, the `list-non-latin-chars' function opens a window
> displaying a list of all the non (basic) Latin characters present in
> that document. Each item in the list contains the character, its Unicode
> canonical name, and its hexadecimal code. For example:

Very very nice,

Till now I used only a very simple search function

(defun my-search-no-ascii ()
"Simple function to search for no ASCII symbols in a file."
  (interactive)
  (skip-chars-forward "\001-\177"))

That is so much better!


smime.p7s
Description: S/MIME cryptographic signature


table alignment tags in Org export

2022-08-19 Thread Alex Fenton

Hello,

Trying to export a table with alignment tags, e.g.


#+caption: left-, centre- and right aligned columns
|     |       |   |
| a  |    b |    c |
| aa |  |  |

In, for example, HTML or ODT output, the columns are aligned according 
to the tags in the first row.


If exporting to Org (org-org-export-as-org), the tags disappear - i.e. 
the table is as-was, minus the first row.


Is there a way to retain the alignment information when re-exporting to 
Org? - either a function or some setting somewhere


cheers
alex




Re: [FEATURE REQUEST] statistics of repeated tasks

2022-08-19 Thread Abhisek Panigrahi
1. How and where it should be displayed?
It can be displayed alongside the task name e.g.
* TODO My repeated task (DONE=3)...
Here DONE=3 meaning the task has been completed 3 times.
Another way to display is: DONE=3/4, where it means the task is completed 3
times out of 4.
But it is much more complicated because the user can change the repeat
duration.
Another thing is to show the longest streak and last streak count, but
these are also complicated I believe based on the information that is
logged.
2. When it is going to be useful.
It is very motivating to see how many times you have complicated a specific
task. It is much like a streak. People would wanna see their statistics to
put more effort. I strongly believe "The best way to get better at
something is to measure it".

On Tue, Aug 16, 2022 at 9:39 AM Ihor Radchenko  wrote:

> Abhisek Panigrahi  writes:
>
> > I would have worked on the patch, but I don't know elisp or lisp
> language!
>
> Then, you may detail your proposal on how you envision this new
> statistics feature: (1) how and where it should be displayed; (2) when
> it is going to be useful.
>
> Note that I changed the email subject to bring this thread to the
> attention of other Org mailing list members.
>
> If there is sufficient interest, someone else may step up and implement
> the feature.
>
> I will probably add this to my todo-list, but my list is very too long
> already. I currently prioritize bugs and more widely requested features.
>
> --
> Ihor Radchenko,
> 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
>


Re: Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?)

2022-08-19 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>> I found ~org-load-modules-maybe~ load modules from ~org-modules~, it's a
>> list of ob-* or ol-* elisp modules. Not Julia modules. I searched
>> ~org-load-modules-maybe~ function invocation code in org-mode source
>> code, have not relative examples. Don't know how to use
>> ~org-load-modules-maybe~ to detect whether Julia modules exist and raise
>> helpful warning message.
>
> That was what I was actually referring to. ob-julia also requires two
> Elisp packages: julia-mode and ESS
> (https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-julia.html)

Oh, I misunderstand your meaning.

> Now I see that you were referring to the actual Julia packages. Those
> may be caught by Julia session code (org-babel-prep-session:julia) and
> then a warning may be displayed.

Yes, that's what I mean. Well, if ob-julia session can display warning.
That's fine. I have not realized that scene.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without 
misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature


Re: [PATCH v2] ol-info: Define :insert-description function

2022-08-19 Thread Max Nikulin

On 19/08/2022 11:28, Ihor Radchenko wrote:

Max Nikulin writes:


+(defun org-info--link-file-node (path)
+  "Extract file name and node from info link PATH.
+
+Return cons consisting of file name and node name or \"Top\" if node
+part is not specified. Components may be separated by \":\" or by \"#\"."


It looks like the docstring does not match what the function actually
returns.


It returns a cons, doesn't it? Is it confusing that separator for 
components is related to the argument?



+  (if (not path)
+  '("dir" . "Top")


"dir" is not a file. Also, it is not very clear what "dir" is referring
to. Maybe you can add a comment pointing to `org-info-other-documents'?


Try M-x info RET when you do not have *info* buffer and you get "(dir) 
Top" node. It is the directory of info files. If you run "info" without 
argument in shell you will get the same.



+(string-match "\\`\\([^#:]*\\)\\(?:[#:]:?\\(.*\\)\\)?\\'" path)
+(let* ((node (match-string 2 path))
+   ;; `string-trim' modifies match


Here and is several other places, including docstrings, please make sure
that the sentences end with "." and are separated with "  ".


It was supposed to be a brief phrase rather than complete sentence.


+  (cons
+   ;; Fallback to "org" is an arbirtrary choice
+   ;; and added because "(dir)filename" does not work as "filename".


Should this be documented? Or at least mentioned that the behaviour is
undefined. And if it is undefined you should not test it in the tests.


The purpose of test is to check that it does not signal some obscure 
error. I am unsure how to handle corner cases, so I am open to 
suggestions. Some considerations
- `org-info--link-file-node' may return nil when link path is incomplete 
or some value that may help to avoid error handling code paths in callers.
-  does not look like a valid link but it may be handled like 
shell "info" command without argument, so I chose "(dir)" node. Elisp 
(info) without arguments however may display existing buffer.

-  certainly should be handled as (info "(dir)")
-  is invalid. Maybe (info "elisp") should be used instead.
-  I am unsure in my choice to open (info "(org) Tables"). 
Maybe it is better to treat it as "(dir) Tables" and so as "(dir) Top" 
node since "(dir) Top" is quite reasonable for  with empty path.


Thanks for the review.




Re: Suspected bug: '#+STARTUP: indent' messes up inlinetasks' tag alignment

2022-08-19 Thread Alain . Cochard
Ihor Radchenko writes on Sat 13 Aug 2022 14:33:

 > Can you try the attached patch?

The problem is solved if I use emacs 28.1 (thanks a lot), but not for
emacs 27.2...

Emacs 27.2 is the native emacs for the Fedora 34 GNU/Linux
distribution I use.  I was able to install emacs 28.1 from source, but
I couldn't have my MUA (vm) work properly with it, so it would be
great if you could find a fix valid for emacs 27.2 too!

PS: I have had only a very limited and ancient experience with
patches, so it was not immediate for me to try your patch.  While
working on it, I noticed that the section of the manual

   * Feedback:: Bug reports, ideas, patches, etc.

does not even contain the word 'patch'.  So I was thinking it might be
a good idea to say a few words in that section about what patches are
and how to apply them.


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: C-c $ missing?

2022-08-19 Thread Summer Emacs


Mark Barton @ 2022-08-19 03:02 :

> [... 8 lines elided]

> You are welcome. You may eventually want to read about Speed Keys in Org mode 
> that is enabled with the org-use-speed-commands
> variable. That enables you to just press "a" when at the beginning of a 
> headline to archive that subtree. I use speed keys daily to
> clock-in to a task and to refile a task into one of my project subtrees.

tysvm!  I had no idea that existed and I will be reading about it
pretty soon. I just pulled up some web pages about it and will read them
this evening.

--
Summer,
Sent from MU4E in Emacs,
Because I'm becoming a NEWBIE at this!



Re: org-plot/gnuplot

2022-08-19 Thread Roger Mason
Hello Ihor,

Ihor Radchenko  writes:

> You need to have "gnuplot" Emacs package installed to be able to use
> org-plot and ob-gnuplot.

I had checked those were installed before posting.  What I had not
checked (duh) was that gnuplot would start and run.  There was a simple
linkage problem preventing that.  Now fixed.

Thanks,
Roger



Re: C-c $ missing?

2022-08-19 Thread Mark Barton


> On Aug 18, 2022, at 11:39 PM, Summer Emacs  wrote:
> 
> TY! That's exactly what I was hoping for. And thank you to Ihor and Matt
> as well for pointing me in the right direction. I was just reading up on
> C-c $ with C-h k when you replied so thank you to all of you for helping
> out. Noted everything down for future reference. 

You are welcome. You may eventually want to read about Speed Keys in Org mode 
that is enabled with the org-use-speed-commands variable. That enables you to 
just press "a" when at the beginning of a headline to archive that subtree. I 
use speed keys daily to clock-in to a task and to refile a task into one of my 
project subtrees.

Re: Fwd: Re: Typo in info pages

2022-08-19 Thread edgar

On 2022-08-19 05:39, Ihor Radchenko wrote:

Support Org development at https://liberapay.com/org-mode,


This is great! You should add cryptocurrencies there :) .

-
This free account was provided by VFEmail.net - report spam to ab...@vfemail.net

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: C-c $ missing?

2022-08-19 Thread Summer Emacs


Mark Barton @ 2022-08-18 23:37 :

> [... 5 lines elided]

> On my Emacs setup C-c $ is mapped to flyspell-correct-word-before-point, but 
> C-h b  shows that it is bound to org-archive-subtree.
> Did you recently enable spellcheck in org mode?

Aha! that must be it because I enabled flyspell globally in all text/org
docs just 2 days ago but I had forgotten that I did that.

> If I M-x flyspell-mode to turn off flyspell then C-c $ is mapped back to 
> org-archive-subtree.
>
> If that is the case for you, you could try adding this to your init file.
>
> (eval-after-load "flyspell"
>   '(define-key flyspell-mode-map (kbd "C-c $") nil))

TY! That's exactly what I was hoping for. And thank you to Ihor and Matt
as well for pointing me in the right direction. I was just reading up on
C-c $ with C-h k when you replied so thank you to all of you for helping
out. Noted everything down for future reference. 

> Mark

--
Summer,
Sent from MU4E in Emacs,
Because I'm becoming a NEWBIE at this!



Re: C-c $ missing?

2022-08-19 Thread Mark Barton


> On Aug 18, 2022, at 11:06 PM, Summer Emacs  wrote:
> 
> So I was just curious as to what happened to C-c $? 

On my Emacs setup C-c $ is mapped to flyspell-correct-word-before-point, but 
C-h b  shows that it is bound to org-archive-subtree. Did you recently enable 
spellcheck in org mode?

If I M-x flyspell-mode to turn off flyspell then C-c $ is mapped back to 
org-archive-subtree.

If that is the case for you, you could try adding this to your init file.

(eval-after-load "flyspell"
  '(define-key flyspell-mode-map (kbd "C-c $") nil))

Mark

Re: [BUG] Fix for inlinetask visibility cycling causes infinite loop for "degenerate" inlinetasks

2022-08-19 Thread Ihor Radchenko
Anders Johansson  writes:

> Since April, an infinite loop is caused when cycling an entry containing
> degenerate inlinetasks by commit:
> 5f184b org-inlinetask.el: Fix visibility cycling for inlinetasks
>
> Sample for reproducing:
> -
> * Heading
> *** Degenerate inlinetask
> -

I am unable to reproduce on main and on bugfix.
What is your Org version (M-x org-version)?

-- 
Ihor Radchenko,
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



Re: C-c $ missing?

2022-08-19 Thread Ihor Radchenko
Summer Emacs  writes:

> C-c C-x C-s was never in question.  I was asking what happened to 'C-c
> $' because that *would* actually archive the subtree instead of having
> to type out C-c C-x C-s. It's even in my notes for emacs commands to use
> and I used to use it every day for DONE tasks. 
>
> From my notes:
>
> * C-c C-t - Change task status
> * C-c $ - Archive subtree
>
> See? It's there. 

org-keys.el still have
(org-defkey org-mode-map (kbd "C-c $") #'org-archive-subtree)

So, it is likely some third-party package or your config overriding this
binding somehow.

-- 
Ihor Radchenko,
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



Re: org-plot/gnuplot

2022-08-19 Thread Ihor Radchenko
Roger Mason  writes:

> I want to plot energy against variable from this table.
>
> ...
> I think the #+plot: invocation is correct for org-plot/gnuplot but when
> run I just get "user-error: Current buffer has no process".

You need to have "gnuplot" Emacs package installed to be able to use
org-plot and ob-gnuplot.

-- 
Ihor Radchenko,
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



Re: C-c $ missing?

2022-08-19 Thread Summer Emacs


Matt @ 2022-08-18 19:19 :

>   On Thu, 18 Aug 2022 12:46:23 -0400  Summer Emacs  wrote ---
>  >
>  > Hi everyone, first time posting. I hope it's okay to ask this here (I'm
>  > totally new):
>
> Welcome!

ty! 

>  > Since this morning (I updated a few packages but not sure which), C-c $
>  > is missing in org mode? It's how I used to archive tasks when they were
>  > done. I know that I can use C-c C-x C-s but I used to just use C-c $ and
>  > it worked. Did something change with an update?
>  >
>  > (I think it was C-c $ or maybe C-x $? Sometimes I get the two confused)
>
> I don't know if anything changed with Org, I'll let others speak to
> that.  However, in the mean time, check C-h k C-c C-x C-s to see what
> command is bound to that sequence (is it org-archive-subtree?).  Then
> you can bind it with something like:

Yep it's that. 

> (eval-after-load 'org-mode
>   (define-key org-mode-map (kbd "C-c C-x C-s") #'org-archive-subtree))

It's already bound to that so no need. 

> This says, "after loading org-mode for the first time, define the key
> sequence within the variable telling Emacs what keys do what for
> org-mode to call the function org-archive-subtree when it sees C-c C-x
> C-s."  The C-h f and C-h v commands describe-function and
> describe-variable can probably explain that better.

C-c C-x C-s was never in question.  I was asking what happened to 'C-c
$' because that *would* actually archive the subtree instead of having
to type out C-c C-x C-s. It's even in my notes for emacs commands to use
and I used to use it every day for DONE tasks. 

>From my notes:

* C-c C-t - Change task status
* C-c $ - Archive subtree

See? It's there. 

(Sorry for the hearts emojis those are my bullets in org mode I just
copy/pasted)

So I was just curious as to what happened to C-c $? But as to your
explanation for the code, I will keep that and use it whenever it comes
up! Ty! I *have* done *basic* keybinds before but nothing more than
that. In fact, I'm putting your code in my denote files for later
reference. Thank you very much. 


> [... 4 lines elided]

> We all start somewhere!   I hope this helps.  Just saw your message as I was 
> passing by.  If it's unclear, that's totally my fault!

Yea we definitely do. TY for your reply. 

--
Summer,
Sent from MU4E in Emacs,
Because I'm becoming a NEWBIE at this!



Re: Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?)

2022-08-19 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> I found ~org-load-modules-maybe~ load modules from ~org-modules~, it's a
> list of ob-* or ol-* elisp modules. Not Julia modules. I searched
> ~org-load-modules-maybe~ function invocation code in org-mode source
> code, have not relative examples. Don't know how to use
> ~org-load-modules-maybe~ to detect whether Julia modules exist and raise
> helpful warning message.

That was what I was actually referring to. ob-julia also requires two
Elisp packages: julia-mode and ESS
(https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-julia.html)

Now I see that you were referring to the actual Julia packages. Those
may be caught by Julia session code (org-babel-prep-session:julia) and
then a warning may be displayed.

-- 
Ihor Radchenko,
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