emacs-devel
[Top][All Lists]
Advanced

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

Re: [Wish] xdg-open, open from dired


From: Gilaras Drakeson
Subject: Re: [Wish] xdg-open, open from dired
Date: Sat, 07 Nov 2009 19:13:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>> Could we (or Do we) have a command in dired that opens the current or
>> marked files using the user's preferred desktop application according to
>> the (fairly recent) freedesktop.org standards, (e.g. using xdg-open(1)).
>>
>> I bind it to `C-;', but `C-j' or `M-j' (comment-indent-new-line) seem to
>> be available, too.
>
> Could you please point to a specific page that shows what you want?

As far as I understand, `xdg-open', (fairly similar to what `open' does
on macosx), effectively does what "double clicking" on the file supplied
in its arguments would do.

I wish something like the following be blessed by the upstream Emacs:

(defun dired-open (&optional file-list)
  (interactive
   (list (dired-get-marked-files t current-prefix-arg)))
  (apply 'call-process "xdg-open" nil 0 nil file-list))
(define-key dired-mode-map (kbd "C-;") 'dired-open)

Also note that xdg-open may open URLs, so maybe something like 
"open file or url at point" (similar to ffap) is more appropriate.

Thanks,
Gilaras




reply via email to

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