From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: John Russell Newsgroups: gmane.emacs.bugs Subject: Re: new dired viewer Date: 03 Apr 2003 09:44:52 -0500 Organization: Cisco Systems, Inc. Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1049381092.1427.2.camel@debussy.cisco.com> References: <200304030140.h331eb412550@eel.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1049381354 28772 80.91.224.249 (3 Apr 2003 14:49:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2003 14:49:14 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 03 16:49:12 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19161g-0007Ts-00 for ; Thu, 03 Apr 2003 16:49:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19161S-00072j-01 for gnu-bug-gnu-emacs@m.gmane.org; Thu, 03 Apr 2003 09:48:58 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 1915zE-0004e6-00 for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2003 09:46:40 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 1915yL-0004SV-00 for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2003 09:45:47 -0500 Original-Received: from rtp-core-1.cisco.com ([64.102.124.12]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1915xd-0004GB-00 for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2003 09:45:01 -0500 Original-Received: from cannon.cisco.com (IDENT:mirapoint@cannon.cisco.com [161.44.118.24]) by rtp-core-1.cisco.com (8.12.6/8.12.6) with ESMTP id h33Eirkh003337; Thu, 3 Apr 2003 09:44:53 -0500 (EST) Original-Received: from [161.44.79.244] ([161.44.79.244]) by cannon.cisco.com (Mirapoint) with ESMTP id ABG61793; Thu, 3 Apr 2003 09:53:36 -0500 (EST) Original-To: Luc Teirlinck In-Reply-To: <200304030140.h331eb412550@eel.dms.auburn.edu> X-Mailer: Ximian Evolution 1.2.3 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4711 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4711 > This isn't so much a bug report as a suggestion. I just downloaded > emacs from cvs yesterday. I really like the dired viewer that allows > the spawning of external viewers for certain file types. However, > emacs seems to have to wait for the process to die. Is there any way > to start a viewer and then cut it loose? It would be nice to view a > pdf in xpdf and still be able to use emacs afterward. Thanks. > ! xpdf * & > > is probably the most convenient available way. I do not know whether > this is convenient enough for your purposes. Actually, rms sent me this fix which is exactly what I was hoping for. How about this replacement function? (defun dired-view-file () "In Dired, examine a file in view mode, returning to dired when done. When file is a directory, show it in this buffer if it is inserted. Some kinds of files are displayed using external viewer programs; see `dired-view-command-alist'. Otherwise, display it in another buffer." (interactive) (let ((file (dired-get-file-for-visit))) (if (file-directory-p file) (or (and (cdr dired-subdir-alist) (dired-goto-subdir file)) (dired file)) (let (cmd) ;; Look for some other way to view a certain file. (dolist (elt dired-view-command-alist) (if (string-match (car elt) file) (setq cmd (cdr elt)))) (if cmd (call-process shell-file-name nil 0 nil "-c" (concat cmd " " (shell-quote-argument file) " &")) (view-file file))))))