From: twiki <lap7619@yahoo.it>
To: help-gnu-emacs@gnu.org
Subject: Re: Launch application with region as a parameter
Date: Tue, 7 Oct 2014 09:54:56 -0700 (PDT) [thread overview]
Message-ID: <0d69accb-1d87-423b-afb3-cc0a9c3bac78@googlegroups.com> (raw)
In-Reply-To: <mailman.10652.1412699323.1147.help-gnu-emacs@gnu.org>
Ok... sorry for my terrible english :-(
I mean the following thing... my text-file is..
...
bla bla bla bla
bla bla bla bla
c:\dira\subdir a\document1.pdf (*)
bla bla bla bla
c:\dirb\subdir b\image.jpg (**)
bla bla bla
...
If i've the cursor on (*)... i want open Adobe Reader
on "c:\dira\subdir a\document1.pdf" and if i've the cursor on (**)...
i want open my Image Viewer on "c:\dirb\subdir b\image.jpg"
Thanks to the suggestions I had found the solution following:
(defun quote-string-for-shell ( string )
"quote-string-for-shell STRING
quote the string with \" for the shell. "
(concat "\"" string "\""))
(defun launch-command-at-point()
"Launch associate application for current thing-at-point string"
(interactive)
(w32-shell-execute "open" "explorer" (quote-string-for-shell (thing-at-point 'line))))
(global-set-key (kbd "<f11>") 'launch-command-at-point)
ThanX!
prev parent reply other threads:[~2014-10-07 16:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 15:33 Launch application with region as a parameter twiki
2014-10-06 17:01 ` Alexander Baier
2014-10-06 23:35 ` Tak Kunihiro
[not found] ` <mailman.10602.1412638553.1147.help-gnu-emacs@gnu.org>
2014-10-07 15:54 ` twiki
2014-10-07 16:28 ` Alexander Baier
[not found] ` <mailman.10652.1412699323.1147.help-gnu-emacs@gnu.org>
2014-10-07 16:54 ` twiki [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d69accb-1d87-423b-afb3-cc0a9c3bac78@googlegroups.com \
--to=lap7619@yahoo.it \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).