From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org-protocol://remember:// question Date: Fri, 3 Apr 2009 09:47:47 +0200 Message-ID: References: <87ocvfh7lc.fsf@thinkpad.tsdh.de> <8763hn48gj.fsf@kassiopeya.MSHEIMNETZ> <1B37177B-3E1E-41CF-BAB7-85EB815432F1@gmail.com> <87ocvfgclq.fsf@kassiopeya.MSHEIMNETZ> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lpf50-0002L4-FL for emacs-orgmode@gnu.org; Fri, 03 Apr 2009 04:48:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lpf4x-0002JW-06 for emacs-orgmode@gnu.org; Fri, 03 Apr 2009 04:48:50 -0400 Received: from [199.232.76.173] (port=49675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lpf4w-0002JS-Mw for emacs-orgmode@gnu.org; Fri, 03 Apr 2009 04:48:46 -0400 Received: from mail-ew0-f160.google.com ([209.85.219.160]:48340) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lpf4v-0002sS-T1 for emacs-orgmode@gnu.org; Fri, 03 Apr 2009 04:48:46 -0400 Received: by ewy4 with SMTP id 4so954704ewy.42 for ; Fri, 03 Apr 2009 01:48:45 -0700 (PDT) In-Reply-To: <87ocvfgclq.fsf@kassiopeya.MSHEIMNETZ> 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: Sebastian Rose Cc: Tassilo Horn , emacs-orgmode@gnu.org On Apr 2, 2009, at 8:00 PM, Sebastian Rose wrote: > Carsten Dominik writes: >> Hi Sebastian, Tassilo, >> >> this can be easily fixed. >> >> Org-protocol may add arbitrary properties to the link properties. >> For example, after a call >> >> (org-store-link-props :type type >> :link url >> :region region >> :description title >> :hello "Hello world") >> >> a template could use "%:hello" to access and insert this >> string. I have just changed org-remember so that the >> property :annotation will be the default for %a. >> Sebastian, could you please add >> >> :annotation (concat "[[" url "][" title "]]") >> >> or something similar to the call to org-store-link-props? >> >> Also, feel free to add any other properties that might >> provide useful information for a template. > > > Doesn't that apply to certain link types only? > > Also, the situation seems to be different for org-protocol-remember. I > think it's the way remember is used inside that function that has to > be > changed. > Maybe I can figure that out. Sorry my mistake. Indeed, the way you call org-remember overwrites the link property list. What you need to do is this: (let (remember-annotation-functions) (org-remember nil (string-to-char template))) Now, another advantage of doing it like this is that you do not even have to create a temporary buffer from which you launch org-remember. Right now you do this, only for the effect to get the region inserted for %i. Much easier will not be to set the :initial property in the call to org-store-link-props. Thus, don't even create the *org-protocol* buffer and then do this: (org-store-link-props :type type :link url :annotation (concat "[[" url "][" title "]]") :initial (or region "") :description title) (setq org-stored-links (cons (list url title) org-stored-links)) (raise-frame) (kill-new orglink) (let (remember-annotation-functions) (org-remember nil (string-to-char template))) I hope that this will take care of it. - Carsten