How do I set up Aquamacs for Clojure development?

These are the steps I took to set them up without using ELPA. Hope this helps. Get SLIME using MacPorts sudo port -v install slime Get paredit curl -O http://mumble.net/~campbell/emacs/paredit.el Get clojure & clojure-contrib Either using MacPorts sudo port -v install clojure clojure-contrib Or downloading directly curl -O http://build.clojure.org/snapshots/org/clojure/clojure/1.1.0-master-SNAPSHOT/clojure-1.1.0-master-20091202.150145-1.jar curl -O http://build.clojure.org/snapshots/org/clojure/clojure-contrib/1.1.0-master-SNAPSHOT/clojure-contrib-1.1.0-master-20091212.205045-1.jar Get clojure-mode and … Read more

How do I get Emacs to fill sentences, but not paragraphs?

Here’s what I use, which was mostly cribbed from Luca de Alfaro: (defun fill-sentence () (interactive) (save-excursion (or (eq (point) (point-max)) (forward-char)) (forward-sentence -1) (indent-relative t) (let ((beg (point)) (ix (string-match “LaTeX” mode-name))) (forward-sentence) (if (and ix (equal “LaTeX” (substring mode-name ix))) (LaTeX-fill-region-as-paragraph beg (point)) (fill-region-as-paragraph beg (point)))))) I bind this to M-j with (global-set-key … Read more

Emacs: How to keep the indentation level of a very long wrapped line

The package adaptive-wrap, which can be installed via the ELPA packaging system, should do what you want. After having installed the package, just run the following commands: M-xvisual-line-modeRET (to wrap long lines) M-xadaptive-wrap-prefix-modeRET (to make wrapped lines indent nicely) I also have the following snippet in my init.el file to automatically activate adaptive-wrap-prefix-mode along with … Read more

When opening 2 files in emacs, how can I have them appear side-by-side?

Here’s a function that will change a pair of vertical windows to a pair of horizontal windows: (defun 2-windows-vertical-to-horizontal () (let ((buffers (mapcar ‘window-buffer (window-list)))) (when (= 2 (length buffers)) (delete-other-windows) (set-window-buffer (split-window-horizontally) (cadr buffers))))) To do this automatically on startup, add this function to emacs-startup-hook: (add-hook ’emacs-startup-hook ‘2-windows-vertical-to-horizontal)

How to open files in web browsers (e.g Firefox) within editors like vim or emacs?

browse-url-of-file is an interactive compiled Lisp function in `browse-url.el’. It is bound to <menu-bar> <HTML> <Load this Buffer in Browser>, C-c C-z v. (browse-url-of-file &optional file) Ask a WWW browser to display file. Display the current buffer’s file if file is nil or if called interactively. Turn the filename into a URL with function browse-url-file-url. … Read more