5

How can I make Emacs open other file extensions than .org with the Emacs org mode? I have an editor on the iPad that is not able to handle .org files, so I'd like to use e.g. .text with org mode.

Uwe Ziegenhagen
  • 683
  • 2
  • 20
  • 35

2 Answers2

6

This might be a duplicate, but the answer is easy enough:

(add-to-list 'auto-mode-alist '("\\.text\\'" . org-mode))
abo-abo
  • 20,038
  • 3
  • 50
  • 71
  • Nitpick: `(add-to-list 'auto-mode-alist '("\\.text\\'" . org-mode))` [will only match `.text` at the end of the file name](http://stackoverflow.com/questions/3494402/setting-auto-mode-alist-in-emacs) – Gordon Gustafson Feb 25 '14 at 04:17
2

Add the following line at the beginning of your .text file:

#    -*- mode: org -*-

You can also use this for .org_archive files

I know this question is old, but I think it is slightly easier and works, as far as I know, for all text-like files.

GNUmon
  • 35
  • 5