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.


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?

  • 2
    Check the variable auto-mode-alist. – NickD Nov 21 '20 at 14:26
  • Does this answer your question? Make emacs automatically open binary files in hexl-mode – Drew Nov 21 '20 at 23:13
  • @Drew My rec files are not binary, they are text files with the extension rec. – Mentiflectax Nov 22 '20 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 Nov 22 '20 at 16:07

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

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

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

  • 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? – Mentiflectax Nov 21 '20 at 19:20
  • 1
    Check the variable auto-mode-alist. – NickD Nov 21 '20 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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