Before I installed some packages and add some configurations in .emacs, the .tex file in Emacs is in LaTex mode. After I changes .emacs, the .tex file is opened in Fundamental mode. All the functionalities of Latex mode works well, like compile and view. If I enable the LaTex-Math mode, the Fundamental mode will become LaTex/MP mode, and when I disable the LaTex-Math mode, it becomes LaTex/P mode.
How can I open a .tex file with LaTex mode, rather than Fundamental mode?
Related
I installed GNU minimap (version 1.2).
When I open certain type of files , e.g. .py, .c, the minimap comes out as expected.
However, when I open .html file, the minimap is not started.
Is there a way to add additional modes where the minimap automatically shown?
I tried to add hooks to .emacs file but it just starts minimap-mode, but no displaying any minimap.
(add-hook 'html-mode-hook 'minimap-mode)
By default, minimap-mode only works for modes that derive from prog-mode (most modern modes for programming, including python-mode and c-mode). Modify minimap-major-modes if you want to activate it for others, e.g.
(setq minimap-major-modes '(prog-mode html-mode))
or
(add-to-list 'minimap-major-modes 'html-mode)
Since I updated to emacs 24 I cannot get AUCTeX to load the LaTeX-mode hooks, e.g.
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
despite:
C-h m tells me that my major mode is Major mode in AUCTeX for editing LaTeX files.
the AUCTeX mode help states:
Entering LaTeX mode calls the value of `text-mode-hook',
then the value of `TeX-mode-hook', and then the value
of `LaTeX-mode-hook'.
(Indeed, the text-mode hooks are not loaded either.)
Hooks for other modes (e.g. for Markdown or Python) do work.
And, of course, I have tested that manual activation, e.g. M-x visual-line-mode, does work.
Thanks!
This is strange C-hm gives me
Entering Latex mode runs the hook text-mode-hook', then
tex-mode-hook', and finally `latex-mode-hook'.
Notice that it is latex-mode-hook and not LaTeX-mode-hook.
EDIT - I do not have auctex installed maybe that explains why the help messages are different for us, ignore the part above. You can try the below as an alternative
(add-hook 'latex-mode-hook 'visual-line-mode)
As is noted in the comments in the other answer, this issue is caused by AucTeX being unable to create XPM images. This occurs when when Emacs is not compiled with the libxpm library, which might be the case when you run Emacs primarily inside your favorite terminal emulator.
Anyways, you can still correct this issue without recompiling Emacs. In fact, the images are only used for the AucTeX toolbar. Thus, disabling it will effectively remove the problem altogether. You can do this by adding:
(unless (image-type-available-p 'xpm)
(setq LaTeX-enable-toolbar nil))
To your .emacs (or .emacs.d/init.el) file.
This snippet simply checks if XPM images are available in the Emacs installation and if not, it disables the toolbar.
I am using emacs-live as my emacs starter config. I have .jade files which when opened in emacs say Buffer is read only.
However these same files I am able to edit in Sublime Text.
I tried toggling the read only by C-xC-q to no effect.
How do I resolve it ?
File permissions shouldn't prevent Emacs from allowing you to toggle the read-only state of an associated buffer.
Can you try M-x toggle-read-only RET instead, to check whether it's the function or just the key binding that isn't working?
I'm assuming that C-xC-q is working in general for other buffers?
I'm running GNU Linux and GNU Emacs 23.4.2
When I copy text in Emacs (with M-w, or in CUA mode C-c) and then type C-v in some other application to try to paste the copied text, it doesn't work -- the text from Emacs is not pasted.
However, when I instead copy the text using the Emacs menus (Edit->Copy), this works -- I can successfully paste the copied text into another application with C-v.
How can I fix this, so that copying via the keybindings works the same as copying via the menus?
Read the manual, section 25.1.5 Using the Clipboard:
You can customize the variable x-select-enable-clipboard to make the Emacs yank functions consult the clipboard before the primary selection, and to make the kill functions to store in the clipboard as well as the primary selection. Otherwise, these commands do not access the clipboard at all.
You should probably also read section 25.1.3 Cut and Paste with Other Window Applications.
Put this in your .emacs (setq x-select-enable-clipboard t)
I am using emacs with nxhtml mode. I find mlinks-mode to be a pain because I use PHP constants for my paths which trips up mlinks-mode - so when I inadvertently click on a link, I get a debug stack trace.
Whenever I enter into an HTML block, the mlinks-mode gets enabled. I have tried setting my init file or mlinks-mode options to disable it, but it seems to be getting loaded dynamically regardless of these settings. Is there a way to prevent nxhtml from loading this mode unless I want it to?
Try M-x customize-variable RET mlinks-mode-functions RET and remove the nxhtml-mode entry.