Coder Social home page Coder Social logo

Comments (7)

xenodium avatar xenodium commented on August 27, 2024

In this case I enter <src to create a src code block but company-org-block takes me to the body of the block

In these instances, do you choose any language offered?

company-org-block started a completing-read session in this case to ask the user the type of code block their creating.

I'm guessing we mean read-string instead of completion-read? The latter would imply we already know about the options (including the one the user needs)?

Remembered this decision so later attempts to create the same code block aren't as indirect.

I'm thinking users may be better off adding the language to babel? company-org-block relies purely on babel itself to deduce known languages but also what major mode to invoke when editing.

Thoughts?

I'm wondering if these cases are so infrequent that it's ok for the additional steps? If they are very frequent, they may be signalling that the user should setup the language in babel?

from company-org-block.

mohkale avatar mohkale commented on August 27, 2024

In these instances, do you choose any language offered?

I was under the impression company-org-block could remember the language I choose. So first time round it doesn't offer me SQL as a completion choice but next time it'll remember I chose it and let me insert it again quickly.

I'm guessing we mean read-string instead of completion-read?

I did mean completing-read as in completing-read the languages org-mode knows and the ones I entered previously through the same interface. Maybe that's unecessary if company-org-block can offer the language (I added previously through read-string) through company in which case completing-read would be redundant.

I'm wondering if these cases are so infrequent that it's ok for the additional steps? If they are very frequent, they may be signalling that the user should setup the language in babel?

I suppose that is an option. It's just babel is really large and I believe any languages you configure through org-babel-do-load-languages are immediately loaded by babel.

from company-org-block.

xenodium avatar xenodium commented on August 27, 2024

Thanks for clarifying. Couple more questions...

I was under the impression company-org-block could remember the language I choose.

Do you mean a language you chose from the company dropdown or one that was previously typed without completion after #+begin_src?

It's just babel is really large and I believe any languages you configure through org-babel-do-load-languages are immediately loaded by babel.

If users are writing a babel block for a language, I'm thinking they do want babel to load it though? Specially to be able to execute it?

from company-org-block.

mohkale avatar mohkale commented on August 27, 2024

Do you mean a language you chose from the company dropdown or one that was previously typed without completion after #+begin_src?

With completion assuming we implement this feature. So I type <src and that expends to a src code block with no language, then company-org-block asks me which language it should be, say SQL, then next time I try to insert <sql company-org-block offers it as well through company.

If users are writing a babel block for a language, I'm thinking they do want babel to load it though? Specially to be able to execute it?

Personally I only ever do that with emacs-lisp. But yeah in that case I suppose it makes sense.

from company-org-block.

xenodium avatar xenodium commented on August 27, 2024

Sorry for the delay. Made a small change that brings things closer to the suggestion... Give 99ccc01 a go,

Try it out with <srRET, you're then asked for a language. Next time you're asked, try C-r in the prompt to narrow complete history.

from company-org-block.

mohkale avatar mohkale commented on August 27, 2024

@xenodium

Yep. Works great. I believe prompts for interactive completion should be capitalised so shouldn't it be Language:?

from company-org-block.

xenodium avatar xenodium commented on August 27, 2024

Yup. Done 115af0a. Thanks!

from company-org-block.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.