help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening html-File in Dired with w3m


From: Marco Parrone
Subject: Re: Opening html-File in Dired with w3m
Date: Tue, 20 Jul 2004 15:17:03 GMT
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

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 <marc0@autistici.org> [0x45070AD6]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]