From ea6cabb95d0e238763a43617f7c122b24e951197 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sun, 15 Aug 2021 19:30:15 +1000 Subject: [PATCH 01/12] fix leader key for eaf camera --- layers/+tools/eaf/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/+tools/eaf/packages.el b/layers/+tools/eaf/packages.el index ba8e8d914209..8637d0924383 100644 --- a/layers/+tools/eaf/packages.el +++ b/layers/+tools/eaf/packages.el @@ -49,7 +49,7 @@ :init (progn (spacemacs/declare-prefix "aa" "application-framework") - (spacemacs/set-leader-keys "aac" 'eaf-camera) + (spacemacs/set-leader-keys "aac" 'eaf-open-camera) (spacemacs/set-leader-keys "aaf" 'eaf-open) (spacemacs/set-leader-keys "aaj" 'eaf-open-jupyter) (spacemacs/set-leader-keys "aao" 'eaf-open-office) From c709a99bd93295305f7fc832d455297558bd5571 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sun, 15 Aug 2021 19:56:57 +1000 Subject: [PATCH 02/12] load eaf app packages without causing errors --- layers/+tools/eaf/packages.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/layers/+tools/eaf/packages.el b/layers/+tools/eaf/packages.el index 8637d0924383..2190eede627f 100644 --- a/layers/+tools/eaf/packages.el +++ b/layers/+tools/eaf/packages.el @@ -48,6 +48,30 @@ :defer t :init (progn + (with-eval-after-load 'eaf + (let ((eaf-apps (list 'eaf-jupyter + 'eaf-browser + 'eaf-airshare + 'eaf-file-browser + 'eaf-file-manager + 'eaf-file-sender + 'eaf-music-player + 'eaf-system-monitor + 'eaf-mindmap + 'eaf-org-previewer + 'eaf-terminal + 'eaf-netease-cloud-music + 'eaf-video-player + 'eaf-js-video-player + 'eaf-image-viewer + 'eaf-demo + 'eaf-vue-demo + 'eaf-pdf-viewer + 'eaf-markdown-previewer + 'eaf-camera + ))) + (dolist (app eaf-apps) + (require app nil 'noerror)))) (spacemacs/declare-prefix "aa" "application-framework") (spacemacs/set-leader-keys "aac" 'eaf-open-camera) (spacemacs/set-leader-keys "aaf" 'eaf-open) From b632b5ed5a678f6e8421c0a143ef9d639e570243 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 14:43:40 +1000 Subject: [PATCH 03/12] modify based on review --- layers/+tools/eaf/config.el | 46 +++++++++++++++++++++++++++++++++++ layers/+tools/eaf/packages.el | 43 +++++--------------------------- 2 files changed, 52 insertions(+), 37 deletions(-) create mode 100644 layers/+tools/eaf/config.el diff --git a/layers/+tools/eaf/config.el b/layers/+tools/eaf/config.el new file mode 100644 index 000000000000..3712041cf8a6 --- /dev/null +++ b/layers/+tools/eaf/config.el @@ -0,0 +1,46 @@ +;;; packages.el --- eaf configuration file +;; +;; Copyright (c) 2012-2021 Sylvain Benner & Contributors +;; +;; Author: Leslie Huang +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +(defcustom eaf-apps "Eaf Applications" + :group eaf + :type (symbol) + '(eaf-jupyter + eaf-browser + eaf-airshare + eaf-file-browser + eaf-file-manager + eaf-file-sender + eaf-music-player + eaf-system-monitor + eaf-mindmap + eaf-org-previewer + eaf-terminal + eaf-netease-cloud-music + eaf-video-player + eaf-image-viewer + eaf-demo + eaf-vue-demo + eaf-pdf-viewer + eaf-markdown-previewer + eaf-camera + ) +) diff --git a/layers/+tools/eaf/packages.el b/layers/+tools/eaf/packages.el index 2190eede627f..ed0da75f67dc 100644 --- a/layers/+tools/eaf/packages.el +++ b/layers/+tools/eaf/packages.el @@ -31,47 +31,16 @@ :repo "manateelazycat/emacs-application-framework" :files ("*"))))) -(defun eaf/init-ctable () - (use-package ctable)) - -(defun eaf/init-deferred () - (use-package deferred)) - -(defun eaf/init-epc () - (use-package epc)) - -;; (defun eaf/init-s () -;; (use-package s)) - (defun eaf/init-eaf () (use-package eaf :defer t :init (progn - (with-eval-after-load 'eaf - (let ((eaf-apps (list 'eaf-jupyter - 'eaf-browser - 'eaf-airshare - 'eaf-file-browser - 'eaf-file-manager - 'eaf-file-sender - 'eaf-music-player - 'eaf-system-monitor - 'eaf-mindmap - 'eaf-org-previewer - 'eaf-terminal - 'eaf-netease-cloud-music - 'eaf-video-player - 'eaf-js-video-player - 'eaf-image-viewer - 'eaf-demo - 'eaf-vue-demo - 'eaf-pdf-viewer - 'eaf-markdown-previewer - 'eaf-camera - ))) - (dolist (app eaf-apps) - (require app nil 'noerror)))) + (with-eval-after-load + 'eaf + (dolist (app eaf-apps) + (require app nil 'noerror)) + ) (spacemacs/declare-prefix "aa" "application-framework") (spacemacs/set-leader-keys "aac" 'eaf-open-camera) (spacemacs/set-leader-keys "aaf" 'eaf-open) @@ -235,7 +204,7 @@ :config (progn (setq browse-url-browser-function 'eaf-open-browser) - (eaf-setq eaf-browser-enable-adblocker "true") + (setq eaf-browser-enable-adblocker "true") (define-key eaf-mode-map* (kbd "C-SPC C-SPC") 'execute-extended-command) ;;;; TODO need to consider the current pdf view mode which does not need to be pdf view mode From eb05dcd13d015501de5af7471dbde135ffdc5149 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 15:00:59 +1000 Subject: [PATCH 04/12] remove redundant packages --- layers/+tools/eaf/config.el | 7 ++++--- layers/+tools/eaf/packages.el | 6 +----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/layers/+tools/eaf/config.el b/layers/+tools/eaf/config.el index 3712041cf8a6..02a752bded5b 100644 --- a/layers/+tools/eaf/config.el +++ b/layers/+tools/eaf/config.el @@ -20,9 +20,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . -(defcustom eaf-apps "Eaf Applications" - :group eaf - :type (symbol) +(defcustom eaf-apps '(eaf-jupyter eaf-browser eaf-airshare @@ -43,4 +41,7 @@ eaf-markdown-previewer eaf-camera ) + "Eaf Applications" + :group 'eaf + :type '(symbol) ) diff --git a/layers/+tools/eaf/packages.el b/layers/+tools/eaf/packages.el index ed0da75f67dc..882057b110f6 100644 --- a/layers/+tools/eaf/packages.el +++ b/layers/+tools/eaf/packages.el @@ -22,11 +22,7 @@ (defconst eaf-packages - '(ctable - deferred - epc - ;; s - (eaf :location (recipe + '((eaf :location (recipe :fetcher github :repo "manateelazycat/emacs-application-framework" :files ("*"))))) From 37b1ec495268d867273436d8bddb130683ae0eff Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 16:31:03 +1000 Subject: [PATCH 05/12] move to :config section --- layers/+tools/eaf/packages.el | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/layers/+tools/eaf/packages.el b/layers/+tools/eaf/packages.el index 882057b110f6..ee7aec4e4e2d 100644 --- a/layers/+tools/eaf/packages.el +++ b/layers/+tools/eaf/packages.el @@ -32,11 +32,6 @@ :defer t :init (progn - (with-eval-after-load - 'eaf - (dolist (app eaf-apps) - (require app nil 'noerror)) - ) (spacemacs/declare-prefix "aa" "application-framework") (spacemacs/set-leader-keys "aac" 'eaf-open-camera) (spacemacs/set-leader-keys "aaf" 'eaf-open) @@ -199,6 +194,8 @@ ;; ("" . "select_right_tab") :config (progn + (dolist (app eaf-apps) + (require app nil 'noerror)) (setq browse-url-browser-function 'eaf-open-browser) (setq eaf-browser-enable-adblocker "true") From 101f64c0126a4f207287e3bf1fb2c59d8c0843c4 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 16:31:22 +1000 Subject: [PATCH 06/12] fix and optimise config.el --- layers/+tools/eaf/config.el | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/layers/+tools/eaf/config.el b/layers/+tools/eaf/config.el index 02a752bded5b..7a858832f77b 100644 --- a/layers/+tools/eaf/config.el +++ b/layers/+tools/eaf/config.el @@ -1,6 +1,6 @@ -;;; packages.el --- eaf configuration file +;;; config.el --- (const eaf configuration file ;; -;; Copyright (c) 2012-2021 Sylvain Benner & Contributors +;; Copyright (c) 2021 Sylvain Benner & Contributors ;; ;; Author: Leslie Huang ;; URL: https://github.com/syl20bnr/spacemacs @@ -20,7 +20,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . -(defcustom eaf-apps +(spacemacs|defc eaf-apps '(eaf-jupyter eaf-browser eaf-airshare @@ -39,9 +39,26 @@ eaf-vue-demo eaf-pdf-viewer eaf-markdown-previewer - eaf-camera - ) - "Eaf Applications" - :group 'eaf - :type '(symbol) -) + eaf-camera) + "The applications loaded from EAF package" + '(set + (const eaf-jupyter) + (const eaf-browser) + (const eaf-airshare) + (const eaf-file-browser) + (const eaf-file-manager) + (const eaf-file-sender) + (const eaf-music-player) + (const eaf-system-monitor) + (const eaf-mindmap) + (const eaf-org-previewer) + (const eaf-terminal) + (const eaf-netease-cloud-music) + (const eaf-video-player) + (const eaf-image-viewer) + (const eaf-demo) + (const eaf-vue-demo) + (const eaf-pdf-viewer) + (const eaf-markdown-previewer) + (const eaf-camera)) + 'eaf) From f4ad4918775aa6d33d03f55ecee439d38019ce14 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 16:31:32 +1000 Subject: [PATCH 07/12] add description to doc --- layers/+tools/eaf/README.org | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/layers/+tools/eaf/README.org b/layers/+tools/eaf/README.org index be611b920c5a..6cfbefc8b739 100644 --- a/layers/+tools/eaf/README.org +++ b/layers/+tools/eaf/README.org @@ -7,6 +7,7 @@ - [[#features][Features:]] - [[#install][Install]] - [[#usage][Usage]] + - [[#configuring-applications][Configuring applications]] - [[#configuring-key-bindings][Configuring key bindings]] - [[#key-bindings][Key bindings]] - [[#global][Global]] @@ -33,13 +34,35 @@ To use this configuration layer, add it to your =~/.spacemacs=. You will need to add =eaf= to the existing =dotspacemacs-configuration-layers= list in this file. -Subsequently install the required dependencies with =SPC SPC - eaf-install-dependencies=. This command only works for Ubuntu and Fedora based -distributions. Users of Arch (based) distributions can run the script manually -in their terminal. If the script does not work for you then [[https://github.com/manateelazycat/emacs-application-framework#dependency-list][install the -required dependencies manually]]. +Currently the command =SPC SPC eaf-install-dependencies= no longer works, please +refer to [[https://github.com/manateelazycat/emacs-application-framework#dependency-list][install the required dependencies manually]]. * Usage +** Configuring applications +By default, all applications provided by eaf package are loaded, including: + +- eaf-jupyter +- eaf-browser +- eaf-airshare +- eaf-file-browser +- eaf-file-manager +- eaf-file-sender +- eaf-music-player +- eaf-system-monitor +- eaf-mindmap +- eaf-org-previewer +- eaf-terminal +- eaf-netease-cloud-music +- eaf-video-player +- eaf-image-viewer +- eaf-demo +- eaf-vue-demo +- eaf-pdf-viewer +- eaf-markdown-previewer +- eaf-camera + +To customise applications, please set =eaf=app= + ** Configuring key bindings Configuration of EAF key bindings works in a different way than normally in Spacemacs. @@ -48,7 +71,7 @@ required to make leader keys in EAF buffers behave as expected in Spacemacs. Therefore it is recommended to keep these default (major-mode-)leader keybindings. -For information about configuration of other key bindings for EAF, see [[https://github.com/manateelazycat/emacs-application-framework/wiki/Keybindings][here]]. +For information about configuration of other key bindings for EAF, see [[https://github.com/manateelazycat/emacs-application-framework/wiki/Keybindings][here]]. If you do want to modify the leader keys, then information about the tricks implemented in this layer can be found [[https://github.com/manateelazycat/emacs-application-framework/issues/498][here]] and [[https://github.com/manateelazycat/emacs-application-framework/pull/500][here]]. From 897b3561a3992479e84df32c0626b61bf89fb1a8 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 16:49:17 +1000 Subject: [PATCH 08/12] update links --- layers/+tools/eaf/README.org | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/layers/+tools/eaf/README.org b/layers/+tools/eaf/README.org index 6cfbefc8b739..54daa2807e7b 100644 --- a/layers/+tools/eaf/README.org +++ b/layers/+tools/eaf/README.org @@ -20,14 +20,14 @@ - [[#pdf-view-mode-pdf-tools][pdf-view-mode (pdf-tools)]] * Description -This layer adds support for the [[https://github.com/manateelazycat/emacs-application-framework][Emacs Application Framework (EAF)]]. +This layer adds support for the [[https://github.com/emacs-eaf/emacs-application-framework][Emacs Application Framework (EAF)]]. ** Features: - Browse using a full-fledged browser within Emacs - PDF viewer (with continuous scroll) - Video player - Image viewer -- See [[https://github.com/manateelazycat/emacs-application-framework#launch-eaf-applications][EAF documentation]] for many more features +- See [[https://github.com/emacs-eaf/emacs-application-framework#launch-eaf-applications][EAF documentation]] for many more features * Install To use this configuration layer, add it to your =~/.spacemacs=. You will need to @@ -35,7 +35,7 @@ add =eaf= to the existing =dotspacemacs-configuration-layers= list in this file. Currently the command =SPC SPC eaf-install-dependencies= no longer works, please -refer to [[https://github.com/manateelazycat/emacs-application-framework#dependency-list][install the required dependencies manually]]. +refer to [[https://github.com/emacs-eaf/emacs-application-framework#dependency-list][install the required dependencies manually]]. * Usage ** Configuring applications @@ -71,14 +71,14 @@ required to make leader keys in EAF buffers behave as expected in Spacemacs. Therefore it is recommended to keep these default (major-mode-)leader keybindings. -For information about configuration of other key bindings for EAF, see [[https://github.com/manateelazycat/emacs-application-framework/wiki/Keybindings][here]]. +For information about configuration of other key bindings for EAF, see [[https://github.com/emacs-eaf/emacs-application-framework/wiki/Keybindings][here]]. If you do want to modify the leader keys, then information about the tricks -implemented in this layer can be found [[https://github.com/manateelazycat/emacs-application-framework/issues/498][here]] and [[https://github.com/manateelazycat/emacs-application-framework/pull/500][here]]. +implemented in this layer can be found [[https://github.com/emacs-eaf/emacs-application-framework/issues/498][here]] and [[https://github.com/emacs-eaf/emacs-application-framework/pull/500][here]]. * Key bindings Except for the few Spacemacs specific modifications listed below, all EAF -keybindings are documented [[https://github.com/manateelazycat/emacs-application-framework/wiki/Keybindings][here.]] +keybindings are documented [[https://github.com/emacs-eaf/emacs-application-framework/wiki/Keybindings][here.]] Use ~SPC t k m~ to [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which-key-persistent][show the EAF key bindings persistently in which-key]], or use ~SPC h d K~ to show the `eaf-mode-map` in a separate buffer. @@ -88,7 +88,7 @@ Use ~SPC t k m~ to [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which- | Key binding | Description | |-------------+-------------------------------------------------------------------------------| -| ~SPC a a f~ | EAF open file ([[https://github.com/manateelazycat/emacs-application-framework#launch-eaf-applications][see EAF doc for supported file types]]) | +| ~SPC a a f~ | EAF open file ([[https://github.com/emacs-eaf/emacs-application-framework#launch-eaf-applications][see EAF doc for supported file types]]) | | ~SPC a a s~ | EAF open system monitor | | ~SPC a a M~ | EAF open musik player | | ~SPC t k m~ | Show available key commands in which-key (read [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which-key][here]] for more details) | @@ -99,7 +99,7 @@ Use ~SPC t k m~ to [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which- | Key binding | Description | |---------------+---------------------------------------------------------------------------------------| | ~SPC a a b o~ | Open url in new buffer | -| ~SPC a a b s~ | Search with [[https://github.com/manateelazycat/emacs-application-framework/wiki/Customization#default-search-engine][your favorite search engine]]. Defaults to symbol at point or region string | +| ~SPC a a b s~ | Search with [[https://github.com/emacs-eaf/emacs-application-framework/wiki/Customization#default-search-engine][your favorite search engine]]. Defaults to symbol at point or region string | | ~SPC a a b b~ | Open bookmark in new buffer | | ~SPC a a b h~ | Search and open buffer from history | @@ -120,7 +120,7 @@ Use ~SPC t k m~ to [[https://develop.spacemacs.org/doc/DOCUMENTATION.html#which- | ~C-s~ | Search/search find next (to enter new search prefix with ~C-g~ | | ~C-r~ | Search find previous | | ~SPC m h~ | Open new buffer from history | -| ~SPC m s~ | Search web with [[https://github.com/manateelazycat/emacs-application-framework/wiki/Customization#default-search-engine][favorite search engine]] | +| ~SPC m s~ | Search web with [[https://github.com/emacs-eaf/emacs-application-framework/wiki/Customization#default-search-engine][favorite search engine]] | *** PDF-viewer From 2fa531f42587ad7d11cccebc69e923e5fd30bbb8 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 16:52:20 +1000 Subject: [PATCH 09/12] restore ctable deferred epc to fix broken install --- layers/+tools/eaf/packages.el | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/layers/+tools/eaf/packages.el b/layers/+tools/eaf/packages.el index ee7aec4e4e2d..aa062b60c60e 100644 --- a/layers/+tools/eaf/packages.el +++ b/layers/+tools/eaf/packages.el @@ -20,13 +20,24 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . - (defconst eaf-packages - '((eaf :location (recipe + '(ctable + deferred + epc + (eaf :location (recipe :fetcher github - :repo "manateelazycat/emacs-application-framework" + :repo "emacs-eaf/emacs-application-framework" :files ("*"))))) +(defun eaf/init-ctable () + (use-package ctable)) + +(defun eaf/init-deferred () + (use-package deferred)) + +(defun eaf/init-epc () + (use-package epc)) + (defun eaf/init-eaf () (use-package eaf :defer t From 409b4feccbf91a927eebe35705449688d8a3d001 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 17:02:43 +1000 Subject: [PATCH 10/12] update link for manually install --- layers/+tools/eaf/README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/+tools/eaf/README.org b/layers/+tools/eaf/README.org index 54daa2807e7b..370b33fd2fa9 100644 --- a/layers/+tools/eaf/README.org +++ b/layers/+tools/eaf/README.org @@ -35,7 +35,7 @@ add =eaf= to the existing =dotspacemacs-configuration-layers= list in this file. Currently the command =SPC SPC eaf-install-dependencies= no longer works, please -refer to [[https://github.com/emacs-eaf/emacs-application-framework#dependency-list][install the required dependencies manually]]. +refer to [[https://github.com/emacs-eaf/emacs-application-framework#2-installupdate-eaf-applications-and-dependencies][install the required dependencies manually]]. * Usage ** Configuring applications From 9ece11999e587e31b0927c75e60c9f58af339b73 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 17:24:12 +1000 Subject: [PATCH 11/12] fix typo --- layers/+tools/eaf/README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/+tools/eaf/README.org b/layers/+tools/eaf/README.org index 370b33fd2fa9..8aac8bb793f6 100644 --- a/layers/+tools/eaf/README.org +++ b/layers/+tools/eaf/README.org @@ -61,7 +61,7 @@ By default, all applications provided by eaf package are loaded, including: - eaf-markdown-previewer - eaf-camera -To customise applications, please set =eaf=app= +To customise applications, please set the variable =eaf-apps= ** Configuring key bindings Configuration of EAF key bindings works in a different way than normally in Spacemacs. From e2bc106aa900fcc1af87b7d25ac1d5f7e3c1ed56 Mon Sep 17 00:00:00 2001 From: Leslie Binbin Date: Sat, 21 Aug 2021 18:10:53 +1000 Subject: [PATCH 12/12] remove defer to use auto-loads provided by eaf --- layers/+tools/eaf/packages.el | 1 - 1 file changed, 1 deletion(-) diff --git a/layers/+tools/eaf/packages.el b/layers/+tools/eaf/packages.el index aa062b60c60e..6839c8e26473 100644 --- a/layers/+tools/eaf/packages.el +++ b/layers/+tools/eaf/packages.el @@ -40,7 +40,6 @@ (defun eaf/init-eaf () (use-package eaf - :defer t :init (progn (spacemacs/declare-prefix "aa" "application-framework")