emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* patch to support remember in evince
@ 2010-01-31 10:19 D M German
  2010-02-03  9:44 ` Jan Böcker
  0 siblings, 1 reply; 2+ messages in thread
From: D M German @ 2010-01-31 10:19 UTC (permalink / raw)
  To: emacs-orgmode


here is a patch to support remember inside evince.

http://turingmachine.org/~dmg/temp/0001-Added-support-for-xournal-but-docview-linking-needs-.patch 

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?


-- 
--
Daniel M. German                  
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: patch to support remember in evince
  2010-01-31 10:19 patch to support remember in evince D M German
@ 2010-02-03  9:44 ` Jan Böcker
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Böcker @ 2010-02-03  9:44 UTC (permalink / raw)
  To: dmg; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-03  9:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-31 10:19 patch to support remember in evince D M German
2010-02-03  9:44 ` Jan Böcker

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).