How to install org-protocol

2023-06-24 Thread Ypo

Hi

I would like to give another try to org-protocol, but I can't find the 
package to install it. Is it on org-contrib? A link, please?



Best regards


Re: How to install org-protocol

2023-06-24 Thread Ihor Radchenko
Ypo  writes:

> I would like to give another try to org-protocol, but I can't find the 
> package to install it. Is it on org-contrib? A link, please?

It is built-in.



Re: How to install org-protocol

2023-06-24 Thread Max Nikulin

On 24/06/2023 16:06, Ypo wrote:


I would like to give another try to org-protocol, but I can't find the 
package to install it. Is it on org-contrib? A link, please?


Have you stuck with emacs or with desktop handler configuration?

In emacs init file you should have

 (require 'org-protocol)

*after* modification of `load-path' if you use non built-in Org version. 
You need running server: either emacs should be started as a daemon or


 (server-start)

I have never tried to configure org-protocol on Windows, so I have no 
idea if recipes are correct.


https://orgmode.org/worg/org-contrib/org-protocol.html
https://github.com/sprig/org-capture-extension/#under-windows





[BUG] org-reload reloads unnecessary files

2023-06-24 Thread Max Nikulin

Hi,

`org-reload' reloads obarray and oclosure libraries that are unrelated 
to org-babel and org-cite. I believe, the function should not do it.


Frankly speaking, I miss a public function in Emacs similar to 
`package--list-loaded-files' removed in


https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9dfd945a2c2
: 9dfd945a2c2 2021-11-07 01:28:47 +0100 dickmao: Fix byte compilation of 
package built-ins

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49708

but with it's bugs fixed. I suspect `org-reload' may have another issue 
similar to the one that `package--list-loaded-files' had. If an .el.gz 
is loaded for some reason instead of the corresponding .elc file than 
`org-reload' may fail to detect it. I have not tried to test it though.


My impression is that writing such function is tricky, so single well 
tested version should be an advantage. Unfortunately the closest 
function in the current package.el requires a package description 
instead of a directory.


The context of this bug report is
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62762#284
Re: bug#62762: 'make' often errors with "Org version mismatch" Fri, 23 
Jun 2023 12:02:47 +





Re: [PATCH] org-capture.el: Allow `(here)' as a template

2023-06-24 Thread Ihor Radchenko
No Wayman  writes:

>>> Interesting. I'm only able to reproduce it some of the time.
>>> I'll look into it more when I have time, but it may have been 
>>> an 
>>> artifact of my Emacs session.
>>
>> I saw
>> Was it the same for you?
>
> Yes, that's the same error. (Sorry, looks like an intermediate 
> message of mine got dropped)

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=94c2c8d92

The error was only triggered when debug-on-error is non-nil.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] org-babel-tangle: Header arg `:comments org' produces no comment in the output [9.7-pre (release_9.6.6-418-g294a4d @ /home/nick/src/emacs/org/org-mode/lisp/)]

2023-06-24 Thread Ihor Radchenko
Nick Dokos  writes:

> A couple of nits: maybe the comment that `org-back-to-heading' sets match
> data should be deleted?  And there is a typo in the initial comment of
> the test you added (thanks for adding it!): `:commends org' should be
> `:comments org'.

Thanks!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f56ca5009

> Also, I found a couple of places in the code where `org-back-to-heading' is 
> called
> and then match data are used. I don't know if there is a problem or not, but 
> it might
> be worth double checking to make sure that the usage makes sense:
>
> - org.el: l.20792 in `org-forward-heading-same-level'
> - org-mouse.el: l.976 in `org-mouse-transform-to-outline'

Right.
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=57bb9cada
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0a842cc94

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] org-reload reloads unnecessary files

2023-06-24 Thread Ihor Radchenko
Max Nikulin  writes:

> `org-reload' reloads obarray and oclosure libraries that are unrelated 
> to org-babel and org-cite. I believe, the function should not do it.

Confirmed. The regexp used to match Org libraries is too inclusive.

> ... I suspect `org-reload' may have another issue 
> similar to the one that `package--list-loaded-files' had. If an .el.gz 
> is loaded for some reason instead of the corresponding .elc file than 
> `org-reload' may fail to detect it. I have not tried to test it though.

It should not, by accident.

