Code Monkey home page Code Monkey logo

Comments (9)

jtmoulia avatar jtmoulia commented on July 22, 2024

Reading further:

Sequences consisting of C-c followed by a control character or a digit are reserved for major modes.

C-c C-a is undefined in vanilla Emacs...

from alchemist.el.

andreas-roehler avatar andreas-roehler commented on July 22, 2024

At stake here are setting like that:

(define-key map (kbd "C-c a t") 'alchemist-mix-test)

i.e C-c followed by a letter.

from alchemist.el.

jtmoulia avatar jtmoulia commented on July 22, 2024

I'd be curious what others think, but the manual's opinion is clear:

Please comply with it.

But, it is rough to change keybindings. Does having a user called function which sets up the C-c a prefix comply with it?

from alchemist.el.

andreas-roehler avatar andreas-roehler commented on July 22, 2024

Beside the bug, changing the bindings seems to pay WRT to efficiency.
As the bindings are mode-specific, could use for example the one below, which are in fact just two-key sequences against three keys now.

    (define-key map [(control c)(control p)] 'beginning-of-statement)
    (define-key map [(control c)(control n)] 'end-of-statement)
    (define-key map [(control c)(control u)] 'beginning-of-block)
    (define-key map [(control c)(control q)] 'end-of-block)
    (define-key map [(control meta a)] 'beginning-of-def-or-class)
    (define-key map [(control meta e)] 'end-of-def-or-class)

from alchemist.el.

rranelli avatar rranelli commented on July 22, 2024

The approach taken by neotree is to use a custom variable for defining the desired keybinding scheme. The user has the option for using a concise or a verbose set up.

You can see how this is achieved in here:
(https://github.com/jaypei/emacs-neotree/blob/dev/neotree.el#L221)
(https://github.com/jaypei/emacs-neotree/blob/dev/neotree.el#L409)

I think this is a good approach. I personally would not use the C-c C-* keys myself. I really prefer the C-c [minor mode key] "convention".

from alchemist.el.

jtmoulia avatar jtmoulia commented on July 22, 2024

Thanks @rranelli -- makes sense!

Two questions:

  1. Will the default change from C-c a, as the manual recommends?
  2. Is it better to have a concise vs verbose setup, or allow the user to specify the alchemist key prefix?

That being said, it looks like there are two bindings which don't use the common prefix. The manual has much less to say re keybinding conventions for M-*.

from alchemist.el.

rranelli avatar rranelli commented on July 22, 2024

I think that *definition-at-point (not so sure about *jump-back, never used it myself in other modes) is pretty standard for all modes, so I think we should not be concerned with it.

Modes that provide language/context sensitive navigation tend to use the M-. key. Examples of this are emacs-lisp-mode with find-function-at-point, Robe for Ruby and Haskell mode.

from alchemist.el.

rranelli avatar rranelli commented on July 22, 2024

I think that adding a key prefix for alchemist-mode-map is something called for, whether or not we decide for something like a concise vs verbose option.

I don't know what to do about the first question. I have very little regard for defaults and recommendations, haha.

from alchemist.el.

jtmoulia avatar jtmoulia commented on July 22, 2024

awesome, sounds good to me.

I'm trying to think of not so shocking ways to change the prefix -- it'd be nice if there was a way to not change the keybindings if someone is upgrading vs installing it new.

Maybe support both prefixes for a certain number of releases, with an annoying message if the C-c a prefix is being used without it being explicitly set as the alchemist prefix.

from alchemist.el.

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.