Questions tagged [dot-emacs]

.emacs (dot-emacs where the initial period causes problems) is the name of the main configuration file of the emacs text editor.

.emacs (dot-emacs when the initial period causes problems) is the name of the main configuration, initialization, and customization file of the GNU text editor. In absence of .emacs GNU Emacs version 23 and higher uses .emacs.d/init.el as initialization file.

The contents of the Emacs initialization file is read and execute by Emacs at startup, and changing it is the most common way of customizing an Emacs environment. The configuration and customization directives in the .emacs file frequently invoke further packages so that the main file doesn't become impractically long: these are conventionally stored in the .emacs.d directory. In addition to hand-editing the file, changes to it can be made with emacs' M-x customize facility.

See also:

218 questions
5
votes
2 answers

Result value of elisp code stored in a file?

Looking for a way how evaluate elisp code stored in an external file and pass its result as a function argument. Example demonstrating what I'd like to achieve follows: ;; content of my_template.el '(this is a list) ;; content of .emacs where…
David Unric
  • 7,421
  • 1
  • 37
  • 65
5
votes
1 answer

How do you get emacs to recognize .m files as Matlab files, not objective-C files?

My .emacs file concerning Matlab is as follows: ;; Matlab mode (autoload 'matlab-mode "matlab" "Matlab Editing Mode" t) (setq matlab-indent-function t) (setq matlab-shell-command "matlab") But when I open a Matlab file, I see I'm in Objective-C…
xiaolingxiao
  • 4,793
  • 5
  • 41
  • 88
5
votes
1 answer

Define key when buffer is read-only

I'm trying to use the keys "n" and "p" the same way as "C-n" and "C-p" when my buffer is read-only (yes, I'm lazy). I use this code in my .emacs file : (when buffer-read-only (local-set-key "n" 'next-line)) (when buffer-read-only (local-set-key "p"…
5
votes
2 answers

Font-locking for SQL-MODE inside of ORG-MODE not font-locking

Related to question: org-mode: fontify code blocks natively I've got the latest org-mode and emacs versions as of November 1, 2012 (org stored in org-20121105). I've also got the sql-mode that comes with emacs-24. I've got fontification turned…
justingordon
  • 12,553
  • 12
  • 72
  • 116
4
votes
4 answers

Alias to make emacs open a file in a new buffer (NOT frame) and be activated/come to front?

What I have so far is alias em="open -a /Applications/Emacs.app "$@" && osascript -e 'tell application "Emacs.app" to activate'" But I am stumped. With that code, em file.txt will activate, but won't open the file. And I get '22:23: syntax error:…
tobeannounced
  • 1,999
  • 1
  • 20
  • 30
4
votes
2 answers

How can one specify a user's emacs init file to load with emacsclient?

Question How can one specify a user's emacs init file to load with emacsclient? emacsclient does not understand '-u user' and '-a ALTERNATE-EDITOR' does not allow me to quote it and provide '-u user'. For example, running: /usr/bin/emacsclient -n -a…
vlee
  • 1,369
  • 3
  • 14
  • 23
4
votes
1 answer

Emacs helm: Adding new sources to helm-mini

Helm has builtin helm-mini command which includes buffers and recentf in its sources. (setq helm-source-buffers-list (helm-make-source "Buffers" 'helm-source-buffers))) (helm :sources helm-mini-default-sources :buffer "*helm mini*" …
Chillar Anand
  • 27,936
  • 9
  • 119
  • 136
4
votes
2 answers

Prevent SLIME to switch to the repl buffer

I never really use the REPL and I find annoying that it pops up every time I connect to a swank instance. How can I prevent SLIME to switch to the repl buffer? I tried to find where it does that in slime's code, but it's kind of huge when you're not…
fstamour
  • 760
  • 4
  • 9
4
votes
3 answers

How can a .emacs file be made idempotent?

No matter how many times I reload my .emacs file, M-x load-file RET ~/.emacs RET I want the results to be the same as the first time. I want to make my .emacs file be idempotent. Motivation I know I can surgically evaluate a region (C-c C-r), a…
kjhughes
  • 106,133
  • 27
  • 181
  • 240
4
votes
2 answers

Changing font-lock color in SMerge mode

In Emacs 23.1 I'm opening up a file with conflict markers from a svn merge and consequently it opens it up in SMerge mode. The conflicted text is highlighted in bright yellow. From what I could find this is whatever the font-lock color is set to,…
Stephen Burke
  • 882
  • 3
  • 10
  • 25
4
votes
1 answer

Emacs Scrolling Bug on OS X

Update This problem disappeared after upgrading from Mountain Lion to Mavericks, while also updating Emacs from 23.4 to 24.3. End-update With a .emacs file containing (set-foreground-color "white") (set-background-color "black") (setq…
Calaf
  • 10,113
  • 15
  • 57
  • 120
3
votes
1 answer

How to use BDF fonts in Emacs for Windows

When trying to use a modified version of the Lisp snippet from the GNU Emacs FAQ (http://www.gnu.org/software/emacs/windows/Fonts-and-text-translation.html section 5.4) to load BDF fonts: (setq bdf-directory-list '("~/fonts")) (setq…
Jordan Wade
  • 441
  • 2
  • 9
3
votes
3 answers

Emacs - set mark on edit location

I want emacs to add last edit location to the mark ring, so I can jump back to previous edit locations. Ideally this would only mark one edit location per line. When I edit another line, the last edit location on that line would be added to the…
armandino
  • 17,625
  • 17
  • 69
  • 81
3
votes
7 answers

emacs on Windows: .emacs is no valid file name

I've found out where to put my .emacs file, but it seems it can't begin with a ".". I tried naming it "emacs" or "_emacs", but how can I find out if it is used?
user5262
  • 391
  • 5
  • 11
3
votes
2 answers

How can I detect Cocoa Emacs in my .emacs file?

How can I tell (from inside of .emacs) whether or not the Emacs version is Cocoa? I only want some configuration options to apply when they are loaded in Cocoa Emacs and not in the command-line version.
David Sanders
  • 4,069
  • 1
  • 24
  • 38