diff --git a/modules/org-noter-pdf.el b/modules/org-noter-pdf.el index ecf67bc..6546a38 100644 --- a/modules/org-noter-pdf.el +++ b/modules/org-noter-pdf.el @@ -499,5 +499,22 @@ current heading inherit the COLUMN_EDGES property." (select-window (org-noter--get-notes-window)) (org-entry-put nil "COLUMN_EDGES" (format "%s" (princ edge-list))))) +;;; override some deleterious keybindings in pdf-view-mode. +(define-key org-noter-doc-mode-map (kbd "C-c C-c") + (defun org-noter-pdf--execute-CcCc-in-notes () + "Override C-c C-c in pdf document buffer." + (interactive) + (select-window (org-noter--get-notes-window)) + (org-ctrl-c-ctrl-c))) + +(define-key org-noter-doc-mode-map (kbd "C-c C-x") + (defun org-noter-pdf--execute-CcCx-in-notes () + "Override C-c C-x in pdf document buffer." + (interactive) + (let ((this-CxCc-cmd (vector (read-event)))) + (select-window (org-noter--get-notes-window)) + (execute-kbd-macro + (vconcat (kbd "C-c C-x") this-CxCc-cmd))))) + (provide 'org-noter-pdf) ;;; org-noter-pdf.el ends here diff --git a/tests/org-noter-pdf-tests.el b/tests/org-noter-pdf-tests.el index 7de7d56..5873993 100644 --- a/tests/org-noter-pdf-tests.el +++ b/tests/org-noter-pdf-tests.el @@ -40,10 +40,30 @@ (expect (string-match "\\:HIGHLIGHT\\:" (buffer-string)) :not :to-be nil) (expect (string-match (format "%s" expected-highlight-info) (buffer-string)) :not :to-be nil) ) + ) + ) + ) + ) - )) + (describe "pdf keybinding overrides" + (it "C-c C-c called from a PDF document executes in the notes buffer" + ;; open `org-noter' session with PDF and notes - ) + ;; execute `C-c C-c' from document buffer + + ;; check that current window is notes-window, check that + ;; last command was `org-ctrl-c-ctrl-c' + ) + + (it "C-c C-x called from a PDF document executes in the notes buffer" + ;; open `org-noter' session with PDF and notes + + ;; execute `C-c C-x ' from document buffer, where + ;; \in {C-b, C-v, maybe a few others} + ;; check that current window is notes-window, check that + ;; last command corresponds to the keybinding of C-c C-x + ;; . + ) ) )