1

How can I make sure that Emacs opens files with extension *.rec as normal text files?

When I try to open a file with the extnsion *.rec, I get the error message Running someFile.rec...done without the file being opened.

Screenshot

I assume that rec-mode is not installed because its status is Available from gnu (see below).

Status of the rec-mode package

What can I do in order for Emacs to open *.rec files as plain, normal text files?

4
  • 2
    Check the variable auto-mode-alist.
    – NickD
    Commented Nov 21, 2020 at 14:26
  • Does this answer your question? Make emacs automatically open binary files in hexl-mode
    – Drew
    Commented Nov 21, 2020 at 23:13
  • @Drew My rec files are not binary, they are text files with the extension rec. Commented Nov 22, 2020 at 8:31
  • That doesn't matter. auto-mode-alist is for any extension and mode. Please consult the doc, and please read that duplicate Q&A.
    – Drew
    Commented Nov 22, 2020 at 16:07

2 Answers 2

2

To tell Emacs that *.rec files should be opened in text-mode:

(add-to-list 'auto-mode-alist '("\\.rec\\'" . text-mode))
1

Use M-x find-file-literally Emacs will use fundamental-mode as the major mode. Then change to txt mode.

2
  • 1
    Thanks. Is there a way to make Org mode open files in links ([[file:someFile.rec][Rec file]]) in the fundamental or text mode? Commented Nov 21, 2020 at 19:20
  • 1
    Check the variable auto-mode-alist.
    – NickD
    Commented Nov 21, 2020 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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