Hi Neil,

Nope! That’s the nice thing, those are all currently features of the LSP protocol 🙂.

All the best,
Timothy

From: Neil Jerram
Subject: Re: Emacs as an Org LSP server
To: TEC
Cc: "org-mode-email" <emacs-orgmode@gnu.org>
Date: Tue, 15 Dec 2020 01:57:27 +0800

Yes, thanks, I'm seeing the picture now.  I guess that some of those things would require extensions to the LSP standard/protocol, as well as just implementation, wouldn't they?

On Mon, 14 Dec 2020 at 17:31, TEC <tecosaur@gmail.com> wrote:

Hi Neil,

Ah, I see what you’re getting at now. I’ll try to give you an idea of what I think could apply.

  • Provide nice text manipulation actions, e.g. structural editing
  • Completion, with company
  • Org Export
  • Run Babel blocks
  • Org syntax highlighting (potentially)
  • Folding (maybe)
  • All the nice stuff like table alignment, checkbox state propagation…

Does that help?

All the best,
Timothy

From: Neil Jerram
Subject: Re: Emacs as an Org LSP server
To: TEC
Cc: "org-mode-email" <emacs-orgmode@gnu.org>
Date: Tue, 15 Dec 2020 01:22:55 +0800

I'm afraid things still aren't clear for me.  Is there a reason it's so hard to give a concrete example?

If I try to analogise from how LSP works for golang, I believe the LSP server does things like
- complete symbol beginning with "Xyz"
- tell me where so-and-so function is defined (e.g. so that the client editor can jump to it).
I'm not sure if operations like that make sense for Org.

Another possibility might be interacting, from a 3rd party editor, with a body of Org content that has been primarily written and managed in Emacs.  If so, what would those interactions be?  Marking a task as done?  Something more complex than that?

Or is it like: 3rd party editor opens an Org file and the user types some <random key sequence>.  Editor asks the LSP server (Emacs) "what does <random key sequence> mean?", and the server replies "it means the Org entry should now look like this: ..."


On Mon, 14 Dec 2020 at 15:58, TEC <tecosaur@gmail.com> wrote:

Hi Neil,

Good to hear that you did take a look at the readme 🙂.

You can think of the LSP as a specification for cross-editor/IDE extensions. The intent of this is to make some of Org’s functionality accessible to the ~95% of people who don’t use Emacs, by hooking into Emacs itself.

Does that clear things up for you? You can also see https://langserver.org/.

All the best,
Timothy

From: Neil Jerram
Subject: Re: Emacs as an Org LSP server
To: TEC
Cc: "org-mode-email" <emacs-orgmode@gnu.org>
Date: Mon, 14 Dec 2020 23:46:12 +0800

Thanks Timothy.  I did read the README, but I'm afraid I still can't quite picture a specific use.


On Mon, 14 Dec 2020 at 15:28, TEC <tecosaur@gmail.com> wrote:

Hi Neil,

I’m going to quote you the readme from the linked github repo:

Allow the unwashed masses to use Org, without using Emacs, using Emacs.

Here’s the image from the readme model.png

And here’s the first line from the first result of a google search for &ldquoLSP”:

The Language Server Protocol (LSP) defines the protocol used between an editor or IDE and a language server that provides language features like auto complete, go to definition, find all references etc.

That should give you an idea of the intent here.

All the best,
Timothy

From: Neil Jerram
Subject: Re: Emacs as an Org LSP server
To: TEC
Cc: "org-mode-email" <emacs-orgmode@gnu.org>
Date: Mon, 14 Dec 2020 19:41:05 +0800

Could you describe a use case?  Apologies if I missed this in earlier threads.


On Sun, 13 Dec 2020 at 10:44, TEC <tecosaur@gmail.com> wrote:

A little progress update.

https://github.com/tecosaur/org-lsp now exists.

I have no idea what I'm doing, so if anyone has feedback on the current
idea, that would be much appreciated.

TEC <tecosaur@gmail.com> writes:

> Hi Everyone,
>
> From the Org standardisation effort the idea of using Emacs as the basis
> of an LSP server for Org has been mentioned a few times.
>
> I thought this deserved it's own thread so here it is :)
>
> I'm quite keen to investigate the viability of this idea.
> Some key questions that I think need addressing are:
> 1. How can we 'package' Emacs into an LSP client?
> 2. Assuming we use some language as the basis for the host how do  we
>    want to pick it? LSP library? Lisp? Are there any outstanding
>    contenders.
> 3. How much effort is involved? Is it worth it to try to make Org  more
>    approachable* (without Emacs)?
>
> Lastly, but perhaps even more crucially --- who would be interested in
> working on this? I certainly am, but this feels like something that
> would be more viable with a small working group.
>
> Who's interested?
>
> Timothy.
>
>
> * I can't help but think that this hypothetical LSP server may   serve as
>  a 'gateway drug' to Org in Emacs 😉