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)
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, ...