automatically disable a global minor mode for a specific major mode

Global minor modes created with the define-globalized-minor-mode1 macro are a bit tricky. The reason your code doesn’t appear to do anything is that globalized modes utilise after-change-major-mode-hook to activate the buffer-local minor mode that they control; and that hook runs immediately after the major mode’s own hooks4. Individual modes may implement custom ways of specifying … Read more

Emacs: Symbol’s value as variable is void

What this means is that, at the point at which you invoke define-key, c-mode-base-map is not yet defined by anything. The usual fix is to find out where this is defined and require that module. In this case: (require ‘cc-mode) However there are other possible fixes as well, for example setting the key-binding in a … Read more

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

tech