all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marco Parrone <marc0@autistici.org>
Subject: Re: Opening html-File in Dired with w3m
Date: Tue, 20 Jul 2004 15:17:03 GMT	[thread overview]
Message-ID: <87oema7lwf.fsf@marc0.dyndns.org> (raw)
In-Reply-To: 87u0w3kqex.fsf@ortler.iwr.uni-heidelberg.de

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	other threads:[~2004-07-20 15:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-20  8:56 Opening html-File in Dired with w3m Nicolas Neuss
2004-07-20 15:17 ` Marco Parrone [this message]
2004-07-27  8:45 ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oema7lwf.fsf@marc0.dyndns.org \
    --to=marc0@autistici.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.