]> git.eshelyaron.com Git - emacs.git/commitdiff
(view-buffer): Allow running in `special' modes if we're visiting a file.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 19 Jul 2011 15:01:49 +0000 (17:01 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 19 Jul 2011 15:01:49 +0000 (17:01 +0200)
Fixes: debbugs:8615
lisp/ChangeLog
lisp/view.el

index 50e4cd49f4cdb511204e5db3bf07478981740bc4..0699a93ac9bf2928a42eca367487d76de3dd44a5 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * view.el (view-buffer): Allow running in `special' modes if we're
+       visiting a file (bug#8615).
+
 2011-07-19  Martin Rudalics  <rudalics@gmx.at>
 
        * window.el (display-buffer-alist-of-strings-p)
index ee85b4e7823f2663696eb2b38b7f9ce1951b0ee8..21479a70a7211965129120e2fdcb09b82db71c8c 100644 (file)
@@ -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"))