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
9
votes
3 answers

change emacs ruby-mode indent to 4 spaces

From a previous post I got Ruby mode working in emacs. This is working great. Setting up .emacs file for mac ruby development Our company uses 4 spaces for indents though instead of the default 2. I am having difficulty getting this to work. Here…
Poul
  • 3,426
  • 5
  • 37
  • 43
9
votes
1 answer

How to disable Emacs messages like "You can run the command X with Y"

When I run a command that prompts for input in the minibuffer, it's annoying to have the text overwritten by supposedly helpful messages like: You can run the command 'package-list-packages' with Is there a way to…
Karl
  • 1,143
  • 6
  • 20
9
votes
2 answers

Emacs: Translating C-h to DEL, M-h to M-DEL

I want my C/M-h keys to be a binding for delete. The usual solution of global-set-key doesn't work for me, as I want these keys to behave as delete everywhere including the minibuffer and various modes, and be able to work between my various…
Daniel
  • 445
  • 2
  • 12
8
votes
2 answers

How to get whitespace-mode enabled only for certain modes

I'm trying to get emacs whitespace-mode enabled automatically only in certain modes. According to the documentation, enabling global-whitespace-mode and setting the whitespace-global-modes variable should do exactly that. But I can't get it to…
jchl
  • 6,332
  • 4
  • 27
  • 51
8
votes
2 answers

Emacs navigation in new versions acts like Notepad

This is a bit difficult to explain, so please bear with me. I am running emacs 23.0.60.2 (from CVS) in order to have truetype support. (in case anyone wonders why I'm running the bleeding edge). I'm experiencing some oddness in navigation within…
Chris R
  • 17,546
  • 23
  • 105
  • 172
8
votes
3 answers

emacs: how to set the default database type for a sql file in SQL mode

In SQL mode, we could select the product type such posgres, mysql, oracle etc, and the default one is ANSI, how to set the default type as postgresql after startup emacs? What needs to be put in .emacs?
Daniel Wu
  • 5,853
  • 12
  • 42
  • 93
8
votes
4 answers

Default string for grep-find in emacs

I often use the command grep-find in emacs to search through my source files, but it's annying that it always finds matches in temporary files and backup files and so on. The default command for grep-find is: find . -type f -print0 | xargs -0 -e…
Zitrax
  • 19,036
  • 20
  • 88
  • 110
8
votes
4 answers

Emacs set spacing for inline (end of line) comments

In the PEP 8 style guide for python, it is recommended that inline comments are separated by the rest of the line by two spaces. However, the default in Emacs is that running comment-dwim or indent-for-comment puts only one space between the end of…
rottweiler
  • 229
  • 1
  • 7
7
votes
1 answer

Disabling transient-mark-mode

In my .emacs file, I have (setq transient-mark-mode nil) and yet transient-mark-mode is activated when I start up Emacs. Calling transient-mark-mode gives the message "transient-mark-mode disabled", but Control-Space still starts highlighting a…
Nathaniel Flath
  • 15,477
  • 19
  • 69
  • 94
7
votes
2 answers

How do I set the colour of brackets/braces/parentheses in Emacs?

I'd like to specify the colour of {}, () and [] in a custom colour theme. Is this possible? Update: Here's the source. Please note the in-development status of this theme; it is unsafe for use both at the workplace and around the home. ;;; Color…
MDCore
  • 17,583
  • 8
  • 43
  • 48
7
votes
1 answer

What is a simple way to combine two Emacs major modes, or to change an existing mode?

In Emacs, I'm working with a file that is a hybrid of two languages. Question 1: Is there a simple way to write a major mode file that combines two major modes? Details: The language is called "brew" (not the "BREW" of "Binary Runtime Environment…
Winston C. Yang
  • 1,497
  • 2
  • 18
  • 27
7
votes
2 answers

Emacs setq before loading

When customizing Emacs, do I set the corresponding variable before loading a package or after? i.e., (setq some-variable some-value) (require 'some-package) or (require 'some-package) (setq some-variable some-value) Seems to me that most of the…
gongzhitaao
  • 6,566
  • 3
  • 36
  • 44
7
votes
1 answer

When emacs starts in daemon mode how can I automatically load the correct init settings when connecting via X11 or terminal?

I recently began running emacs in daemon mode on startup. Connecting via GUI client (Emacs.app) appears to load customizations correctly. However, connecting via emacsclient in Terminal does not. The first symptom appeared after trying to M-x…
d3vin
  • 379
  • 3
  • 12
7
votes
1 answer

Emacs 24: Mode-Line Style

I am trying to change the styling of the modeline in emacs 24. I want to add an overline and an underline. Underline works fine, but overline is not working for some reason. Here is my code so far (added to .emacs): (set-face-attribute 'mode-line…
BIOS
  • 1,655
  • 5
  • 20
  • 36
7
votes
2 answers

How to keep comments on variables set through "M-x customize" on emacs?

When I set variables through M-x customize, the values are stored in this big, auto-generated, alphabetically ordered list in my .emacs file. The problem is I like to document why I chose a particular value other than the default for a particular…
agentofuser
  • 8,987
  • 11
  • 54
  • 85