I am editing a markdown file in emacs. Emacs automatically sets it to Fundamental mode and is auto indenting any newlines I enter. I tried disabling electric-indent-mode and didn't have any success. How do I disable this feature in this and other plain text files.
# Hello
a
b
c
d
Install markdown package:
M-x package-install RET markdown-mode RET
it supports .md files as well.
Related
In emacs I have got the tuareg mode enabled in the top and the shell in the bottom without color syntax. How can I have color syntax in the shell?
In order to get here, I installed camllight using this script http://judicael.courant.free.fr/2015/02/20/installationcaml.html
then, I installed melpa
M-x list-packages
to search and to install tuareg. And finally, I edited .emacs with (add to list 'load-path "home/pi/.emacs.d/lisp") where lisp is a directory which contain tuareg.el, camldebug.el, tuareg-site-file-el
emacs window:
The mode that you're looking for is not the one that comes with Tuareg. The guy in the video is using the inferior-ocaml mode that is a part of an old caml-mode that used to be distributed with the OCaml compiler. Unless you really want the exact setup as in the video, I would suggest you use a more modern Tuareg mode together with the OCaml Merlin. Otherwise, you should remove Tuareg and install caml-mode using M-x package-install <RET> caml-mode <RET> (see also the documentation on the Github page of the project for more details).
I tried to compile the auctex from Emacs MELPA. The version is: 11.88.4
When I first open a .tex file, compile AUCTEX, and change to "TeX-latex-mode", Emacs will work properly, the menu bar also change to latex state.
However, when I close Emacs, restart Emacs again and open a .tex file, Emacs will give:
Debugger entered--Lisp error: (error "Autoloading failed to define function TeX-latex-mode")
And auctex will not work...
It seems the problem is in autoloading certain state when initialize the auctex for a tex file.
Any help?
Problem Solved! My mistake.
I modularised my init.el and separated the LaTeX settings to latex.el, which conflict with the latex.el in auctex.
I renamed the file to latex_settings and everyting works fine. (A small warning that no docstring for 'tex-start-shell', but that's fine.)
So I've installed ELPA, and did the command M-x package-install RET auctex.
I was prompted with the message that 133 files were compiled and one was skipped.
But I cannot find auctex mode anywhere when trying to initialize it with M-x auctex-mode.
Am I missing something?
AUCTeX is a package that includes multiple TeX and LaTeX modes, but does not define an explicit AUCTeX mode. To invoke a mode explicitly, use M-x TeX-<TAB> or M-x LaTeX-<TAB> to see the possibilities.
Assuming that the package is installed correctly, these tab-completions should resolve.
Various of the modes may be started automatically upon opening files with certain extensions, perhaps like myfile.tex or similar.
Is it possible to make emacs ecb (Emacs Code Browser)
not show .pyc and .pyo files in the directory browser?
You can customize the variable source-file-regexps which specifies which files are shown as source files. You can find it in the group "ecb-sources".
M-x customize-group RET ecb-sources
See also the ECB documentation.
I have GNU Emacs 23.1.1, on Ubuntu 10.10.
I have to following .emacs:
(custom-set-variables
'(cua-mode t nil (cua-base))
'(inhibit-startup-screen t)
)
(show-paren-mode 1)
(setq show-paren-delay 0)
;; perl mode stuff
(fset 'perl-mode 'cperl-mode)
(setq cperl-indent-level 4
cperl-close-paren-offset -4
cperl-continued-statement-offset 0
cperl-indent-parens-as-block t
cperl-tab-always-indent t
cperl-invalid-face nil
)
When I do $ emacs -nw the tab indentation works fine. When I launch the GUI version with $ emacs tab indentation doesn't work. I only get space indentation.
How can I get tab indentation in the GUI as well?
The cperl conf was taken from emacswiki
The emacs packages I have:
$ dpkg -l | grep emacs
ii emacs 23.1+1-4ubuntu7.2+maverick1 The GNU Emacs editor (metapackage)
ii emacs-goodies-el 33.6ubuntu1 Miscellaneous add-ons for Emacs
ii emacs-snapshot 1:20090909-1 The GNU Emacs editor (development snapshot)
ii emacs-snapshot-bin-common 1:20090909-1 The GNU Emacs editor's shared, architecture dependent files
ii emacs-snapshot-common 1:20090909-1 The GNU Emacs editor's common infrastructure
ii emacs23 23.1+1-4ubuntu7.2+maverick1 The GNU Emacs editor (with GTK+ user interface)
ii emacs23-bin-common 23.1+1-4ubuntu7.2+maverick1 The GNU Emacs editor's shared, architecture dependent files
ii emacs23-common 23.1+1-4ubuntu7.2+maverick1 The GNU Emacs editor's shared, architecture independent infrastructure
ii emacsen-common 1.4.19ubuntu1 Common facilities for all emacsen
EDIT: Sorry, but I just noticed that I hadn't studied the behaviour correctly. In both gui and -nw, when I edit a file already indented in tabs, it uses tabs, whereas when I edit a new file, it indents it with spaces.
First, check the *Messages* and *Warnings* buffers on startup. There might be a hint as to what's failing there. In particular, *Messages* should list all the startup files that emacs is loading; on Ubuntu, this will include files in /etc/emacs as well as your .emacs.
If that doesn't help, try running your .emacs interactively in the emacs debugger. Start emacs with emacs -nw -q and load .emacs into a buffer. Run M-x edebug-all-forms then run M-x eval-buffer. Press space repeatedly to step through the file.
Edit: Check the value of indent-tabs-mode in a perl buffer in both of your environment. This is used to control whether to indent with tab characters or spaces. Adding (setq-default indent-tabs-mode t) should force emacs to indent with tab characters.