aaron-em/rcirc-styles.el

Preview colors and attributes before input is sent

Closed this issue · 2 comments

Instead of text ^Bthat looks ^C3,0like this, it'd be nice to see styles applied to input while it's still input, so it's obvious how text will appear once sent.

This may be infeasible because of the user interface issues involved. Specifically, how best to provide for editing of color codes once inserted, since they don't appear once the text is propertized?

  • Possibly a command to toggle between propertized and literal input, so that it can be edited as literal and previewed with properties?

A/C:

  • The user can preview color and attribute styles applied to input text before sending it.
  • The user can fluently edit color and attribute codes in input text.

Underway in feature/#5. Not yet covered by unit tests and as of this writing perhaps not entirely ready for prime time, but it's there and should work, more or less, if you want to try it out. The key sequence that toggles previewing is C-c C-s C-p; you can't edit while previewing, because that seems to lead to potentially enormous UI complexity, but you can toggle between preview and edit at will.

So it looks like rcirc-mode-map does actually include a binding for C-c C-s by default, which means I'm overriding it and didn't want to. I'm going to chop the binding to rcirc-mode-map out of this and #4 for the moment, and do a proper job of customization support in a separate issue.

In the meantime, you can manually hang rcirc-styles-map off whatever prefix you like:

(define-key rcirc-mode-map (kbd "WHATEVER-PREFIX") rcirc-styles-map)