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

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

Re: Open file at point with external program


From: Andreas Politz
Subject: Re: Open file at point with external program
Date: Mon, 03 May 2010 23:15:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

michael <mchls5714@googlemail.com> writes:

> Hi,
>
> suppose I use emacs to edit a file which contains a path to a file,
> e.g. /path/to/file/file.pdf, suppose point is at the string /path/to/
> file/file.pdf, is it possible to open file.pdf with a single command
> using an *external* program (e.g. gnome-open)?
>
> thanks,
> michael

I abuse org-mode for doing this kind of thing in a dired-buffer.  I
suppose this can also work with,e.g. ffap :

(defun dired-open-file (arg)
  "Abuse org-open-file to open a file at point externally."
  (interactive "P")
  (require 'org)
  (require 'ffap)
  (org-open-file (or (ffap-guesser)
                     (error "No filename at point"))
                 arg))

-ap
                     

                     


reply via email to

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