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

Binding M- / M- in Emacs 23.1.1

Emacs has a complex mechanism to handle the vicissitudes of function key and modifier encodings on various terminal types. It doesn’t work out of the box in all cases. The following settings should work on your terminal: (define-key input-decode-map “\e\eOA” [(meta up)]) (define-key input-decode-map “\e\eOB” [(meta down)]) (global-set-key [(meta up)] ‘transpose-line-up) (global-set-key [(meta down)] ‘transpose-line-down) … Read more

How can I make Emacs start-up faster?

Others have covered using gnuserve and emacsclient, and I’d suggest compiling within emacs (being able to jump to compilation errors is a win). But, specifically speeding up the .emacs can be done by: Byte compiling the .emacs file, which you can do automatically by using this snippet of code Replacing as many of the (require … Read more

Open file via SSH and Sudo with Emacs

As of Emacs 24.3, an analog of the old multi: syntax has been layered on top of the modern tramp-default-proxies-alist approach, meaning that you can once again perform multi-hops without any prior configuration. For details, see: C-hig (tramp)Ad-hoc multi-hops RET With the new syntax, each ‘hop’ is separated by |. The example in the manual … Read more

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