From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marco Parrone Newsgroups: gmane.emacs.help Subject: Re: Opening html-File in Dired with w3m Date: Tue, 20 Jul 2004 15:17:03 GMT Organization: none Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87oema7lwf.fsf@marc0.dyndns.org> References: <87u0w3kqex.fsf@ortler.iwr.uni-heidelberg.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1090336665 591 80.91.224.253 (20 Jul 2004 15:17:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Jul 2004 15:17:45 +0000 (UTC) Keywords: dired, xterm, commands Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 20 17:17:27 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BmwMw-0005jN-00 for ; Tue, 20 Jul 2004 17:17:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BmwPg-0000CJ-73 for geh-help-gnu-emacs@m.gmane.org; Tue, 20 Jul 2004 11:20:16 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!news2.telebyte.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!news-out.tin.it!news-in.tin.it!news4.tin.it.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Language: en X-Accept-Language: it, en X-Country: Italy X-Attribution: Marco X-Face: ]KIe+0@lNbQo2y\ey;]!*LKsR-0$V737yt[BnA*)c,)gu>IH>S}:"PPNWkV<}[ usLa_gJyB!BRUEC!~5OY;:`k1Tcv2g2<0|,'RI}ZhnPpaXC.,L^y?}R&FfrRiLE*b+AE, JY/a! `/ZN{E`NgLO_QV#s`!,#M%ppv@mcIb`K^/1``d^=o"AvteN1nNFyzU List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19718 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19718 Nicolas Neuss on 20 Jul 2004 10:56:38 +0200 writes: > Hello! > > Is it possible to configure Dired such that it uses w3m when opening a file > with html-extension? (Or info when opening a .info-File, etc?) > > Thanks, Nicolas. Under X, a way may be to put the following code into your ~/.emacs, restart emacs, then, when in dired mode, move the point on the file to open, type `C-c x', insert the name of the command to run, and hit RET (for example `C-c x w3m RET'). Or, instead to move the point on the file to open, mark more files (tested with `C-c x emacs RET'). (defun dired-do-xterm-command (ARG) (interactive "P") (let ((files (list))) (dired-map-over-marks (setq files (cons (dired-get-filename) files)) ARG t) (setq files (apply (function concat) (mapcar (lambda (a) (concat " " (shell-quote-argument a))) files))) (let ((command (read-from-minibuffer (concat "xterm cmd on" files ": ")))) (shell-command (concat "xterm -e " command " " files " &") (concat "*(xterm -e " command " " files ")*"))))) (defun .set-dired-xterm-keybinding () (define-key dired-mode-map [(control ?c) ?x] 'dired-do-xterm-command)) (add-hook 'dired-load-hook '.set-dired-xterm-keybinding) -- Marco Parrone [0x45070AD6]