]> code.delx.au - gnu-emacs/blobdiff - lisp/view.el
Update AUCTeX
[gnu-emacs] / lisp / view.el
index 2ef84d2351071838a92ebb95a555f6bcc9aae264..b17cd52ae35b19e276955345408364e249f3d7d0 100644 (file)
@@ -137,6 +137,7 @@ subtracted from by `view-mode-exit' when finished viewing the buffer.
 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.
@@ -243,9 +244,15 @@ For list of all View commands, type H or h while 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)
@@ -996,4 +1003,5 @@ for highlighting the match that is found."
 
 (provide 'view)
 
+;;; arch-tag: 6d0ace36-1d12-4de3-8de3-1fa3231636d7
 ;;; view.el ends here