Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to load a file in fundamental mode in emacs

Tags:

emacs

elisp

When loading a file in emacs (via find-file), emacs loads the file into a buffer with the appropriate mode, invoking the appropriate handlers, etc. Sometimes, for debugging, I would like to be able to load a file directly into fundamental mode, without triggering anything else. What is the simplest way of doing this?

like image 597
Mayer Goldberg Avatar asked Jan 01 '14 09:01

Mayer Goldberg


People also ask

How do Emacs modes work?

Emacs modes are established for each file you open, so opening Emacs in "nothing mode" doesn't necessarily accomplish what you're after. Each file you open after starting Emacs will get its own mode applied.

What mode does m-x Find-File-literally use in Emacs?

When you use M-x find-file-literally Emacs will not invoke a mode that is based on the file name. Instead, it uses fundamental-mode as the major mode.

What does ‘require’ do in Emacs?

Using ‘require’ adds a dependency: Not only must a file with the same name (plus “.el” or “.elc” extension) exist, but in that file, Emacs wants to see a statement such as this:

How do I open a file in fundamental mode?

You can use the command @clemera provides to open a file in fundamental mode from the command line. You can do the same from an already-running Emacs via M-x find-file-literally. You can "turn-off" the major mode for a file you've already opened by selecting fundamental mode (which is basically "nothing mode"): M-x fundamental-mode.


1 Answers

Use find-file-literally. Answer is 30 chars min.

like image 183
abo-abo Avatar answered Sep 27 '22 21:09

abo-abo