Coder Social home page Coder Social logo

speed-of-thought-lisp's Introduction

speed-of-thought-lisp

Write emacs-lisp at the speed of thought.

This defines a new global minor-mode speed-of-thought-mode, which activates locally on any supported buffer. Currently, only emacs-lisp-mode buffers are supported.

The mode is quite simple, and is composed of two parts:

Abbrevs

A large number of abbrevs which expand function initials to their name. A few examples:

  • wcb -> with-current-buffer
  • i -> insert
  • r -> require '
  • a -> and

However, these are defined in a way such that they ONLY expand in a place where you would use a function, so hitting SPC after (r expands to (require ', but hitting SPC after (delete-region r will NOT expand the r, because that's obviously not a function. Furtheromre, #'r will expand to #'require (note how it ommits that extra quote, since it would be useless here).

Commands

It also defines 4 commands, which really fit into this "follow the thought-flow" way of writing. The bindings are as follows, I understand these don't fully adhere to conventions, and I'd appreaciate suggestions on better bindings.

  • M-RET :: Break line, and insert "()" with point in the middle.
  • C-RET :: Do `forward-up-list', then do M-RET.

Hitting RET followed by a `(' was one of the most common key sequences for me while writing elisp, so giving it a quick-to-hit key was a significant improvement.

  • C-c f :: Find function under point. If it is not defined, create a definition for it below the current function and leave point inside.
  • C-c v :: Same, but for variable.

With these commands, you just write your code as you think of it. Once you hit a "stop-point" of sorts in your tought flow, you hit C-c f/v on any undefined functions/variables, write their definitions, and hit C-u C-SPC to go back to the main function.

Small Example

With the above (assuming you use something like paredit or electric-pair-mode), if you write:

( w t b M-RET i SPC text

You get

(with-temp-buffer (insert text))

speed-of-thought-lisp's People

Contributors

malabarba avatar abo-abo avatar

Stargazers

Théo Tyburn avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.