I found here that the following disables DocView mode for a specific file type, like PDF:
(add-to-list 'auto-mode-alist '("\\.pdf\\'" . fundamental-mode))
But how can DocView mode be disabled completely, for any file type? (on GNU Emacs 26.1)
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityOther than the (rassq-delete-all #'doc-view-mode-maybe auto-mode-alist)
suggested by Tyler (but note you need to use ...-maybe
), you can also be more drastic:
;; Die, Doc-View-mode! die!
(defalias 'doc-view-mode #'doc-view-fallback-mode) ;Or fundamental-mode, ...
#'fundamental-mode
seems to work, but not for .jpg
files. Is that normal? (minibuffer shows (Image[jpeg])
but file is still displayed as an image). Could that be something other than DocView? So I'm in dired-mode, hit RET on a .jpg file and that shows me the picture in the current buffer. Hmmm, even if I use emacs -Q
.
– Marius Hofert
May 14 '19 at 18:15
die, DocView *and* Image mode, die!
:-) Sometimes Emacs is just too smart...
– Marius Hofert
May 14 '19 at 18:21
C-c C-c
also works in doc-view mode, one should probably just remember that and not disable it at all (for consistency).
– Marius Hofert
May 14 '19 at 18:24
(rassq-delete-all #'doc-view-mode auto-mode-alist)
? The thread you link to suggests this is what you want. – Tyler May 14 '19 at 16:32(rassq-delete-all #'doc-view-mode-maybe auto-mode-alist)
? – Tyler May 14 '19 at 17:35