Skip to content
[unmaintained] Prettifies your code by removing needless clutter
Emacs Lisp
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.hgignore
COPYING
README.md
parfait-mode.el

README.md

Parfait-mode

Brings delicious sweetness to your source code by removing the needless (visual) clutter.

That is, instead of:

function make_array(size, default_value) { var result, has_defaultp
    size         = (__max(size, 0)) >>> 0
    has_defaultp = arguments.length > 1
    if (size <= 0)  return []

    result = Array(size).join('0').split('0')
    return has_defaultp?  result.map(function(){ return default_value })
                       :  result
}

You could have:

λ make-array(size, default-value) { var result, has-defaultp
   size         = (__max(size, 0)) >>> 0
   has-defaultp = arguments.length > 1
   if (size <= 0) ⇐ []

   result = Array(size).join('0').split('0')
   ⇐ has-defaultp?  result.map(λ(){ ⇐ default-value })
   :                 result }

Installing

In your shell:

$ cd ~/.emacs.d/vendor
$ git clone git://github.com/killdream/parfait-mode

In your emacs config:

(add-to-list 'load-path "/path/to/parfait-mode")
(require 'parfait-mode)

;; Add your own character mappings. This is the one I use:
(parfait-add-symbols
 '(("\\<this\\(\\.\\|\\>\\)" . "@")
   ("\\<return\\>"           . "")
   ("\\<function\\>"         . "𝝺")
   ("\\>_\\<"                . "-")
   ("<="                     . "")
   (">="                     . "")
   ("&&"                     . "")
   ("||"                     . "")))

In your buffer:

M-x parfait-mode 

Or add it to a major mode hook:

(add-hook 'js3-mode-hook 'parfait-mode)

Acknowledgements

The code is an improvement on `lambda-mode' by Mark Triggs mst@dishevelled.net, so most of the code is the same, I just hacked it to work with lotsa symbols at the same time :3

Licence

GPL'd. See COPYING for less information.

You can’t perform that action at this time.