docview in emacs: refreshing dvi content automatically - emacs

Is there a way Emacs can automatically refresh the buffer showing the dvi right after my LaTeX compilation?
Thank you.

The global auto revert is not always desirable, in fact I only use it for for the DocView to see the new output of pdflatex.
The following will allow auto revert for the DocView major mode
(add-hook 'doc-view-mode-hook 'auto-revert-mode)

Use interactive function:
auto-revert-mode
to enable reloading when the file changes.

Related

LaTeX-mode hooks not loading in emacs (24.3.50) with AUCTeX (11.87.3)

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.

unable to toggle read-only mode in emacs

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?

How do you disable mlinks-mode in emacs nxhtml mode

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.

Enabling viper-mode and vimpulse in compilation-mode

viper.el is hardcoded to disable viper in compilation-mode. How can I fix this without modifying the original file?
If you really want to do this, you should be able to customize the variable viper-emacs-state-mode-list and remove compilation-mode.
Have you tried running "M-x viper-mode"? That's what I do when I end up in a buffer in which it has been disabled, or at least not enabled.

Stop emacs from opening window automatically

This question probably applies to other emacs modes than haskell-mode, since I assume emacs has got a general way of opening windows for automatically created buffers:
haskell-mode for emacs enables me to hit C-c C-l to load the contents of the current buffer into a Haskell interactive session, which automatically causes emacs to open the buffer for the session in a split window in the current frame. Since I am running a setup with multiple emacs clients connected to a server, I really don't want to show the buffer in each open frame I've got. Is there a way to prevent emacs from doing this kind of thing?
Ah, I found a solution just after posting this :).
Adding
(setq special-display-buffer-names
'("*haskell*" "*Help*"))
to my .emacs tells emacs to open these buffers in a frame instead of a split.
Edit: But still, an even better solution would be for emacs never to create frames/splits automatically, but just silently create special buffers in the background. I can't figure out how to specify this though.
in init.el
(setq split-height-threshold 5)
(setq split-width-threshold 5)