See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of
`view-return-to-alist'.")
(make-variable-buffer-local 'view-return-to-alist)
+(put 'view-return-to-alist 'permanent-local t)
(defvar view-exit-action nil
"nil or a function with one argument (a buffer) called when finished viewing.
This command runs the normal hook `view-mode-hook'."
(interactive "fView file: ")
(unless (file-exists-p file) (error "%s does not exist" file))
- (let ((had-a-buf (get-file-buffer file)))
- (view-buffer (find-file-noselect file)
- (and (not had-a-buf) 'kill-buffer))))
+ (let ((had-a-buf (get-file-buffer file))
+ (buffer (find-file-noselect file)))
+ (if (eq (with-current-buffer buffer
+ (get major-mode 'mode-class))
+ 'special)
+ (progn
+ (switch-to-buffer buffer)
+ (message "Not using View mode because the major mode is special"))
+ (view-buffer buffer (and (not had-a-buf) 'kill-buffer)))))
;;;###autoload
(defun view-file-other-window (file)
(provide 'view)
+;;; arch-tag: 6d0ace36-1d12-4de3-8de3-1fa3231636d7
;;; view.el ends here