From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Suckling Subject: Re: Re: org-mac-protocol problem - Initial content missing Date: Mon, 03 Aug 2009 11:09:46 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXtYT-00012x-PZ for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 05:10:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXtYN-0000xx-QE for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 05:10:04 -0400 Received: from [199.232.76.173] (port=55529 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXtYM-0000xp-SI for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 05:09:58 -0400 Received: from mail-fx0-f226.google.com ([209.85.220.226]:43619) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXtYM-0001Qm-Cq for emacs-orgmode@gnu.org; Mon, 03 Aug 2009 05:09:58 -0400 Received: by fxm26 with SMTP id 26so729830fxm.42 for ; Mon, 03 Aug 2009 02:09:51 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: CHENG Gao Cc: emacs-orgmode@gnu.org On Sun, 02 Aug 2009 17:08:26 +0800, CHENG Gao wrote: > > For example, I visit the page: > http://orgmode.org/worg/org-contrib/org-protocol.php > > Then I run org-remember from script menu. The remember buffer I got is: > > > ,---- > | ## C-c C-c "~/.emacs.d/org/notes.org" -> "* Remember" > | ## C-u C-c C-c like C-c C-c, and immediately visit note at target loca= tion > | ## C-0 C-c C-c "???" -> "* ???" > | ## C-1 C-c C-c to select file and header location interactively. > | ## C-2 C-c C-c as child of the currently clocked item > | ## To switch templates, use `M-x org-remember'. To abort use `C-c C-k'. > |=20 > | *=20 > |=20 > | Source: [2009-08-02 Sun], [[http://orgmode.org/worg/org-contrib/org-p= rotocol.php][org-protocol.el =E2=80=93 Intercept calls from emacsclient to = trigger custom actions:Safari]] > `---- > > Only timestamp and link to source page. > > My settings are: > (I commented out remember template in org-mac-protocol and then put it > in ~/.emacs.d/init.el) > > ,---- > | ;;Org Mode > | (require 'org-mac-protocol) > | (server-start) > |=20 > | (setq org-directory "~/.emacs.d/org/") > | (setq org-default-notes-file "~/.emacs.d/org/notes.org") > | (setq org-remember-templates nil) > | (add-to-list 'org-remember-templates > | '("AppleScript remember" ?y "* %?\n\n Source: %u, %c\n\n %i" (c= oncat org-directory "notes.org") "Remember")) > | (add-to-list 'org-remember-templates > | '("AppleScript note" ?z "* %?\n\n Source: %u\n" (concat org-dire= ctory "notes.org") "Notes")) > | (setq remember-annotation-functions '(org-remember-annotation)) > | (setq remember-handler-functions '(org-remember-handler)) > | (add-hook 'remember-mode-hook 'org-remember-apply-template) > |=20 > | (require 'org) > | (define-key global-map "\C-cl" 'org-store-link) > | (define-key global-map "\C-ca" 'org-agenda) > | (setq org-log-done t) > |=20 > `---- > > org-mac-protocol runs well, just initial content is not inserted. I'm stumped. I can't see anything wrong with the above and an almost identical setup works for me. (I have come across a couple of web pages that don't like the scripts full stop, for example http://jan.ucc.nau.edu/tas3/bnf1.html, but that is not the case here) Suggested debug: Make sure that you're using the latest git org-mode. Open up org-remember.scpt and edit: ,---- | ... |=20 | display dialog theScript | do shell script theScript `---- Does theScript contain the expected content? You could also try running from the terminal: emacsclient org-protocol:/mac-remember:/y/foo/bar/test%20content:Safari and seeing whether `test content' is inserted as initial content > BTW, I suggest to put default remember templates in manual, instructing > users to explicitly set templates in .emacs. Users can choose to use > default templates or use their own. Quite so. Done. Christopher