Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keyboard navigation minor mode #39

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ef918a1
Add keyboard navigation minor mode
orgtre Aug 17, 2021
ee24789
Use pdf-view-midnight-colors as cursor rather than pdf-keynav-cursor
c1-g Aug 20, 2021
cf97043
Merge pull request #1 from c1-g/cursor
orgtre Aug 21, 2021
1f6844c
Add commands to create text annotations in the margins
orgtre Aug 21, 2021
44747ed
Fix custom group and types
andersjohansson Nov 29, 2021
7fae3da
Cleanup unused variables etc.
andersjohansson Nov 29, 2021
b2d8be6
Fix errors if some pdf libraries are not loaded
andersjohansson Nov 29, 2021
d26848f
Merge branch 'vedang:master' into master
orgtre Nov 30, 2021
bbce738
Merge pull request #2 from andersjohansson/keynav-fixes
orgtre Nov 30, 2021
c011fb8
Fix disabling of pdf-keynav-mode when pdf-sync is not loaded
andersjohansson Dec 6, 2021
13f5c0e
Merge pull request #3 from andersjohansson/fix-pdf-sync
orgtre Dec 23, 2021
29fb693
Merge branch 'master' into master
orgtre Jul 7, 2022
2f42e4d
Preliminary support for using the mouse pointer as cursor.
orgtre Jul 8, 2022
932582b
Usable support for using the mouse pointer as cursor.
orgtre Jul 8, 2022
6ff838e
Move pointer hiding into `pdf-keynav-minor-mode`.
orgtre Jul 8, 2022
f75d4b1
Fix error when a page contains no characters at all.
orgtre Jul 8, 2022
a4738b8
Exact positioning of pointer when it acts as cursor.
orgtre Jul 8, 2022
131b923
Make sure old cursor is hidden when `pdf-keynav-toggle-display-pointe…
orgtre Jul 8, 2022
1298ea4
Add an option to set point from pointer before commands run
orgtre Jul 8, 2022
5f0cfa2
Move pointer-as-cursor setup into its own minor mode
orgtre Jul 9, 2022
9ea2522
Don't start with pointer-as-cursor because of frame parameters bug
orgtre Jul 9, 2022
becd9bf
Update preamble
orgtre Jul 9, 2022
87cb5dc
Fix so that pointer is displayed, when necessary, after editing annot…
orgtre Jul 10, 2022
247cb5b
Fix minor bug when deactivating pdf-keynav-minor-mode
orgtre Jul 10, 2022
d448422
Make pointer follow `pdf-isearch-current-match`
orgtre Jul 10, 2022
151d755
Handle case where pointer outside window when setting point from pointer
orgtre Jul 10, 2022
94e9318
Refix minor bug when deactivating pdf-keynav-minor-mode
orgtre Jul 10, 2022
d3c134f
Merge branch 'master' into master
orgtre Jul 28, 2022
dd70d2a
Merge branch 'vedang:master' into master
orgtre Sep 19, 2022
e9a4fb4
Merge branch 'vedang:master' into master
orgtre Nov 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix custom group and types
andersjohansson committed Nov 29, 2021
commit 44747ed5053b58e54b6834499517f8f011eb38d2
24 changes: 6 additions & 18 deletions lisp/pdf-keynav.el
Original file line number Diff line number Diff line change
@@ -109,91 +109,81 @@


;; ** Custom
(defgroup pdf-keynav nil
"Keyboard navigation for PDF files."
:group 'pdf-tools)

(defcustom pdf-keynav-lazy-load t
"When non-nil load buffer-locals only when first needed on a pdf page.
With nil buffer-locals are loaded directly after a page change, which causes
page scrolling to be slower, while the first pdf-keynav command might feel a
bit quicker."
:group 'pdf-keynav
:type 'boolean)

(defcustom pdf-keynav-scroll-window t
"When non-nil scroll the window so that point is always visible."
:group 'pdf-keynav
:type 'boolean)

(defcustom pdf-keynav-scroll-left-margin 10
"Left margin in pixels between window edge and point after scrolling."
:group 'pdf-keynav
:type 'integer)

(defcustom pdf-keynav-scroll-right-margin 25
"Right margin in pixels between window edge and point after scrolling."
:group 'pdf-keynav
:type 'integer)

(defcustom pdf-keynav-no-find-closest-char nil
"If non-nil mouse selection commands do not search for closest character."
:group 'pdf-keynav
:type 'boolean)

(defcustom pdf-keynav-transient-mark-mode nil
"Non-nil enables `transient-mark-mode'-like region highlighting."
:group 'pdf-keynav
:type 'boolean)

(defcustom pdf-keynav-newline-cursor-dimensions '(0.01 . 0.015)
"Dimensions of the cursor when on a newline character.
Given as (WIDTH . HEIGHT) relative to the page dimensions.")
Given as (WIDTH . HEIGHT) relative to the page dimensions."
:type '(cons number number))

(defcustom pdf-keynav-continuous pdf-view-continuous
"When non-nil, reaching the page edges advances to next/previous page."
:group 'pdf-keynav
:type 'boolean)

(defcustom pdf-keynav-paragraph-parameters (list 0.01 0.02 2 5 1 1)
"List of parameters for determining paragraphs.
Should contain six numeric elements: (dyx-round-to dys-round-to
min-indent max-indent max-dx-discrepancy min-dy-discrepancy)
as described in `pdf-keynav-get-page-paragraphs', to which it is passed."
:group 'pdf-keynav
:type 'list)
:type '(list number number natnum natnum natnum))

(defcustom pdf-keynav-copy-filter-add-parbreaks t
"When non-nil add an extra linebreak at paragraph breaks in copied text.
Used by the function `pdf-keynav-copy-filter'."
:group 'pdf-keynav
:type 'boolean)

(defcustom pdf-keynav-copy-filter-remove-linebreaks t
"When non-nil replace single linebreaks with single spaces in copied text.
Used by the function `pdf-keynav-copy-filter'."
:group 'pdf-keynav
:type 'boolean)

(defcustom pdf-keynav-copy-region-separator "\n"
"The separator used between disconnected copied regions of text.
As constructed by `pdf-keynav-mouse-extend-region'."
:group 'pdf-keynav
:type 'string)

(defcustom pdf-keynav-copy-region-blink-delay copy-region-blink-delay
"Number of seconds to highlight copied text.
Highlighting happens when using `pdf-keynav-kill-ring-save',
unless the region is currently displayed. Set 0 to turn off completely."
:group 'pdf-keynav
:type 'number)

(defcustom pdf-keynav-select-map-prefix (kbd "e")
"The prefix to use for `pdf-keynav-select-map'."
:group 'pdf-keynav
:type 'string)

(defcustom pdf-keynav-annot-text-margin 10
"Margin between text annotation and closest text, in pixel.
Used by `pdf-keynav-annot-add-text-left'."
:group 'pdf-keynav
:type 'integer)

(defcustom pdf-keynav-sentence-end
@@ -236,7 +226,6 @@ necessarily followed by either a space or newline. Dots which follow a single
uppercase letter or 'p', or 'e.g', 'i.e', or 'et al' are ignored.

See the source code for a clearer breakdown of the different parts."
:group 'pdf-keynav
:type 'regexp)

(defcustom pdf-keynav-sentence-start
@@ -274,7 +263,6 @@ This is the reverse of `pdf-keynav-sentence-end' used for forward-matching on
the reversed string.

See the source code for a clearer breakdown of the different parts."
:group 'pdf-keynav
:type 'regexp)