emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastian Rose <sebastian_rose@gmx.de>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-protocol://remember:// question
Date: Thu, 02 Apr 2009 14:28:49 +0200	[thread overview]
Message-ID: <871vsb44u6.fsf@kassiopeya.MSHEIMNETZ> (raw)
In-Reply-To: <8763hn48gj.fsf@kassiopeya.MSHEIMNETZ> (Sebastian Rose's message of "Thu, 02 Apr 2009 13:10:36 +0200")

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

Hi,


there is no good way to access the title. The following path to
org-protocol.el is a work around for this. It simply kills the title
before the org-link. That way we could insert the title with

  C-y M-y



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 417 bytes --]

diff --git a/org-protocol.el b/org-protocol.el
index 4ca81ad..2ae87bc 100644
--- a/org-protocol.el
+++ b/org-protocol.el
@@ -345,6 +345,7 @@ Now template ?b will be used."
             (cons (list url title) org-stored-links))
       ;; FIXME can't access %a in the template -- how to set annotation?
       (raise-frame)
+      (kill-new title)
       (kill-new orglink)
       (set-buffer b)
       (insert region)

[-- Attachment #3: Type: text/plain, Size: 2907 bytes --]



I'd prefer to have some registers we could write to when calling
org-remember from code. That registers could be checked and emptied in
`org-remember-apply-template' like this:



   (defvar org-remember-template-values (make-hash-table))
    
   (defun org-remember-put-register(key val)
      "Put something in org-remember-template-values"
      (puthash key val org-remember-template-values))
    
   (defun org-remember-get-register(key)
      "Remove and retrieve some value from org-remember-template-values"
      (let ((ret (gethash key org-remember-template-values)))
        (puthash key nil org-remember-template-values)
        ret))

   .....

   (defun org-remember-apply-template 
   
     .....

	     (v-x (or (org-remember-get-register ?x) 
              (org-get-x-clipboard 'PRIMARY)
		      (org-get-x-clipboard 'CLIPBOARD)
		      (org-get-x-clipboard 'SECONDARY)))

       .....



How about that?



   Sebastian




Sebastian Rose <sebastian_rose@gmx.de> writes:
> Hi Tassilo,
>
>
> your right, the docs are wrong, Sorry for the inconvenience.
>
> Actually, I now understand Bastiens comment in org-annotation-helper.el:
>
> 	;; FIXME can't access %a in the template -- how to set annotation?
>
> I'll fix the table in the docs.
>
> I'll be back as soon as possible.
>
>    Sebastian
>
>
> Tassilo Horn <tassilo@member.fsf.org> writes:
>
>> Hi all,
>>
>> first I'd like to say that this is superb.  It'll deprecate my
>> home-brewn remember webpage hacks for conkeror soon. :-)
>>
>> Ok, now the problem I have: I defined a remember template for
>> remembering pages from my browser like that:
>>
>>
>> (setq org-default-notes-file "~/repos/org/remember.org"
>>       org-remember-default-headline 'bottom
>>       org-remember-templates
>>       '(;; TODOs
>>         ("TODO"    ?t "* TODO %?\n  (created: %U)\n  %i\n  %a")
>>         ("BROWSER" ?b "* BROWSER %a\n  (created: %U)\n\n  %A\n\n  %i")))
>>
>> When I execute
>>
>>   emacsclient \
>>   'org-protocol://remember://b/http:%2F%2Flocalhost%2Findex.html/The%20title/body'
>>
>> now I get a remember buffer with these contents:
>>
>>
>> * BROWSER
>>   (created: [2009-04-02 Thu 08:41])
>>
>>   
>>
>>   body
>>
>> Accorting to the template table at [1] I thought that the TITLE would be
>> filled in after BROWSER, and the [[URL][TITLE]] link between the
>> timestamp and the BODY.  But that's not the case.  The [[URL][TITLE]] is
>> on top of the kill-ring, though.
>>
>> What am I doing wrong?
>>
>> BTW: Has some Conkeror user managed to setup an org-protocol handler
>> yet?
>>
>> Bye,
>> Tassilo
>> __________
>> [1] http://orgmode.org/worg/org-contrib/org-protocol.php

-- 
Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover
Tel.:  +49 (0)511 - 36 58 472
Fax:   +49 (0)1805 - 233633 - 11044
mobil: +49 (0)173 - 83 93 417
Email: s.rose@emma-stil.de, sebastian_rose@gmx.de
Http:  www.emma-stil.de

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-04-02 12:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02  6:50 org-protocol://remember:// question Tassilo Horn
2009-04-02 11:10 ` Sebastian Rose
2009-04-02 12:28   ` Sebastian Rose [this message]
2009-04-02 16:03     ` Carsten Dominik
2009-04-02 16:03   ` Carsten Dominik
2009-04-02 18:00     ` Sebastian Rose
2009-04-03  7:47       ` Carsten Dominik
2009-04-03 12:06         ` Sebastian Rose
2009-04-03 12:34         ` Sebastian Rose
2009-04-03 16:58           ` Carsten Dominik
2009-04-03 22:59 ` Sebastian Rose
2009-04-04  9:42   ` Tassilo Horn
2009-04-04 13:39     ` Sebastian Rose
2009-04-04 17:36       ` Tassilo Horn

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=871vsb44u6.fsf@kassiopeya.MSHEIMNETZ \
    --to=sebastian_rose@gmx.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=tassilo@member.fsf.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).