12

I've replaced doc-view mode with pdf-tools.

While it's easy to set a mark on a page with the mouse, how do you do it with the keyboard?

The readme mentions the feature. "* Mark a region and kill the text from the PDF."

The closest I've gotten is marking the whole page with M-x pdf-view-mark-whole-page.

Peter Becich
  • 289
  • 1
  • 10
  • 2
    You can search the source code, you will find some keybinding definition. Like: `(define-key map [down-mouse-1] 'pdf-view-mouse-set-region)`, and `(define-key map [M-down-mouse-1] 'pdf-view-mouse-set-region-rectangle)`, and `(define-key map [C-down-mouse-1] 'pdf-view-mouse-extend-region)`, `(when (eq (car e) 'drag-mouse-1)` etc. You can bind them to custom keybindings for yourself. – stardiviner Jul 04 '15 at 23:17

1 Answers1

10

That would require some notion of a cursor, which is currently not implemented. So marking by keyboard is not available (except the whole page).

politza
  • 3,316
  • 14
  • 16
  • How do you select the whole page? – xuhdev Apr 16 '16 at 03:46
  • 1
    I see, pdf-view-mark-whole-page – xuhdev Apr 16 '16 at 03:50
  • 2
    It can be achieved using avy. The file [pdf-avy-highlight.el](https://github.com/dalanicolai/dala-emacs-lisp/blob/master/pdf-avy-highlight.el) that can be found [here](https://github.com/dalanicolai/dala-emacs-lisp) uses avy to provide highlighting via the keyboard in pdf-tools. – dalanicolai Oct 07 '20 at 15:16