[Wish] xdg-open, open from dired

View: New views
4 Messages — Rating Filter:   Alert me  

[Wish] xdg-open, open from dired

by Gilaras Drakeson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

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.

Thanks,
Gilaras




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

by Lennart Borgman (gmail) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Nov 7, 2009 at 4:55 PM, Gilaras Drakeson <gilaras@...> wrote:
> Hi,
>
> 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?



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

by Gilaras Drakeson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> 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



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

by Juri Linkov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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.

Are you aware that it's not recommended to use `xdg-open'
because it is unreliable.  Please see for more information:
http://thread.gmane.org/gmane.emacs.devel/111843/focus=112044

--
Juri Linkov
http://www.jurta.org/emacs/