diff options
author | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2011-07-19 17:01:49 +0200 |
---|---|---|
committer | Lars Magne Ingebrigtsen <larsi@gnus.org> | 2011-07-19 17:01:49 +0200 |
commit | 1bfd59e52c910539dea41e86204fd86b38024239 (patch) | |
tree | 951ef65958d8e50e3dff7d722bcac2ff140a0201 /lisp/view.el | |
parent | fd99fde61fbdd83fd6462a6dec62c0fe7af66c83 (diff) | |
download | emacs-1bfd59e52c910539dea41e86204fd86b38024239.tar.gz |
(view-buffer): Allow running in `special' modes if we're visiting a file.
Fixes: debbugs:8615
Diffstat (limited to 'lisp/view.el')
-rw-r--r-- | lisp/view.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/view.el b/lisp/view.el index ee85b4e7823..21479a70a72 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -311,9 +311,10 @@ file: Users may suspend viewing in order to modify the buffer. Exiting View mode will then discard the user's edits. Setting EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." (interactive "bView buffer: ") - (if (eq (with-current-buffer buffer - (get major-mode 'mode-class)) - 'special) + (if (with-current-buffer buffer + (and (eq (get major-mode 'mode-class) + 'special) + (null buffer-file-name))) (progn (switch-to-buffer buffer) (message "Not using View mode because the major mode is special")) |