diff lisp/tar-mode.el @ 107897:1721e4658521

Test for special mode-class in view-buffer instead of view-file (bug#5513). * view.el (view-file, view-buffer): Move test for special mode-class from view-file to view-buffer. * tar-mode.el (tar-extract): Turn if's into one cond like in arc-mode.el.
author Juri Linkov <juri@jurta.org>
date Mon, 19 Apr 2010 02:49:58 +0300
parents 1d1d5d9bd884
children 0b37f86b040e
line wrap: on
line diff
--- a/lisp/tar-mode.el	Mon Apr 19 02:08:52 2010 +0300
+++ b/lisp/tar-mode.el	Mon Apr 19 02:49:58 2010 +0300
@@ -852,14 +852,12 @@
           (set (make-local-variable 'tar-superior-descriptor) descriptor)
           (setq buffer-read-only read-only-p)
           (tar-subfile-mode 1)))
-      (if view-p
-	  (view-buffer
-	   buffer (and just-created 'kill-buffer-if-not-modified))
-	(if (eq other-window-p 'display)
-	    (display-buffer buffer)
-	  (if other-window-p
-	      (switch-to-buffer-other-window buffer)
-	    (switch-to-buffer buffer)))))))
+      (cond
+       (view-p
+	(view-buffer buffer (and just-created 'kill-buffer-if-not-modified)))
+       ((eq other-window-p 'display) (display-buffer buffer))
+       (other-window-p (switch-to-buffer-other-window buffer))
+       (t (switch-to-buffer buffer))))))
 
 
 (defun tar-extract-other-window ()