emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Jan Böcker" <jan.boecker@jboecker.de>
To: dmg@uvic.ca
Cc: emacs-orgmode@gnu.org
Subject: Re: patch to support remember in evince
Date: Wed, 03 Feb 2010 10:44:55 +0100	[thread overview]
Message-ID: <4B694597.7010909@jboecker.de> (raw)
In-Reply-To: <868wbed1ax.fsf@mn.cs.uvic.ca>

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

      reply	other threads:[~2010-02-03  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-31 10:19 patch to support remember in evince D M German
2010-02-03  9:44 ` Jan Böcker [this message]

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=4B694597.7010909@jboecker.de \
    --to=jan.boecker@jboecker.de \
    --cc=dmg@uvic.ca \
    --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).