• flamingos-cant (hopepunk arc)@feddit.ukOP
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    2 days ago

    A ‘mode’ in emacs is a set of bindings which associate specific keys with specific functions.

    Not quite, a mode is basically a lisp function defined with a different macro that integrates it into the various systems (like showing up in the modeline when active). It can do basically anything, including setting keybinds.

    ‘modes’ can be stacked on top of each other, with higher modes being able to intercept key presses before they reach lower modes, and changes / manipulate lower modes (I think?)

    No, a keybind can only run one function and what that function is is whatever last defined a binding for that key. Like, if one mode defines a key to be something and you activate another that also binds that key, the latter takes over.

    Emacs does have something like you describe, where functions can be ‘advised’.