From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: twiki Newsgroups: gmane.emacs.help Subject: Re: Launch application with region as a parameter Date: Tue, 7 Oct 2014 09:54:56 -0700 (PDT) Message-ID: <0d69accb-1d87-423b-afb3-cc0a9c3bac78@googlegroups.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1412700930 14211 80.91.229.3 (7 Oct 2014 16:55:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2014 16:55:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 07 18:55:23 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XbY2h-0005NS-2B for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Oct 2014 18:55:19 +0200 Original-Received: from localhost ([::1]:59926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbY2g-0008ET-PV for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Oct 2014 12:55:18 -0400 X-Received: by 10.50.115.40 with SMTP id jl8mr6479443igb.1.1412700897015; Tue, 07 Oct 2014 09:54:57 -0700 (PDT) X-Received: by 10.140.104.176 with SMTP id a45mr358237qgf.5.1412700896899; Tue, 07 Oct 2014 09:54:56 -0700 (PDT) Original-Path: usenet.stanford.edu!uq10no5862435igb.0!news-out.google.com!rp1ni22143igb.0!nntp.google.com!uq10no5862432igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=31.199.112.21; posting-account=wjp2oAoAAACzI4pv18VQXMxteESeFgB_ Original-NNTP-Posting-Host: 31.199.112.21 User-Agent: G2/1.0 Injection-Date: Tue, 07 Oct 2014 16:54:56 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:208052 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100328 Archived-At: 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 "") 'launch-command-at-point) ThanX!