Copy Sexp at Mouse Position to Point

Via Wilfred Hughes, I found this old post to the gnu-emacs-sources mailing list giving a quick and dirty implementation of an old Lisp Machine trick: copying a sexp that the mouse is pointing at to the position at point. Vladimir Sedach took that code and fleshed it out to a more complete implementation.

If you work with some version of a Lisp language this may be a useful addition to your toolkit. Yes, it forces you to use your mouse, which many Emacsers are loathe to do, but only in a minimal way. As Sedach says, this is often faster than repositioning the point to copy the sexp. That’s especially true if the sexp is in another window. Sedach’s method works across windows so it’s easy to copy a sexp from, say, another file as long as it’s currently displayed in Emacs.

This bit of functionality comes from the Lisp Machine so folks earning their living writing Lisp code found it worthwhile. Granted, the Lisp Machine was more mouse centered than Emacs tends to be but this seems worthwhile enough to make an exception. After all, it’s not like we’re going to be using it several times a minute.

The code does not appear to be available as an ELPA package so you’ll have to get it yourself from GitHub.

This entry was posted in General and tagged . Bookmark the permalink.