emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christopher Suckling <suckling.list@googlemail.com>
To: CHENG Gao <chenggao@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: org-mac-protocol problem - Initial content missing
Date: Mon, 03 Aug 2009 11:09:46 +0200	[thread overview]
Message-ID: <m24osp6z6t.fsf@gmail.com> (raw)
In-Reply-To: m2tz0qpoqd.fsf@cyberhut.org

On Sun, 02 Aug 2009 17:08:26 +0800, CHENG Gao <chenggao@gmail.com> 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 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.

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:

,----
| ...
| 
| 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

  reply	other threads:[~2009-08-03  9:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-01 18:59 org-mac-protocol problem - Initial content missing CHENG Gao
2009-08-02  8:37 ` Christopher Suckling
2009-08-02  9:08   ` CHENG Gao
2009-08-03  9:09     ` Christopher Suckling [this message]
2009-08-03  9:33       ` CHENG Gao
2009-08-03  9:45       ` CHENG Gao
2009-08-03 10:10         ` CHENG Gao
2009-08-03 12:11       ` CHENG Gao

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m24osp6z6t.fsf@gmail.com \
    --to=suckling.list@googlemail.com \
    --cc=chenggao@gmail.com \
    --cc=emacs-orgmode@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).