(feats (delete-dups
 (mapcar 'file-name-sans-extension
 (mapcar 'file-name-nondirectory
 (delq nil
   (mapcar 'feature-file
   features))

`file-name-sans-extension' only strips the last extension in .el.gz.
Yet, (org-load-noerror-mustsuffix "foo.el") works the same way as
(org-load-noerror-mustsuffix "foo") when we pass UNCOMPILED argument to
`org-reload'.

We should still fix the case when the loaded file is ".el.gz" though.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to export to the simplest possible HTML?

2023-06-24 Thread Marcin Borkowski


On 2023-06-10, at 10:25, Thomas Redelberger  wrote:

> Dear Marcin and everybody,
>
> I had a similar requirement for "simplest HTML" and have documented (incl. 
> source code) how I tackled this under
>  http://web222.webclient5.de/doc/swdev/emacs/orgmode/html
>
> In summary, my solution is
> - a few settings in init.el:
>   + org-html-text-markup-alist similar to below
>   + setting org-export-allow-bind-keywords to t
> - setting quite some org variables in-buffer/in the org file
> - elisp to steer a final XSLT transformation of the generated HTML
>
>
> I had coded a derived HTML export back-end (for Emacs 25.1) and used it quite 
> for some time.
> When I moved to Emacs 27.2, the derived back-end did not work any more, hence 
> I changed to above approach.

Thanks.

I settled for a custom (very simple) derived exporter and
`org-export-as` with `body-only' set to `t' (and I wrap the generated
HTML in tags like `' and `' myself then).

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: How to export to the simplest possible HTML?

2023-06-24 Thread Marcin Borkowski


On 2023-06-03, at 10:37, Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>
>>> You can loop over links in the exported subtree and export any extra if
>>> necessary. For example, in the `org-export-filter-parse-tree-functions'.
>>
>> Interesting.  The main problem with it is that the docstring is rather
>> concise and I don't understand it well enough to use it.
>
> Org export passes the actual parsed and filtered AST that will be
> exported to `org-export-filter-parse-tree-functions'. You can modify and
> traverse the parse tree as you need.

Yeah, that I do understand.  Problem is, I don't know how the AST is
structured, what functions operate on it etc.  I am aware that I could
learn all of that from the source and experimenting, but it would
probably be a bit time-consuming, and other ways turned out to be much
easier (which means better for me – I want something simple).

As an aside, inspecting deeply nested structures in Elisp seems a pain
in the neck.  Does anyone know a good method of interactively inspecting
them?  My usual approach (Edebug) is next to useless when the value
displayed in the minibuffer is a deeply nested list with dozens or
hundreds of elements at different levels...

TIA,

-- 
Marcin Borkowski
http://mbork.pl



Re: How to export to the simplest possible HTML?

2023-06-24 Thread Ihor Radchenko
Marcin Borkowski  writes:

>> Org export passes the actual parsed and filtered AST that will be
>> exported to `org-export-filter-parse-tree-functions'. You can modify and
>> traverse the parse tree as you need.
>
> Yeah, that I do understand.  Problem is, I don't know how the AST is
> structured, what functions operate on it etc.  I am aware that I could
> learn all of that from the source and experimenting, but it would
> probably be a bit time-consuming, and other ways turned out to be much
> easier (which means better for me – I want something simple).

I tried to provide a summary in my recent patch.
https://list.orgmode.org/874jnudps5.fsf@localhost/3-a.txt
You can also refer to https://orgmode.org/worg/dev/org-element-api.html

> As an aside, inspecting deeply nested structures in Elisp seems a pain
> in the neck.  Does anyone know a good method of interactively inspecting
> them?

https://github.com/mmontone/emacs-inspector

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to export to the simplest possible HTML?

2023-06-24 Thread Marcin Borkowski


On 2023-06-24, at 15:34, Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>
>>> Org export passes the actual parsed and filtered AST that will be
>>> exported to `org-export-filter-parse-tree-functions'. You can modify and
>>> traverse the parse tree as you need.
>>
>> Yeah, that I do understand.  Problem is, I don't know how the AST is
>> structured, what functions operate on it etc.  I am aware that I could
>> learn all of that from the source and experimenting, but it would
>> probably be a bit time-consuming, and other ways turned out to be much
>> easier (which means better for me – I want something simple).
>
> I tried to provide a summary in my recent patch.
> https://list.orgmode.org/874jnudps5.fsf@localhost/3-a.txt

Thanks, this looks interesting, I'll take a look!

> You can also refer to
> https://orgmode.org/worg/dev/org-element-api.html

This one I know, of course, but it's a bit more high-level, I think.
>
>> As an aside, inspecting deeply nested structures in Elisp seems a pain
>> in the neck.  Does anyone know a good method of interactively inspecting
>> them?
>
> https://github.com/mmontone/emacs-inspector

Wow, this looks _great_!!!  I'll install it and try it out!

Thanks,

-- 
Marcin Borkowski
http://mbork.pl



Re: How to export to the simplest possible HTML?

2023-06-24 Thread Max Nikulin

On 08/06/2023 22:18, Thomas Redelberger wrote:


I had a similar requirement for "simplest HTML" and have documented how 
I tackled this under

  http://web222.webclient5.de/doc/swdev/emacs/orgmode/html


At this page:


#+BIND: org-html-viewport nil

I do not need viewport information in the HTML. 


From my point of view it sounds strange. I do not see a real reason to 
intentionally make a site inconvenient for users of mobile devices.


Marcin, viewport is missed on your site as well.