drothlis / pretty-symbols

Emacs minor mode for drawing multi-character tokens as Unicode glyphs (lambda -> λ). A configurable replacement for pretty-mode and the like.
42 stars 5 forks source link

Support specifying the match index to replace. #7

Closed tobias closed 11 years ago

tobias commented 11 years ago

This allows for replacing only a portion of the regex, which is lets you replace a character only when it is followed by another specific character. For example, #() defines a lambda in Clojure. but I don't want to replace every #. With this patch, the following works:

(add-to-list 'pretty-symbol-patterns
         '(?λ lambda "\\(#\\)(" (clojure-mode) 1))
drothlis commented 11 years ago

Merged. Thanks!