From mboxrd@z Thu Jan 1 00:00:00 1970 From: Feng Shu Subject: Re: problems with org-protocol + capture templates Date: Wed, 17 Apr 2013 12:04:23 +0800 Message-ID: <871ua93irc.fsf@news.tumashu-localhost.org> References: <86boadu485.fsf@somewhere.org> <87li8ioom0.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USJbw-0005AZ-6t for emacs-orgmode@gnu.org; Wed, 17 Apr 2013 00:04:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USJbu-00048b-Nx for emacs-orgmode@gnu.org; Wed, 17 Apr 2013 00:04:44 -0400 Received: from mail-da0-x22f.google.com ([2607:f8b0:400e:c00::22f]:38754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USJbu-00048U-Ht for emacs-orgmode@gnu.org; Wed, 17 Apr 2013 00:04:42 -0400 Received: by mail-da0-f47.google.com with SMTP id s35so569776dak.20 for ; Tue, 16 Apr 2013 21:04:41 -0700 (PDT) Received: from feng by tumashu with local (Exim 4.80) (envelope-from ) id 1USJbb-00032x-A6 for emacs-orgmode@gnu.org; Wed, 17 Apr 2013 12:04:23 +0800 In-Reply-To: (Fabrice Popineau's message of "Tue, 16 Apr 2013 22:16:24 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Fabrice Popineau writes: > I use org-protocol with Chrome and Windows 8, emacs 24.3+ and some > recent Org mode. > I definitely can select the capture template. > I use emacsclientw.exe rather than emacs.exe to store the link. > It also means that emacs is already started and org-mode already > loaded. emacsclient don't creat a new frame by default, If you have no emacs frame, org-protocol for firefox is nearly useless. I use a bash wrap file "org-capture.sh" to launch emacs frame: #+begin_src=20 #!/bin/bash set -efu TEST=3D$(ps ax | grep "org-capture-for-firefox" | grep -v grep | wc -l) if [ $TEST =3D 1 ] ; then exec emacsclient $*; exit 0; else exec emacsclient -c -a '' -F '((name . "org-capture-for-firefox"))= ' $* exit 0; fi #+end_src > > Fabrice > > 2013/4/16 Bastien > > Hi S=E9bastien, >=20=20=20=20=20 > "Sebastien Vauban" >=20=20=20=20=20 >=20=20=20=20=20 > writes: >=20=20=20=20=20 > > Alvar Maciel wrote: > >> Hi to all, > >> I'm using org-mode as personal day planner with almost all the > >> configuration of http://doc.norang.ca/org-mode.html > >> I try to use org-protocol to send links to emacs using the > config of > >> worg. But when emacs open i can not select the template of the > >> capture mode (it's weird months ago was working) and i don't > know > >> were is my mistake. > >> this is my keybindidng > >> > >> var orgProtoString =3D 'org-protocol://capture://'+ > >> encodeURIComponent(gBrowser.currentURI.spec) + '/' + > >> encodeURIComponent(gBrowser.contentWindow.document.title) + '/' > + > >> encodeURIComponent(content.window.getSelection()); > >> > >> gBrowser.loadURI(orgProtoString); > >> > >> my capture template > >> > >> (setq org-capture-templates > >> (quote (("t" "todo" entry (file "~/en uso/2013/org/refile.org") > >> "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t) > >> ("r" "respond" entry (file "~/en uso/2013/org/refile.org") > >> "* NEXT Respond to %:from on %:subject\nSCHEDULED: > >> %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t) > >> ("n" "note" entry (file "~/en uso/2013/org/refile.org") > >> "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t) > >> ("j" "Journal" entry (file+datetree "~/Dropbox/en > >> uso/2013/org/diary.org") > >> "* %?\n%U\n" :clock-in t :clock-resume t) > >> ("w" "org-protocol" entry (file "~/en uso/2013/org/refile.org") > >> "* TODO Review %c\n%U\n" :immediate-finish t) > >> ("p" "Phone call" entry (file "~/en uso/2013/org/refile.org") > >> "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t) > >> ("h" "Habit" entry (file "~/en uso/2013/org/refile.org") > >> "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string > >> \"<%Y-%m-%d %a .+1d/3d>\")\n:PROPERTIES:\n:STYLE: > >> habit\n:REPEAT_TO_STATE: NEXT\n:END:\n")))) > > > > AFAIK, no, you can't dynamically select your template. >=20=20=20=20=20 >=20=20=20=20=20 > I'm not using org-protocol anymore but I certainly *do* remember > that > you can dynamically select a capture template. >=20=20=20=20=20 > So maybe Alvar's issue needs some investigation. >=20=20=20=20=20 > -- > Bastien --=20