From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Jan_B=F6cker?= Subject: Re: patch to support remember in evince Date: Wed, 03 Feb 2010 10:44:55 +0100 Message-ID: <4B694597.7010909@jboecker.de> References: <868wbed1ax.fsf@mn.cs.uvic.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ncbne-0001dw-5D for emacs-orgmode@gnu.org; Wed, 03 Feb 2010 04:45:30 -0500 Received: from [199.232.76.173] (port=51943 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ncbnd-0001dT-C1 for emacs-orgmode@gnu.org; Wed, 03 Feb 2010 04:45:29 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ncbnb-0003wY-Qp for emacs-orgmode@gnu.org; Wed, 03 Feb 2010 04:45:29 -0500 Received: from mail7.worldserver.net ([217.13.200.27]:58037) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NcbnZ-0003vW-5l for emacs-orgmode@gnu.org; Wed, 03 Feb 2010 04:45:25 -0500 In-Reply-To: <868wbed1ax.fsf@mn.cs.uvic.ca> 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: dmg@uvic.ca Cc: emacs-orgmode@gnu.org On 31.01.2010 11:19, D M German wrote: > > here is a patch to support remember inside evince. > > http://turingmachine.org/~dmg/temp/0001-Added-support-for-xournal-but-docview-linking-needs-.patch Hi Daniel, sorry for my late reply, I have just caught up with the list again. The patch works for me, but as in your patch for xournal, there is a problem with non-ASCII characters. An "ü" arrives in emacs as "%C3%BC", which are the two URL-encoded bytes which make up the character in UTF-8. I don't know if this one is a bug in org-protocol, though, because AFAIK unix filenames are just a bunch of bytes and evince might not be able to find out what the encoding is supposed to be. > I tried to pass the text selection to remember, but it does not > work (org-protocol://remember://docview:filename::pagenumber::selection). > > Looking at the code of org-docview.el I can see that its code does not > support splitting the selection. I suspect this is a minor change > required. Any suggestions on how to change it? As I already indicated in the "Protocol for PDFs" thread, I realized that docview: is just a syntax for specialized file: links. Take a look at the following patch I posted to the mailing list two weeks ago: http://thread.gmane.org/gmane.emacs.orgmode/21474 This allows you to define customized file: links. These are some entries from my org-file-apps variable: Extension: \.pdf\' Command: evince "%s" Extension: \.pdf::\([0-9]+\)\' Command: evince -p %1 "$s" Extension: \.xoj\' Command: /home/jan/.local/bin/xournal %s Extension: \.xoj::\([0-9]+\)\' Command: /home/jan/.local/bin/xournal -p %1 %s This allows me to link to PDFs and Xournal files using normal file: links, both with and without page numbers. You could easily define a custom regexp which captures the page number and the selection with groups, then uses them in a command as %1 and %2. You can also use the groups in custom lisp forms, like this: Extension: \.pdf::\(.*\)::\(.*\)\' Lisp form: (progn (message (concat "Page Number: " (match-string 1 link))) (message (concat "Selection: " (match-string 2 link))) (message (concat "File Name: " file))) HTH, Jan