Skip to content

Commit

Permalink
replace lambda in `define-key' calls with named functions
Browse files Browse the repository at this point in the history
also, invert CxCc to CcCx.
  • Loading branch information
petermao committed Jun 13, 2023
1 parent 7b015ba commit 652521d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions modules/org-noter-pdf.el
Original file line number Diff line number Diff line change
Expand Up @@ -501,19 +501,20 @@ current heading inherit the COLUMN_EDGES property."

;;; override some deleterious keybindings in pdf-view-mode.
(define-key org-noter-doc-mode-map (kbd "C-c C-c")
(lambda ()
(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)))

(defun org-noter-pdf--execute-CxCc-in-notes ()
"Execute C-c C-x prefixed command in notes 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))))
(define-key org-noter-doc-mode-map (kbd "C-c C-x") 'org-noter-pdf--execute-CxCc-in-notes)
(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 <event> 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

0 comments on commit 652521d

Please sign in to comment.