Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm new to *nix, and have installed Ubuntu as it seems to be a pretty friendly distro. Lately, meaning the past two days, I have been trying to learn and play with emacs. However, I have gotten to the point that I want to try customizing it and learning new things. I have tried to configure it to set the mode to org-mode whenever I make/load a .org file using this code:

(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)

I was told that this goes into my .emacs file, under my home directory. I have attempted to find this file, using ls -a of course, and to create it, and every other variation of getting this .emacs file since it wasn't there when I looked for it. However .emacs.d was there, with some random files that were not in any lisp language, so I assumed they were not what I wanted. Any help would be greatly appreciated.

share|improve this question
add comment

2 Answers

There isn't a default .emacs file. You will have to create it. Files with names that start with a dot (.) are hidden by default.

To create/edit the file in emacs open ~/.emacs either as emacs ~/.emacs or from within emacs. The directory .emacs.d is usually contains the autosave list and other working files.

share|improve this answer
add comment

Your .emacs wont' exist until you create it. Within Emacs, open ~/.emacs. Emacs will also try ~/.emacs.d/init.el if it can't find ~/.emacs.

Note that you don't need the first two lines (org-install and auto-mode-alist): they're only required if you install org-mode independently from Emacs, but org-mode ships with Emacs these days.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.