@ed1conf@bsd.network on Mastodon: "Where are you going?" with an image of an edited hoarding asking if the rwser is going to haven or Emacs with a phone number to some Christian organisation.
you are viewing a single comment's thread
view the rest of the comments
[โ€“] 6 points 1 year ago (3 children)

At the risk of invoking the ire of two communities, why shouldn't we think of Micro as Emacs but with Lua instead of Lisp?

  • source
  • parent
  • hideshow 3 child comments
  • [โ€“] 3 points 1 year ago (2 children)

    I don't know how Micro works, and I don't actually use emacs day to day, but as I understand it emacs works a bit like:

    • When you press a key in emacs it invokes a Lisp function that takes as arguments the text buffer that has focus, the parameters of the 'window' into that buffer, and the cursor position in that window.
    • This is the case for any key you press in any context, even for typing normal letters.
    • A 'mode' in emacs is a set of bindings which associate specific keys with specific functions.
    • '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?)
    • All of the editor's functionality, such as 'search' or 'undo', is implemented in that way.
    • All of this is completely customizable, so pressing a key combo can be made to do virtually anything or manipulate the rest of the editor's systems in any way.

    Does Micro work anything like that?

  • source
  • parent
  • hideshow 2 child comments
  • [โ€“] [S] 3 points 1 year ago* (1 child)

    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'.

  • source
  • parent
  • hideshow 1 child comment