Kiran Chauhan

Cogito, ergo sum // I think, therefore I am.

Emacs Minipost Pt. 5

Do you remember that in previous Minipost, we created a main.c file? In this Minipost, we're going to open it.

Open the Emacs and press ctrl-x ctrl-f. It asks you the path/file name that you want to open.

P.S. It supports auto-complete. So, just write few characters and press Tab. Emacs will auto-complete path/file name for you!

Type a path/file name and press Enter. Emacs will open the file!

Let's modifies the code and add one more printf().

#include <stdio.h>

int main(int argc, char** argv) {
  printf("hello, world\n");
  printf("how are you?\n");

  return 0;
}

We know how to save, right? ctrl-x ctrl-s. Press.

We now know how to create, open, and save the file in Emacs! Yay!

Summary: Now, you know how to open an existing file and save it with modified content.