From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Emacs bindings in other programs Date: Fri, 23 Nov 2007 16:05:47 +1100 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <873auxzh3o.fsf@lion.rapttech.com.au> References: <1193416413.534581.16220@v3g2000hsg.googlegroups.com> <9qsl3r9nom.fsf@aquin.mat.univie.ac.at> <87d4usupsu.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195796471 5476 80.91.229.12 (23 Nov 2007 05:41:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2007 05:41:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 23 06:41:19 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IvRHy-0003fw-Mi for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2007 06:41:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvRHk-0004YG-IR for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Nov 2007 00:41:04 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!colt.net!feeder.news-service.com!newsfeed.kamp.net!newsfeed.kamp.net!feed.xsnews.nl!border-1.ams.xsnews.nl!81.171.88.10.MISMATCH!ramfeed1.eweka.nl!eweka.nl!lightspeed.eweka.nl!138.199.65.86.MISMATCH!sn-xt-ams-06!sn-xt-ams-03!sn-post-ams-02!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:Ojx8udWZXbyRY3ODCG3hrQcIMSY= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 55 Original-Xref: shelby.stanford.edu gnu.emacs.help:153994 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49424 Archived-At: dkcombs@panix.com (David Combs) writes: > In article <87d4usupsu.fsf@lion.rapttech.com.au>, > Tim X wrote: >> >>Note that you can call other X apps from within emacs as a sub-process, you >>just can't run them 'within' emacs itself. The downside is that you don't ... > > Like in dired, "!" on a .ps-file will run ghostview (I think I reacall), on a > .pdf will use either acrobat or xpdf, etc. > > For me, the problem is that when you do that, everything else > in emacs is (or looks like it's) frozen. > > Problematic when you want to read through some doc, and > while doing it, to pause while checking something out in some > other buffer. No can do, at least not by "!" alone. > > Would be nice if, say, a C-u ! put the new prog into > background or something, letting you bounce back and forth > between emacs and the app. > I think this is just a limitation in how dired does the command call. Emacs can do synchronous and asynchronous processes. I believe other packages that can be used to call a new process to run another program can do it asynchronously and therefore don't block emacs. Not sure if/how you can make dired do this automatically, but if, for example, you have the cursor on a pdf file and hit !, you will be prompted (with a default of something like xpdf) for the program. If you enter xpdf * &, rather than accepting the default, emacs will do an asynchronous process call to run xpdf and you will be able to switch between xpdf and emacs with no problems. It may be possible to make this behavior the default by customizing dired or dired-x. My issue isn't the sunchronous/asynchronous problem, its that once I have (lets say) xpdf running, if I want to cut and copy bits into an emacs buffer, I have to use that bloody awful rodent and not the familiar and faster emacs keybindings. Same sort of issue with searching and other operations. For this reason, I've written my own little converter utility which takes the file type (*.doc, *.pdf, *.ps etc) and converts it to text and displays it in an emacs buffer. You do lose some formatting, but I find this is offset by the better integration into emacs. I use a defadvice on view-file so that if I hit v in dired on one of these file types, it automatically does the conversion - otherwise it just views the file as normal. I've also added a call to browse-url for files ending in html or htm, so if I hit v on an html file, it is rendered with w3m. If I want to see the actual contents for any of the file types that are handled specially, I just use enter rather than 'v'. Tim -- tcross (at) rapttech dot com dot au