Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global access to all available REPLs #4600

Closed
wants to merge 1 commit into from
Closed

Add global access to all available REPLs #4600

wants to merge 1 commit into from

Conversation

AlejandroCatalina
Copy link
Contributor

Enable a global binding to access a list of available REPLs to run everywhere. If the requested REPL depends on a major-mode that hasn't been loaded, it will be loaded along its dependencies. The global binding is under SPC a R.

To make this work, a new spacemacs/register-repl function is included. This function adds a major-mode and its repl function to a global variable.

Further work, such as add every layer REPL to this list is due to be completed after this PR is eviewed, to avoid silly work.

Address #3395

@@ -11,6 +11,8 @@

(defvar configuration-layer--protected-packages)
(defvar dotspacemacs-filepath)
(defvar spacemacs-repl-list '()
"Registered REPLs to run from ~SPC a r~.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the mention to the key binding.

"List of all registered REPLs" is sufficient

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, done.

@AlejandroCatalina
Copy link
Contributor Author

What about SPC a C-r. If I didn't misunderstood, the key-binding order was from minus-mayus-Control-Control Shift.

@StreakyCobra
Copy link
Contributor

What about SPC up up down down left right left right B A 😉

More seriously:

SPC a i r for application i nteractive repl
SPC a i prefix can be set to "irc/interactive"

but we need the opinion of other people anyway I think.

@AlejandroCatalina
Copy link
Contributor Author

That sounds good and mnemonic. Let some other people show their opinion :P.

Btw, how to set a prefix binding?

@StreakyCobra
Copy link
Contributor

(setq spacemacs/key-binding-prefixes '(("a" "applications")
("ai" "irc")
("as" "shells")
("b" "buffers")
("bm" "move")
("c" "compile/comments")
("C" "capture/colors")
("e" "errors")
("f" "files")
("fC" "files/convert")
("fe" "emacs(spacemacs)")
("fv" "variables")
("g" "git/versions-control")
("h" "help")
("hd" "help-describe")
("i" "insertion")
("j" "jump/join/split")
("k" "lisp")
("kd" "delete")
("kD" "delete-backward")
("k`" "hybrid")
("n" "narrow/numbers")
("p" "projects")
("p$" "projects/shell")
("q" "quit")
("r" "registers/rings/resume")
("Re" "elisp")
("Rp" "pcre")
("s" "search/symbol")
("sa" "ag")
("sg" "grep")
("sk" "ack")
("st" "pt")
("sw" "web")
("t" "toggles")
("tC" "colors")
("tE" "editing-styles")
("th" "highlight")
("tm" "modeline")
("T" "UI toggles/themes")
("C-t" "other toggles")
("w" "windows")
("wp" "popup")
("x" "text")
("xa" "align")
("xd" "delete")
("xg" "google-translate")
("xl" "lines")
("xm" "move")
("xt" "transpose")
("xw" "words")
("z" "zoom")))

@StreakyCobra
Copy link
Contributor

or (spacemacs/declare-prefix "oi" "insert")

@AlejandroCatalina
Copy link
Contributor Author

I see, when other people show themselves we'll add it. So far, SPC a i r looks right to me.

@jmiven
Copy link
Contributor

jmiven commented Jan 13, 2016

SPC a i r is also already occupied by rcirc! 😉
https://github.com/syl20bnr/spacemacs/blob/develop/layers/+irc/rcirc/packages.el#L68

@AlejandroCatalina
Copy link
Contributor Author

Oh god, SPC a i R seems to be free, anyone who breaks that one too? 😂

@StreakyCobra
Copy link
Contributor

SPC a i r is also already occupied by rcirc!

Oh, I shouldn't have been on the correct project when I searched for it 😔

@AlejandroCatalina
Copy link
Contributor Author

Are we okay with SPC a i R?

@syl20bnr
Copy link
Owner

I have to think about it, SPC a i R looks fine for a first binding.

@AlejandroCatalina
Copy link
Contributor Author

I'll add it tomorrow then ;).

@AlejandroCatalina
Copy link
Contributor Author

If this is okay as it is, i'll rebase it.

Enable a global binding to access a list of available REPLs to run
everywhere. If the requested REPL depends on a major-mode that hasn't
been loaded, it will be loaded along its dependencies.

To make this work, a new `spacemacs/register-repl` function is included.
This function adds a major-mode and its repl function to a global
variable.
@AlejandroCatalina
Copy link
Contributor Author

Everything rebased and ready to go!

@TheBB
Copy link
Collaborator

TheBB commented Jan 22, 2016

Thanks! Cherry-picked in develop. You can safely delete your branch.

I cleaned your code up a bit in e8a10c3. In particular, calling a major mode function is a poor way of loading a file, just call require instead. I also used call-interactively instead of funcall.

In bedf807 I fixed the ielm code (which wasn't up to scratch) and registered it as a REPL, and I also did the shells in 44fd52d.

That's a good start.

@TheBB TheBB closed this Jan 22, 2016
@TheBB
Copy link
Collaborator

TheBB commented Jan 22, 2016

Oh, and I changed the binding to SPC a '. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants