From 98d13f74291b5fa1febb5ec1a96cf569504eb8cc Mon Sep 17 00:00:00 2001 From: stardiviner Date: Sun, 24 May 2020 13:54:16 -0400 Subject: [PATCH] Fix web browser org-link open issue (#303) Squashed commit of the following: commit 1f891ed81088c9c0e07b668c7536ef84d84ba72b Author: stardiviner Date: Sun May 24 21:00:52 2020 +0800 filter temp converted PDF files commit 767ce0ee6d4399592cd5eaabd386b1c6f7538ff1 Author: stardiviner Date: Sun May 24 20:58:46 2020 +0800 support EAF app mindmap for org-link commit a700a087c164f3008011c6d14568e5c3b00ac5a1 Author: stardiviner Date: Sun May 24 20:33:02 2020 +0800 support web browser for org-link commit 3bc267dbc3434c8c9d763733cac9505a9e7db766 Merge: a87d2d3 bd3a083 Author: stardiviner Date: Sun May 24 20:32:47 2020 +0800 Merge branch 'master' into eaf-org commit bd3a0837384574d854ae03ca1ad61667d3c9340c Merge: cea9353 ce3beed Author: stardiviner Date: Sun May 24 20:01:30 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit a87d2d3a1b1272779c5f4921eafff8c85a46c2de Author: stardiviner Date: Sun May 24 18:45:07 2020 +0800 support js-video-player application and jump to timestamp commit 267e4f276f303aaf843042ac9378d2b51c3ff4f3 Author: stardiviner Date: Sun May 24 18:44:45 2020 +0800 consider the case that `extra-args` is nil commit 0a9eb57a9682cd7cba19539c365309bef10c1f18 Author: stardiviner Date: Sun May 24 18:43:45 2020 +0800 support all applications commit a2b6c5cd754e24b5fe0c68baa72b7a1f08711b23 Author: stardiviner Date: Sun May 24 18:43:06 2020 +0800 remove old comments commit 225baaadd3deea720e1fceb40fa52b3a730a9ac3 Merge: 06a6b9d cea9353 Author: stardiviner Date: Sun May 24 18:42:33 2020 +0800 Merge branch 'master' into eaf-org commit cea93538071e73790c3820d377aca285e1dd6441 Merge: bb24601 a8a11a8 Author: stardiviner Date: Sun May 24 17:41:00 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit 06a6b9d44f2b7a3bef1fd6b936002dbf49e6596c Author: stardiviner Date: Sun May 24 10:42:53 2020 +0800 Fix #279 Integrate with Org Mode Support org-store-link and org-link-open. Currently supported application is pdf-viewer only. commit bac840d2f293e9c1ee9b9fdca40fcefa7d421eb5 Author: stardiviner Date: Sun May 24 09:50:50 2020 +0800 create new file eaf-org.el commit bb2460105e69f4f0a87aabdeb9518359a970e40e Merge: 27a3000 21344be Author: stardiviner Date: Sun May 24 09:30:02 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit 27a30005662330d288e539c6f257186972b107fb Author: stardiviner Date: Sun May 24 08:29:39 2020 +0800 make eaf-pdf-outline buffer read-only and bind "q" to close window commit f2c59a4c867fa5dda6618e63e77379cdbd3cbf4f Merge: 792ba7f 314278c Author: stardiviner Date: Sat May 23 00:02:14 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit 792ba7f8396ae5b1c9f16ecdbe406ca75f98a5be Merge: cdfb77c ef88237 Author: stardiviner Date: Sat May 16 22:30:54 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit cdfb77ca845c07be22ccb9777f8882efbba950a5 Merge: 1b29918 7198bf8 Author: stardiviner Date: Thu May 14 12:28:30 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit 1b29918bd30c47e9862f33be09389d01b55bcf42 Merge: c55ad5c 0107260 Author: stardiviner Date: Tue May 12 06:24:07 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit c55ad5c32186d0f25c14371fa08c5651229375d8 Merge: c6d5162 b29dcfd Author: stardiviner Date: Sun May 3 21:10:54 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit c6d5162eb47327a5a8a87ceeb467d59efa83453b Merge: ce8ef97 f4d2aba Author: stardiviner Date: Wed Apr 29 19:48:57 2020 +0800 Merge branch 'master' of https://github.com/manateelazycat/emacs-application-framework commit ce8ef9744ab43a8ead1ce4801c46579913912caa Merge: 1633573 523685f Author: Andy Stewart Date: Sat Apr 18 15:02:41 2020 +0800 Merge pull request #281 from luhuaei/master pdf-viewer: fix don't select text on first page --- README.md | 1 + README.zh-CN.md | 1 + eaf-org.el | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 51f51e2..a5e02ea 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,7 @@ Support `org-store-link` and `org-link-open` mechanism. Currently support following applications: +- web browser support - 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` diff --git a/README.zh-CN.md b/README.zh-CN.md index 5049bcb..4ea3f05 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -203,6 +203,7 @@ eaf-evil 会动态查询 eaf 应用的按键绑定, 使得 evil 在 normal 模 当前支持如下应用: +- web browser 链接支持 - pdf-viewer 跳转到记录的标记页面 - js-video-player 跳转到记录的视频时间戳 - 理论上支持所有EAF应用(只要应用有 `eaf--buffer-url` 参数值) diff --git a/eaf-org.el b/eaf-org.el index b620366..8aa199a 100644 --- a/eaf-org.el +++ b/eaf-org.el @@ -44,7 +44,10 @@ The raw link looks like this: [[eaf:::::]]" (interactive) (when (eq major-mode 'eaf-mode) (let* ((app eaf--buffer-app-name) - (url eaf--buffer-url) + ;; filter temp files which is converted to PDF + (url (if (string-prefix-p "/tmp/" eaf--buffer-url) + (warn "[EAF] don't support this application link which is converted to temporary PDF file.") + eaf--buffer-url)) (extra-args (cl-case (intern app) ('pdf-viewer (eaf-call "call_function" eaf--buffer-id "current_page")) @@ -66,10 +69,14 @@ The raw link looks like this: [[eaf:::::]]" (url (cadr list)) (extra-args (caddr list))) (cl-case app + ('browser + (eaf-open url "browser")) ('pdf-viewer (eaf-open url "pdf-viewer") (eaf-call "call_function_with_args" eaf--buffer-id "jump_to_page_with_num" (format "%s" extra-args))) + ('mindmap + (eaf-open url "mindmap")) ('js-video-player (eaf-open url "js-video-player") (eaf-call "call_function_with_args" eaf--buffer-id