-
-
Notifications
You must be signed in to change notification settings - Fork 353
Description
Is your feature request related to a problem? Please describe.:
It is best EPUB reader that I know. However, I can't capture references. Reason I use XPDF is that I can press single key and run external program which captures file name, page number, selection and similar.
Describe the solution you'd like:
I would like option to set up key binding so that I can run external program in similar way as xpdf.
For example I have in my ~/.xpdfrc
this option:
bind ctrl-c any endSelection "run(xpdf-capture-page.sh '%f' '%p')"
or
bind ctrl-o any endSelection "run(xpdfcapture.sh '%f' '%p' '%x' '%y' '%X' '%Y' '%u')"
which makes sure that I can run external program named
"xpdf-capture-page.sh" with parameters such as file and page number,
selection paremeters. Then I can decide by external program how to
capture and store the reference to the PDF file and page number
together with it's selection.
Here is the external program:
#!/bin/sh
file=$1
page=$2
emacsclient -e "(hyperscope-capture-xpdf-page \"$file\" \"$page\")"
The external function then recognizes the file, and stores the hyperlink in the database.
(defun hyperscope-capture-xpdf-page (filename-uuid page &optional p x y X Y u)
;; (message "%p %x %y %X %Y %u" p x y X Y u)
(let* ((filename-uuid (string-trim filename-uuid "'" "'"))
(basename (file-name-base filename-uuid))
(id (hyperscope-id-by-uuid basename)))
(rcd-unless id
(rcd-warning-message "Could not find ID for `%s'" filename-uuid)
(raise-frame)
(x-focus-frame nil)
(let* ((link (hyperscope-link-value id))
(subtype (hyperscope-subtype id))
(parent (hyperscope-parent id))
(text (gui-selection-value))
(name (hyperscope-name id))
(name (rcd-ask-get "Name of Hyperdocument: " name name)))
(cond (id (let ((new-id (hyperscope-add-generic name link nil 19 subtype parent page nil nil nil nil nil text)))
(hyperscope-isolate new-id)))
(t (rcd-warning-message "Could not capture Hyperdocument ID: %d, page %d" id page)))))))
It opens up and launches Emacs function, but I could launch any other function or do what I wish.
Reading books is important, but indexing specific sections of it even
more important, as that way I skip to browse through the
book.
It allows a collection of references by specification as given by Doug Engelbart in
TECHNOLOGY TEMPLATE PROJECT OHS Framework:
https://www.dougengelbart.org/content/view/110/460/
Describe alternatives you've considered:
The only alternative I have is `xpdf' which works perfect for that
purpose, but that one cannot handle EPUB documents.
Additional context
See video how it works with xpdf
: