From mboxrd@z Thu Jan 1 00:00:00 1970 From: CHENG Gao Subject: Re: org-mac-protocol problem - Initial content missing Date: Sun, 02 Aug 2009 17:08:26 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXX8J-0003XN-Cg for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 05:13:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXX8E-0003KW-8I for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 05:13:34 -0400 Received: from [199.232.76.173] (port=57186 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXX8D-0003K2-Ua for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 05:13:29 -0400 Received: from main.gmane.org ([80.91.229.2]:59193 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXX8D-0004IM-Ch for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 05:13:29 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MXX87-0005gs-Rp for emacs-orgmode@gnu.org; Sun, 02 Aug 2009 09:13:23 +0000 Received: from 58.217.140.5 ([58.217.140.5]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 02 Aug 2009 09:13:23 +0000 Received: from chenggao by 58.217.140.5 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 02 Aug 2009 09:13:23 +0000 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: emacs-orgmode@gnu.org *On Sun, 02 Aug 2009 10:37:51 +0200 * Also sprach Christopher Suckling : > On Sun, 02 Aug 2009 02:59:29 +0800, CHENG Gao wrote: > >> I found "%i" in remember template doesn't work. In remember buffer I >> only get link to original page. Initial content is not inserted even >> though I selected them, and even I did "Command-c" after the content is >> selected. >> >> How could I get content remember instead of link? > > To be honest, there's not really enough information here to give an > effective answer. Here are two guesses: > > 1. Initial content is only supported from certain applications - > currently Safari, Skim, and (to a very limited extent) BibDesk. This is > due to the scope of the applications' AppleScript dictionaries. The > manual for org-mac-protocol provides a table of which applications are > supported by org-mac-protocol. > > 2. If the remember template or the note template is not creating a > remember buffer at all, the org-mac-protocol.el may not be loading > correctly because org-remember-templates has yet to be defined. I am > about to publish a small change to org-mac-protocol.el and the > documentation that will eliminate this problem. > > HTH, > > Christopher Thank you for your reply. Sorry I did not give enough information in previous posting. I am using Safari. I read the manual, and also read your scripts. I know which applications are supported. 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 location | ## 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'. | | * | | Source: [2009-08-02 Sun], [[http://orgmode.org/worg/org-contrib/org-protocol.php][org-protocol.el – 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) | | (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" (concat org-directory "notes.org") "Remember")) | (add-to-list 'org-remember-templates | '("AppleScript note" ?z "* %?\n\n Source: %u\n" (concat org-directory "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) | | (require 'org) | (define-key global-map "\C-cl" 'org-store-link) | (define-key global-map "\C-ca" 'org-agenda) | (setq org-log-done t) | `---- org-mac-protocol runs well, just initial content is not inserted. 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. -- Totus mundus agit histrionem