From: Lars Magne Ingebrigtsen Date: Tue, 19 Jul 2011 15:01:49 +0000 (+0200) Subject: (view-buffer): Allow running in `special' modes if we're visiting a file. X-Git-Tag: emacs-pretest-24.0.90~104^2~196 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1bfd59e52c910539dea41e86204fd86b38024239;p=emacs.git (view-buffer): Allow running in `special' modes if we're visiting a file. Fixes: debbugs:8615 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 50e4cd49f4c..0699a93ac9b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-07-19 Lars Magne Ingebrigtsen + + * view.el (view-buffer): Allow running in `special' modes if we're + visiting a file (bug#8615). + 2011-07-19 Martin Rudalics * window.el (display-buffer-alist-of-strings-p) 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"))