Last active
November 12, 2018 14:35
-
-
Save ryseto/5710882 to your computer and use it in GitHub Desktop.
Emacs から Skim.app で開いている PDF の編集位置を表示させる関数(YaTeX 1.78 以降は標準のジャンプ機能で対応している)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Tsuchiya-san's corrections (yatex ML [yatex:04810,04811]) | |
(defun skim-forward-search () | |
(interactive) | |
(process-query-on-exit-flag | |
(start-process | |
"displayline" | |
nil | |
"/Applications/Skim.app/Contents/SharedSupport/displayline" | |
(number-to-string (save-restriction | |
(widen) | |
(count-lines (point-min) (point)))) | |
(expand-file-name | |
(concat (file-name-sans-extension (or YaTeX-parent-file | |
(save-excursion | |
(YaTeX-visit-main t) | |
buffer-file-name))) | |
".pdf")) | |
buffer-file-name))) | |
;;; Key bindings | |
;;; Command + r or C-c s | |
(add-hook 'yatex-mode-hook | |
'(lambda () | |
(require 'yatexprc) | |
(define-key YaTeX-mode-map [?\s-R] 'skim-forward-search) | |
(define-key YaTeX-mode-map (kbd "C-c s") 'skim-forward-search) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment