Re: [Orgmode] org-annotation-helper
Hi Thiery, this is a problem of HTML. HTML has no linebreaks (or better: they are ignored). Since the browser doesn't know about the linebreaks, you simple get one line of text. Only lists are send with linebreaks it seems. For normal text this is no problem, just press `M-q' and everything is fine (still anoying when copying source code though). Sebastian thierry.volpia...@gmail.com writes: Hi all, I use org-annotation-helper.el with firefox. When i have a region with multilines marked in firefox and i use remember, the region is sended to emacs but on one line (the newlines are removed). Somebody know how to fix that? Thanks. ___ 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
Re: [Orgmode] org-annotation-helper
On Sun, 31 Aug 2008 12:19:23 +0200, Richard G Riley [EMAIL PROTECTED] said: caveat : I do not know if this is optimal or even recommended but it now works for me. I have modified the code a little to remove hex from the actual link. I have boxquoted all code so you will need to remove that. firefox/iceweasel : To set up the bookmark link, simple create a new book mark called remember in firefox and make this the location code: , | javascript:location.href='remember://%20'+location.href+'%1C'+escape(document.title)+'%1C'+escape(window.getSelection()) ` I have a slightly different link, which works too: javascript:location.href='remember://'+location.href+'::remember::'+escape(document.title)+'::remember::'+escape(window.getSelection()) On the subject of org-annotation-helper, the code has this comment about %a: | ;; FIXME can't access %a in the template -- how to set annotation? (raise-frame) While I was trying to make this work, using a slightly earlier version, I found that the %a would work if I had an active region selected at the time. Before I could find out how to make a region active, or stop it being needed, I found the new version of the code, and now I use %:region. But it would be interesting to know why org-mode tests for there being an active region; it seems to do it quite a lot. You need an active region to convert a table with C-c |, for instance. Carsten, is there any reason why it works this way? Peter. ___ 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
Re: [Orgmode] org-annotation-helper
On Sep 1, 2008, at 1:20 PM, Peter Westlake wrote: On Sun, 31 Aug 2008 12:19:23 +0200, Richard G Riley [EMAIL PROTECTED] said: caveat : I do not know if this is optimal or even recommended but it now works for me. I have modified the code a little to remove hex from the actual link. I have boxquoted all code so you will need to remove that. firefox/iceweasel : To set up the bookmark link, simple create a new book mark called remember in firefox and make this the location code: , | javascript:location.href='remember://%20'+location.href +'%1C'+escape(document.title)+'%1C'+escape(window.getSelection()) ` I have a slightly different link, which works too: javascript:location.href='remember://'+location.href +'::remember::'+escape(document.title) +'::remember::'+escape(window.getSelection()) On the subject of org-annotation-helper, the code has this comment about %a: | ;; FIXME can't access %a in the template -- how to set annotation? (raise-frame) While I was trying to make this work, using a slightly earlier version, I found that the %a would work if I had an active region selected at the time. Before I could find out how to make a region active, or stop it being needed, I found the new version of the code, and now I use %:region. But it would be interesting to know why org-mode tests for there being an active region; it seems to do it quite a lot. You need an active region to convert a table with C-c |, for instance. Carsten, is there any reason why it works this way? Hi Peter, how else should Org know the range of lines to convert? Or maybe I misunderstand your question? - Carsten ___ 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
Re: [Orgmode] org-annotation-helper
On Mon, 1 Sep 2008 13:27:18 +0200, Carsten Dominik [EMAIL PROTECTED] said: On the subject of org-annotation-helper, the code has this comment about %a: | ;; FIXME can't access %a in the template -- how to set annotation? (raise-frame) While I was trying to make this work, using a slightly earlier version, I found that the %a would work if I had an active region selected at the time. Before I could find out how to make a region active, or stop it being needed, I found the new version of the code, and now I use %:region. But it would be interesting to know why org-mode tests for there being an active region; it seems to do it quite a lot. You need an active region to convert a table with C-c |, for instance. Carsten, is there any reason why it works this way? Hi Peter, how else should Org know the range of lines to convert? Or maybe I misunderstand your question? If I use C-space to place the mark at the beginning of the table, and move point to the end, then the region covers the table, and I would expect C-c | to operate on the region. Instead, it ignores the region and asks what size table to make. If I highlight a region using the mouse, then it works. Peter. ___ 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
Re: [Orgmode] org-annotation-helper
I have found that the released code is wrong. I got it working for a short while by following the instructions at the following link but tiny little issues like the formatting of the javascript cause some cut and paste issues and can easily break the system. In addition, when I create my remember bookmakr if I select load this bookmark in the sidebar it stops working completely. http://www.mail-archive.com/emacs-orgmode@gnu.org/msg06608.html I will find out what the hiccup is today and post an update. Nick Dokos [EMAIL PROTECTED] writes: Richard G Riley [EMAIL PROTECTED] wrote: Can someone please confirm they have org-annotation-helper working with Firefox/Iceweasel 3? I have not been able to get org-annotation-helper working at all w/Firefox 3. I get an unhandled exception in Javascript at the browser, don't know why: Error: uncaught exception: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: javascript:location.href='remember://'+location.href+'::remember::'+escape(document.title)+'::remember::'+escape(window.getSelection()) :: TOP_LEVEL :: line 1 data: no] One of these years, I hope to get some time to dig deeper. For now, it's been back to copy-n-paste for me. Sorry I can't help, Nick If I type remember://hello in the address bar it works fine. If, however I click my bookmark with the following as the location then I get about:blank as the embedded link in my new remember buffer: javascript:location.href='remember://' + location.href + '::remember::' + escape(document.title) + '::remember::' + escape(window.getSelection()) What could be wrong? ___ 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 -- ___ 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
Re: [Orgmode] org-annotation-helper
caveat : I do not know if this is optimal or even recommended but it now works for me. I have modified the code a little to remove hex from the actual link. I have boxquoted all code so you will need to remove that. firefox/iceweasel : To set up the bookmark link, simple create a new book mark called remember in firefox and make this the location code: , | javascript:location.href='remember://%20'+location.href+'%1C'+escape(document.title)+'%1C'+escape(window.getSelection()) ` This is as simple as right click on your bookmark toolbar and create new. Do *not* select load this bookmark in the sidebar - when I selected this then links and region did not pass to the protocol handler discussed in the comments below. I have no idea why and if someone could explain why this should be I would be grateful. Follow the instructions in the code to set up the shell script and the protocol registry to handle the protocol when you click on the remember bookmark. I would advise ignoring all annotation stuff and just concentrate getting remember working for now. The org-remember-template I now use is (note the addition of %:link which shows the physical http link) , | (Web-Link ?w * %c \n :PROPERTIES: \n :Entered: %U\n :END: \n\n - link: %:link\n - Quote:\n%:region\n - End Quote\n\n %?\n bookmarks.org Unfiled Clips) ` Using linux with X, I also modified the remember shell script to use wmctl to bring emacs to the foreground. I also reformatted the location codes to be on a single line. , | ;;; org-annotation-helper.el --- start remember from a web browser | ;; | ;; Author: bzg AT altern DOT org | ;; Keywords: org remember | ;; | ;;; Commentary: | ;; | ;; [bzg:] This is an adapted version of the planner-mode extension the | ;; was first posted by Geert Kloosterman [EMAIL PROTECTED] on | ;; the Planner mailing list. All comments below are his. | ;; | ;; We want to be able to pass a URL and document title directly from a | ;; web browser to Emacs. | ;; | ;; We define a remember:// url handler in the browser and use a shell | ;; script to handle the protocol. This script passes the information | ;; to a running Emacs process (using emacsclient/gnuclient). We use | ;; bookmarklets to create the remember:// urls dynamicly. | ;; | ;; The protocol types currently recognized are: | ;; | ;; remember:// start `remember' with the url and title filled in | ;; annotation:// similar to `planner-annotation-as-kill' (org?) | ;; | ;; The urls used internally will have the following form: | ;; | ;; remember://the web page url%1Cthe title | ;; | ;; The title will be url-hex-encoded. %1C is the (url-encoded) low | ;; ascii value for the field separator. | ;; | ;; | ;; The bookmarklets: | ;; | ;; javascript:location.href='remember://' + location.href + '%1C' + escape(document.title) + '%1C' + escape(window.getSelection()) | ;; javascript:location.href='annotation://' + location.href + '%1C' + escape(document.title) | ;; | ;; The helper script: | ;; | ;;#!/bin/sh | ;;# remember -- pass a remember-url to emacs | ;;# | ;;# Author: Geert Kloosterman [EMAIL PROTECTED] | ;;# Date: Sat Nov 19 22:33:18 2005 | ;;# | ;;# modified 31 Aug 2008 rgr : added call to wmctrl to bring emacs to the foreground | ;;# | ;; | ;;if [ -z $1 ]; then | ;;echo $0: Error: no arguments given! 12 | ;;exit 1 | ;;fi | ;; | ;;# To test uncomment following line | ;;#echo $1 /tmp/remember.out | ;;wmctrl -a emacs22 | ;;emacsclient --eval (progn (bzg/org-annotation-helper \$1\ ) nil) | ;; | ;;# EOF | | ;; Adding a protocol handler | ;; - | ;; | ;; Firefox | ;; | ;; To add a protocol handler (eg: remember://) in Firefox, take the | ;; following steps: | ;; | ;; - type in about:config in the location bar | ;; - right click, select New -- String | ;; - the name should be network.protocol-handler.app.remember | ;; - the value should be the executable, eg. remember. | ;; At least under Linux this does not need to be the full path to | ;; the executable. | ;; | ;; See http://kb.mozillazine.org/Register_protocol for more details. | ;; | ;; Opera | ;; | ;; In Opera add the protocol in the Preferences-Advanced-Programs | ;; dialog. | | | ;; Code: | | (require 'url) | | (autoload 'url-unhex-string url) | | (defun bzg/org-annotation-helper (info) | (interactive) | Process an externally passed remember:// style url. | | URLSTRING consists of a protocol part and a url and title, | separated by %1C. | | The protocol types currently recognized are: | | remember:// start `remember' with the url and title | annotation:// similar to `org-annotation-as-kill'. | (let ((remember-annotation-functions nil)) | ;; The `parse-url' functions break on the embedded url, | ;; since our format is fixed we'll split the url ourselves. | (if (string-match ^\\([^:]*\\):\\(/*\\)\\(.*\\) info) | (let* ((proto (match-string 1 info)) | (url_title_region
Re: [Orgmode] org-annotation-helper
Richard G Riley [EMAIL PROTECTED] wrote: Can someone please confirm they have org-annotation-helper working with Firefox/Iceweasel 3? I have not been able to get org-annotation-helper working at all w/Firefox 3. I get an unhandled exception in Javascript at the browser, don't know why: Error: uncaught exception: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: javascript:location.href='remember://'+location.href+'::remember::'+escape(document.title)+'::remember::'+escape(window.getSelection()) :: TOP_LEVEL :: line 1 data: no] One of these years, I hope to get some time to dig deeper. For now, it's been back to copy-n-paste for me. Sorry I can't help, Nick If I type remember://hello in the address bar it works fine. If, however I click my bookmark with the following as the location then I get about:blank as the embedded link in my new remember buffer: javascript:location.href='remember://' + location.href + '::remember::' + escape(document.title) + '::remember::' + escape(window.getSelection()) What could be wrong? ___ 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 ___ 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
Re: [Orgmode] org-annotation-helper
On May 18, 2008, at 11:38 PM, John Rakestraw wrote: Hi Dan, Carsten, Alan and others -- Dan, thanks for following up on this. Carsten, I'm happy to have this added to the contrib/lisp directory. However, I really shouldn't be listed in the code as an author. Fixed, thanks. - Carsten Bastien did the initial adaptations of the code from the emacs-planner list. I sent it to the list in response to Dan's query, but I think the only tweak I added to the code (it's been months, so I'm not sure) was to comment out one line that seemed redundant to me. These other guys are the coders. Alan, just to reinforce Dan's encouragement -- I remember being a little puzzled when I first tried to set this up, but the perseverance was well worth it -- it's been a great tool to get annotated links into an org file collection. You're right, there are three bits of code -- the bookmarklets added to your browser, the shell script that Dan calls the handler, and the org-annotation-helper.el module. Then you have your org-remember template, but you don't even have to write that -- just use Dan's. To set it all up, just work through Dan's step-by-step listed in the commentary on the code. It's not nearly as complicated as you might think -- and you can come back with particular questions if you encounter problems. (Don't mean to be pushy or glib -- just a satisfied user) --John Hi, I have now added this file to the contrib/lisp directory. If any of the authors does not agree with thi, please let me know. - Carsten On May 17, 2008, at 2:16 AM, Daniel M German wrote: hi everybody, I took the liberty of updating the elisp file that John Rakestraw sent last week. I (think) have improved a bit and the description should be easier to follow. I have also made it possible to insert the selected text into the current buffer (the code was there, I just had to grab it). One major change: i have replaced the separator from %1C to ::remember:: (the %1C never worked for me). Let me know if you have questions/problems. http://turingmachine.org/~dmg/temp/org-annotation-helper.el -- -- Daniel M. German http://turingmachine.org/ http://silvernegative.com/ dmg (at) uvic (dot) ca replace (at) with @ and (dot) with . ___ 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 ___ 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 -- John Rakestraw ___ 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 ___ 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
Re: [Orgmode] org-annotation-helper
Hi Dan, Carsten, Alan and others -- Dan, thanks for following up on this. Carsten, I'm happy to have this added to the contrib/lisp directory. However, I really shouldn't be listed in the code as an author. Bastien did the initial adaptations of the code from the emacs-planner list. I sent it to the list in response to Dan's query, but I think the only tweak I added to the code (it's been months, so I'm not sure) was to comment out one line that seemed redundant to me. These other guys are the coders. Alan, just to reinforce Dan's encouragement -- I remember being a little puzzled when I first tried to set this up, but the perseverance was well worth it -- it's been a great tool to get annotated links into an org file collection. You're right, there are three bits of code -- the bookmarklets added to your browser, the shell script that Dan calls the handler, and the org-annotation-helper.el module. Then you have your org-remember template, but you don't even have to write that -- just use Dan's. To set it all up, just work through Dan's step-by-step listed in the commentary on the code. It's not nearly as complicated as you might think -- and you can come back with particular questions if you encounter problems. (Don't mean to be pushy or glib -- just a satisfied user) --John Hi, I have now added this file to the contrib/lisp directory. If any of the authors does not agree with thi, please let me know. - Carsten On May 17, 2008, at 2:16 AM, Daniel M German wrote: hi everybody, I took the liberty of updating the elisp file that John Rakestraw sent last week. I (think) have improved a bit and the description should be easier to follow. I have also made it possible to insert the selected text into the current buffer (the code was there, I just had to grab it). One major change: i have replaced the separator from %1C to ::remember:: (the %1C never worked for me). Let me know if you have questions/problems. http://turingmachine.org/~dmg/temp/org-annotation-helper.el -- -- Daniel M. German http://turingmachine.org/ http://silvernegative.com/ dmg (at) uvic (dot) ca replace (at) with @ and (dot) with . ___ 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 ___ 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 -- John Rakestraw ___ 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
Re: [Orgmode] org-annotation-helper
Hi, I have now added this file to the contrib/lisp directory. If any of the authors does not agree with thi, please let me know. - Carsten On May 17, 2008, at 2:16 AM, Daniel M German wrote: hi everybody, I took the liberty of updating the elisp file that John Rakestraw sent last week. I (think) have improved a bit and the description should be easier to follow. I have also made it possible to insert the selected text into the current buffer (the code was there, I just had to grab it). One major change: i have replaced the separator from %1C to ::remember:: (the %1C never worked for me). Let me know if you have questions/problems. http://turingmachine.org/~dmg/temp/org-annotation-helper.el -- -- Daniel M. German http://turingmachine.org/ http://silvernegative.com/ dmg (at) uvic (dot) ca replace (at) with @ and (dot) with . ___ 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 ___ 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