Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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)
(rassq-delete-all #'doc-view-mode auto-mode-alist)
(rassq-delete-all #'doc-view-mode-maybe auto-mode-alist)
Other 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, ...
die, DocView *and* Image mode, die!
Required, but never shown