Fork me on GitHub
eccentric J04:07:33

Does this finite-state-machine diagram accurately model a spacemacs-like menu? I’m working on a program that has a similar mnemonic menu while also learning state machines. Figured this would be the best place to ask 😅


looks right I think, but it’s hard to tell without Submenu. So in what state the Previous (main menu) would be when Sebmenu activates?


Spacehammer currently keeps the main modal active even when you are in a sub-modal, which is not right. e.g. when you press Cmd+SPC then m - it opens Multimedia modal, but Main modal keys are still active, you still can press w and jump to Windows modal - this isn’t right


I’ve been thinking about rewriting it, but I’ve been pretty swamped on my full-time job

eccentric J04:07:56 it is crudely solved in my solution. I create a new hs.hotkey.modal every time a menu is activated. Upon activating a new modal, it clears bindings before setting new ones by deleting the hotkey modal. It seems to work pretty well, even got the repeatable: true flag in the top config working so things like volume can be repeated. In terms of an FSM I think it would be about responding slightly differently when transitioning to active while already active

eccentric J05:07:32

It stores a list of active paths in the state atom

eccentric J05:07:25

So like [:w :m] would look up the menus for window bound to :w, then the submenu move bound to :m

eccentric J05:07:48

It’s kind of a good thing you did not get a chance to write it. A coworker wants to use a FSM to solve a problem at work and up until the past two days, I didn’t know much about them. I would not be able to help design it or even review it. This project is a great opportunity for me to learn how to implement one on my own given your pretty solid framework 😁

eccentric J15:07:36

Oof I am interested in using this package with spacemacs but I’m not sure how to add it. I don’t think it’s on MELPA which means I have to clone it somewhere?


Fennel-mode is on MELPA

eccentric J16:07:00

Oh! Sorry about that, I was looking at the readme instructions. I’ll just wrap it in a spacemacs layer then. Thanks!

eccentric J16:07:23

Hah wow wrapping it in a layer was ridiculously easy.


you may wanna do something like this:

(use-package fennel-mode
    (autoload 'clojure-align "clojure-mode" nil t)

eccentric J17:07:07

Thanks, I’ll try that out


Hey folks! Anyone know a good way to hard-wrap an HTML document in SM? fill-region results in ugly (but presumably valid) line breaks, eg between a and href. Any option that's a bit more sensitive to the HTML-ness of the buffer?


I think web-mode should handle HTML properly on M-q


it’s been ages since the last time I used it, but I think that what it does


Hmm, still doesn't do very well for me. eg doing M-q on a single (very long line) leaves me with (excerpt)

<p>If you've moved or changed your name, please update your voter registration.
  We can help you get started at <a
  href="https://{{recipient.hostname}}/">{{recipient.hostname}}</a>. Once that's
  done, you should <a
Again, presumably valid, but pretty unpleasant for the reader. That said, this is using the hbs wrapper around handlebars, so it may not be recognized as a valid template file. Does say it's in web-mode, though. As a sanity check (since I'm evil-mode), I've got M-q bound to fill-paragraph. I assume it's the same for you?


yeah, M-q is Emacs’s native


Oh, no, that web-mode page does have hbs listed, so it's not that. Oh well! "Pretty" as well as valid may be asking too much 🙂


Thanks ag, I appreciate it!


> may be asking too much when it comes to Emacs, it is never too much. You just need to know/find what to tweak and where


Heh, true that 😆