I've looked at the documentation, but I can't seem to figure out how to do it.

  • It's not clear what you are trying to do. Do you mean that when you visit a particular (or all?) *.el file you want the major mode to be Lisp-interaction mode? (In that case, see auto-mode-alist.)
    – Drew
    Apr 26 '17 at 13:54
  • Out of curiosity, why do you want to do this? emacs-lisp-mode and lisp-interaction-mode will be almost identical unless you've made some major customizations.
    – Dan
    Apr 26 '17 at 17:49
  • @Dan I'd imagine that would be useful if you wanted to save your *scratch* buffer and use it in the same way after reloading. OP: you could put ;; -*- mode: lisp-interaction -*- at the top of the buffer for the files you are interested in editing. You probably don't want to use interaction mode when opening someone else's files.
    – wvxvw
    Apr 26 '17 at 18:08
  • My professor suggests us to use lisp-interactive-mode to edit files that he provides for us. However, the documentation and his recommendation only tells you type M-x lisp-interaction mode. I've tried evaluating that expression, but it returns errors. Apr 27 '17 at 19:00
  • 1
    I suggest you go through emacs' tutorial (C-h t ie press Control and h, then t). In particular the first few lines explain the M-x thing.
    – JeanPierre
    Apr 27 '17 at 19:57


M-x lisp-interaction-mode RET

For a single file, make the first line of that file:

;; -*- mode: lisp-interaction; -*-

For all files, add to your init file:

(add-to-list 'auto-mode-alist '("\\.el\\'" . lisp-interaction-mode))
  • I'm somewhat new to elisp. Where would I enter this line of code? With the M-x and the RET, where do I enter that? Is there some specific way to do this? Apr 27 '17 at 19:01
  • Definitely follow JeanPierre's advice to follow the built-in tutorial. M-x is standard Emacs notation meaning "Hold the META modifier key and press the x key" (on modern keyboards the key labelled ALT is typically the META key). RET is the Return/Enter key.
    – phils
    Apr 27 '17 at 22:26
  • This will make it so much easier compared to running everything in a scratch buffer or C-x C-e. I understand that you on stackexchange get a lot of ridiculous questions from people who haven't looked through the tutorial or the guide for the language or any documentation, or are asking for the answer toa homework problem; and whenever I ask a question here I try to explain as well as possible that I've put some effort into finding the solution to my problem, and am not just asking others to solve my coding problems for me. ;) Apr 28 '17 at 1:15

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.