Sublime Forum

Compose-region

#1

Emacs has a method called compose region that can repose any string of characters with another unicode symbol. This can be used for pretty printing modes and all sort of other powerful visual candy.

I would love to see sublime support a mode specific feature like this.

0 Likes

#2

Can you give an example of what this compose region can do for those of us who have never used emacs before ?

0 Likes

#3

Repose? Did you mean replace? When does it replace?

0 Likes

#4

He means that when he types for example [alpha] sublime Text would convert that to ᾱ or the correct Alpha character.

0 Likes

#5

That sounds like snippets, depending on exactly how it works. I don’t know if you could want anything more than snippets. Automatic replacement would be error prone.

0 Likes

#6

Compose-region is like an alias. (Yes i did mean replace) the editor displays the unicode character instead of the text. This can be used for a lot of different things.

Some of the functional languages (for instance) have modes that display a lambda chatacter instead of the lambda keyword. Some extensions go really all out. prettify buffer for instace offers a programming experience with some pretty fantastic symbol replacement. I have enjoyed it greatly. Some latex and other doc writing modes use it for displaying formulas in a more readable (friendly) fashion.

In my case i would like it for a set of orgmode plugins i am working on. One feature to start (org bullets) that can pretty up an orgmode buffer with nice looking (and different) bullets for each level of indentation. It is a very nice extension.

IMHO sublime is a superior application, its performance, even on windows platforms, is what draws me to it, its just missing org mode and the org related tooling. I figured i would work to extend the existing orgmode plugin i found on package control. I have a capture feature and refile functional and am looking into some of the navigation and ease of use bindings but am sorely missing some of the minor visual pizazz of extensions like org bullets. I figured it wouldnt hurt to ask for a means of implementing it. There may be other ways to achieve this, i just cant think of anything that wouldnt tank on a larger file (performance wise)

0 Likes

#7

Note. The editor treats the replacement as if it is still the full string, backspace into the symbol will simply delete the last character in the replaced string usually swapping back to the now partial text. It is just visual sugar to improve the clarity and look of some more symbol heavy modes. It started as font-lock hacks in emacs and eventually became something they supported natively for performance reasons. (I believe)

0 Likes