all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Dired - open files external
Date: Tue, 13 May 2014 20:49:41 +0800	[thread overview]
Message-ID: <87siodzvve.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87fvke86q8.fsf@gmx.at

Martin <kleinerdrache@gmx.at> writes:

> Hi there,
>
> Dired works fine here, but I cannot figure out how to open the filex
> external.
>
> Special docx and pdf should be opened external, pdf not allways but
> mostly.  How can I do that?  (For docx - it does not make much sense for
> me to see the files inside, but open it with libreoffice would be quite
> good.)
>
> Thanks,
> Martin

I've found external-file programs to be one of the more gruesome
aspects of Emacs, with solutions ranging from mailcap to xdg-open.
Multiple packages demand their individual solutions. I have opted for
the scorched-earth policy, and tried to route absolutely everything
non-emacs through xdg-open. Then, at the very least, I have one point of
control. For dired, that looks like this:

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

;;'e' usually does 'dired-find-file, same as RET, rebinding it here
(add-hook 'dired-mode-hook
          '(lambda ()
            (define-key dired-mode-map (kbd "e") 'dired-open)))

(setq image-dired-external-viewer "/usr/bin/xdg-open")

Others will hopefully provide less extreme solutions!

Eric

This reminds me that one of my tasks for the next couple of days is
making org-open-file also a slave to xdg-open.




  reply	other threads:[~2014-05-13 12:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  7:42 Dired - open files external Martin
2014-05-13 12:49 ` Eric Abrahamsen [this message]
2014-05-13 13:13   ` Michael Heerdegen
2014-05-14  3:42     ` Eric Abrahamsen
2014-05-14 11:38       ` Michael Heerdegen
2014-05-13 12:58 ` Igor Sosa Mayor
2014-05-13 13:27 ` Igor Sosa Mayor
2014-05-13 13:59 ` Drew Adams

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=87siodzvve.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.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.