Enhance eaf-org to support all applications (#301)

* make eaf-pdf-outline buffer read-only and bind "q" to close window

* create new file eaf-org.el

* Fix #279  Integrate with Org Mode

Support org-store-link and org-link-open.

Currently supported application is pdf-viewer only.

* remove old comments

* support all applications

* consider the case that `extra-args` is nil

* support js-video-player application and jump to timestamp

Co-authored-by: Andy Stewart <lazycat.manatee@gmail.com>
master
stardiviner 6 years ago committed by GitHub
parent a8a11a8ae4
commit ce3beed94d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      README.md
  2. 6
      README.zh-CN.md
  3. 18
      eaf-org.el

@ -204,8 +204,13 @@ Enable with
(require 'eaf-org)
```
- Support `org-store-link` and `org-link-open`
- Currently only support pdf-viewer app.
Support `org-store-link` and `org-link-open` mechanism.
Currently support following applications:
- pdf-viewer support jump to page number
- js-video-player support jump to video timestamp
- on theory supports all EAF applications without extra argument which has `eaf--buffer-url`
## EAF in the community

@ -201,6 +201,12 @@ eaf-evil 会动态查询 eaf 应用的按键绑定, 使得 evil 在 normal 模
(require 'eaf-org)
```
当前支持如下应用:
- pdf-viewer 跳转到记录的标记页面
- js-video-player 跳转到记录的视频时间戳
- 理论上支持所有EAF应用(只要应用有 `eaf--buffer-url` 参数值)
## EAF社区
下面列表列展示了EAF在Emacs社区的应用。如果我们遗漏你的应用,欢迎提交PR来加到下面列表中。

@ -47,9 +47,12 @@ The raw link looks like this: [[eaf:<app>::<path>::<extra-args>]]"
(url eaf--buffer-url)
(extra-args (cl-case (intern app)
('pdf-viewer
(eaf-call "call_function" eaf--buffer-id "current_page"))))
;; (eaf-call "call_function_with_args" eaf--buffer-id "store_session_data" (format "%s" page-num))
(link (concat "eaf:" app "::" url "::" extra-args))
(eaf-call "call_function" eaf--buffer-id "current_page"))
('js-video-player
(eaf-call "call_function" eaf--buffer-id "save_session_data"))))
(link (if extra-args
(concat "eaf:" app "::" url "::" extra-args)
(concat "eaf:" app "::" url)))
(description (buffer-name)))
(org-link-store-props
:type "eaf"
@ -64,10 +67,15 @@ The raw link looks like this: [[eaf:<app>::<path>::<extra-args>]]"
(extra-args (caddr list)))
(cl-case app
('pdf-viewer
;; TODO open the PDF file
(eaf-open url "pdf-viewer")
(eaf-call "call_function_with_args" eaf--buffer-id
"jump_to_page_with_num" (format "%s" extra-args))))))
"jump_to_page_with_num" (format "%s" extra-args)))
('js-video-player
(eaf-open url "js-video-player")
(eaf-call "call_function_with_args" eaf--buffer-id
"restore_session_data" (format "%s" extra-args)))
(t
(eaf-open url)))))
(org-link-set-parameters "eaf"
:follow #'eaf-org-open

Loading…
Cancel
Save