Giter Club home page Giter Club logo

Comments (4)

plexus avatar plexus commented on July 17, 2024

I think there's some confusion here about what signals are exactly, and what the point is of corkey.

Signals are a corkey-specific concept. They're a level of indirection, in this case instead of saying in the keys file: ", l p is bound to sesman-link-with-project", we say "what , l p does conceptually is link to a repl on the project level (:link-repl/project). This is just a symbol that we pick. Then in the bindings file we say: "when in cider-mode, to link to a repl on the project level is done with sesman-link-with-project".

This achieves two things, it means that we can have a mnemonic like SPC t w (toggle writable), or , e e (eval) which "just works", no matter which mode you're in. So in most buffers it'll toggle read-only-mode, but in dired buffers it toggles wdired-mode, because that's what making a dired buffer writable means. So you get consistency, you have to memorize fewer distinct bindings, your knowledge transfers.

The second thing this achieves is being able to rebind keys, e.g. maybe I want to use M-RET to eval, so I can add that to my user-keys file, and this binding will now be able to eval forms in any language we support. Depending on the mode it could be calling eval-last-sexp, cider-eval-last-sexp, geiser-eval-last-sexp, and so forth.

To really understand the motivation you can look at Spacemacs. Spacemacs tries to achieve a certain degree of consistency in key bindings, but they do this by adding and maintaining separate bindings for each mode. The result is that they're all slightly different and drifting apart, and if you want to use a different key for something you need to add bindings in your own config for every single mode where you want to use it.

The idea has also always been that this allows providing completely new keys files, e.g. you could create a keys file with Calva style mappings. Say that in that keys file it says ("C-f" :buffer/incremental-search), and in your user-signals file you have (:buffer/incremental-search <some-fancy-search-package>), now you can install that calva-style keys file, and still get your preferred commands.

from corgi.

theophilusx avatar theophilusx commented on July 17, 2024

Maybe I'm being a bit slow and am missing some of the subtitles or perhaps I'm just not being clear/concise, but what you wrote seems to mirror what I think my understanding of corkey is.

My main uncertainty was with definitions like

("p" "Link with project" :link-repl/project sesman-link-with-project)

in the corgi-keys.el file and

:link-repl/project sesman-link-with-project

in the corgi-signals.el file. I would have expected the corgi-keys.el file to just have

("p" "Link with project" :link-repl/project)
The grammar explanation also seems to say that a target is either a signal or a command and that a signal is a keyword. The definition in the corgi-keys.el file seems to be a keyword and a command?

from corgi.

plexus avatar plexus commented on July 17, 2024

Oh sorry I missed that part. That's definitely a mistake, the keys file in this case should only contain the signal keyword.

from corgi.

theophilusx avatar theophilusx commented on July 17, 2024

OK, thanks that clarifies things for me. I'll focus on my clojure project for the next few days until the chrun from the move to emacs-corgi settles down (it was getting my clojure dev setup tweaked which brought me to corgi in the first place, so I need to make sure I'm not getting distracted from the main goal 😄 ).

from corgi.

Related Issues (20)

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.