Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust eaf layer to newer eaf package #14992

Closed
wants to merge 12 commits into from
Closed

Adjust eaf layer to newer eaf package #14992

wants to merge 12 commits into from

Conversation

lesliebinbin
Copy link

@dalanicolai
Copy link
Contributor

dalanicolai commented Aug 16, 2021

Thanks for creating this PR. However, I think we should probably make the list of apps to load configurable somehow. So I suggest that you make the list a layer variable in config.el and then use that variable in place of the list in packages.el. Subsequently, this should also get updated in the documentation (README).

Would you like to take care of that? Then also, it is usually preferred/required, to submit a single commit (here is a guide that explains how to squash with magit, and here is a guide about updating the PR, before or after squashing).

Of course, this might be a little too much to ask if your time is limited. In that case, simply let us know, and we will take care of it.
Also, you can always ask for help/advice on Spacemacs gitter.

Anyway, thanks again!

Copy link
Collaborator

@lebensterben lebensterben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

'eaf-terminal
'eaf-netease-cloud-music
'eaf-video-player
'eaf-js-video-player
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest EAF has dropped the support to js-video-player, feel free to remove it.

The reason is explained here

@MatthewZMD
Copy link

MatthewZMD commented Aug 16, 2021

On top of my comment, I noticed that:

  1. the EAF repo url in spacemacs is still manateelazycat/emacs-application-framework.

The EAF repos have merged to their own Github org: emacs-eaf.

Although the old url will still work and redirect to the new one, I'd suggest, as a good practice, to set the remote to https://github.com/emacs-eaf/emacs-application-framework.git instead.

See more here

  1. These are no longer EAF dependecies, as EAF will maintain its own fork of them from now on.
(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))

These lines can be safely deleted.

See the conversation here for details.

  1. All eaf-setq needs to change to setq as per here

  2. A number of keybindings declared maybe should be set only if the apps are present.

@lebensterben lebensterben self-requested a review August 20, 2021 03:17
Copy link
Collaborator

@lebensterben lebensterben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make changes according to #14992 (comment)

@lesliebinbin
Copy link
Author

lesliebinbin commented Aug 21, 2021

On top of my comment, I noticed that:

  1. the EAF repo url in spacemacs is still manateelazycat/emacs-application-framework.

The EAF repos have merged to their own Github org: emacs-eaf.

Although the old url will still work and redirect to the new one, I'd suggest, as a good practice, to set the remote to https://github.com/emacs-eaf/emacs-application-framework.git instead.

See more here

  1. These are no longer EAF dependecies, as EAF will maintain its own fork of them from now on.
(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))

These lines can be safely deleted.

See the conversation here for details.

  1. All eaf-setq needs to change to setq as per here
  2. A number of keybindings declared maybe should be set only if the apps are present.

But if we remove these, the macos user might get errors, since the spacemacs in macos still use the eaf release in May

'eaf
(dolist (app eaf-apps)
(require app nil 'noerror))
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing ) should not take a new line.

)))
(dolist (app eaf-apps)
(require app nil 'noerror))))
(with-eval-after-load
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no point of having with-eval-after-load 'foo in :init sectiion of (use-package foo ..) form.

move it to :config and remove with-eval-after-load

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

(defcustom eaf-apps "Eaf Applications"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple issues:

  1. For defcustom, the second positional arg is the default value and the third positional arg is the docstring.
  2. The keyword arg :type has an invalid value (symbol). At very least, it should be 'symbol. Here you should use '(set (const eaf-jupyter) (const eaf-browser) ...). See https://www.gnu.org/software/emacs/manual/html_node/elisp/Simple-Types.html
  3. If you intended to make this a custom variable, you should not use defcustom directly.
    Instead you should use spacemacs|defc, which is a wrapper of defcustom.
  4. A better docstring is required. And you also need to document it in layer's README.org.

@@ -0,0 +1,46 @@
;;; packages.el --- eaf configuration file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It's not packages.el
  2. The copyright year of this file is 2021.

@lebensterben
Copy link
Collaborator

Using the snippet from https://github.com/emacs-eaf/emacs-application-framework#1-download-eaf, won't correctly install eaf:

(quelpa '(eaf :fetcher github
              :repo  "emacs-eaf/emacs-application-framework"
              :files ("*")))

It shows

Compiling file /home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/eaf.el at Sat Aug 21 01:34:44 2021
Entering directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’
eaf.el:167:1:Error: Cannot open load file: No such file or directory, eaf-epc
Leaving directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’

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]].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update all the links since the repository has been moved

@lebensterben
Copy link
Collaborator

I won't merge this PR until it's verified to be installable.

Currently it's broken.

@MatthewZMD
Copy link

But if we remove these, the macos user might get errors, since the spacemacs in macos still use the eaf release in May

Is it possible to update the release?

On the other hand, we're actually planning to do real releases in the near future, after things are kinda more settled.

@MatthewZMD
Copy link

MatthewZMD commented Aug 21, 2021

Using the snippet from https://github.com/emacs-eaf/emacs-application-framework#1-download-eaf, won't correctly install eaf:

(quelpa '(eaf :fetcher github
              :repo  "emacs-eaf/emacs-application-framework"
              :files ("*")))

It shows

Compiling file /home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/eaf.el at Sat Aug 21 01:34:44 2021
Entering directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’
eaf.el:167:1:Error: Cannot open load file: No such file or directory, eaf-epc
Leaving directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’

Ouch, this quelpa recipe is from the pre-split period not so long ago, we haven't updated it, I've removed from the README until a working recipe is emerged. But I only use use-package, not so sure what's the best way to write up a recipe at the moment, it is still an ongoing discussion.

The eaf-epc.el is located in eaf/core directory, do you know why isn't it loaded in the load-path

- eaf-markdown-previewer
- eaf-camera

To customise applications, please set =eaf=app=

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is =eaf=app= a typo?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, thx 😄

@lesliebinbin
Copy link
Author

lesliebinbin commented Aug 21, 2021

Using the snippet from https://github.com/emacs-eaf/emacs-application-framework#1-download-eaf, won't correctly install eaf:

(quelpa '(eaf :fetcher github
              :repo  "emacs-eaf/emacs-application-framework"
              :files ("*")))

It shows

Compiling file /home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/eaf.el at Sat Aug 21 01:34:44 2021
Entering directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’
eaf.el:167:1:Error: Cannot open load file: No such file or directory, eaf-epc
Leaving directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’

Ouch, this quelpa recipe is from the pre-split period not so long ago, we haven't updated it, I've removed from the README until a working recipe is emerged. But I only use use-package, not so sure what's the best way to write up a recipe at the moment, it is still an ongoing discussion.

The eaf-epc.el is located in eaf/core directory, do you know why isn't it loaded in the load-path

Not quite sure but currently I set it as a custom layer and install-eaf.py works, is it because there is difference when we put

(defconst eaf-packages
  '(ctable
    deferred
    epc
    (eaf :location (recipe
                    :fetcher github
                    :repo  "emacs-eaf/emacs-application-framework"
                    :files ("*")))))

in packages.el

Maybe the eaf.el is also different, currently the eaf.el config several load-path

Screenshot from 2021-08-21 17-41-50

@lesliebinbin
Copy link
Author

But if we remove these, the macos user might get errors, since the spacemacs in macos still use the eaf release in May

Is it possible to update the release?

On the other hand, we're actually planning to do real releases in the near future, after things are kinda more settled.

I will test a bit on macos, use this as a custom layer first, the difference is that when the os is not linux, it will use pip alternatives and pyqt5 install from pip got issues for long time

@lebensterben
Copy link
Collaborator

@lesliebinbin
Try removing eaf* from ~/.emacs.d/elpa/27.2/develop/ first

@lesliebinbin
Copy link
Author

@lesliebinbin
Try removing eaf* from ~/.emacs.d/elpa/27.2/develop/ first

Test it on ubuntu 20,

Screenshot from 2021-08-21 17-44-33

Screenshot from 2021-08-21 17-45-46

@lesliebinbin
Copy link
Author

@lesliebinbin
Try removing eaf* from ~/.emacs.d/elpa/27.2/develop/ first

Oh sorry, I may find some different, in my init.el file for spacemacs I use babel load and it requires the line (require 'eaf), is that makes the diffrence, if that is the case, is that a way to eager load eaf in packages.el?

Screenshot from 2021-08-21 18-03-02

@lesliebinbin
Copy link
Author

Using the snippet from https://github.com/emacs-eaf/emacs-application-framework#1-download-eaf, won't correctly install eaf:

(quelpa '(eaf :fetcher github
              :repo  "emacs-eaf/emacs-application-framework"
              :files ("*")))

It shows

Compiling file /home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/eaf.el at Sat Aug 21 01:34:44 2021
Entering directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’
eaf.el:167:1:Error: Cannot open load file: No such file or directory, eaf-epc
Leaving directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’

Ouch, this quelpa recipe is from the pre-split period not so long ago, we haven't updated it, I've removed from the README until a working recipe is emerged. But I only use use-package, not so sure what's the best way to write up a recipe at the moment, it is still an ongoing discussion.

The eaf-epc.el is located in eaf/core directory, do you know why isn't it loaded in the load-path

I thinks it is because we use defer t in packages.el for eaf, that disables the autoloads facility for eaf, I remove the defer

@lebensterben
Copy link
Collaborator

you're mixing things altogether.

quelpa downloads the package and install it. use-package loads the package.

Not related

@lebensterben
Copy link
Collaborator

@lesliebinbin
The "do not merge" label simply means there's a hard error, which I described in earlier comments.
It's set to notify other maintainers that at current stage merging this PR causes issues.

It doesn't mean this PR is out of consideration.

@dalanicolai
Copy link
Contributor

But if we remove these, the macos user might get errors, since the spacemacs in macos still use the eaf release in May

@lesliebinbin I am not sure how Spacemacs works on macos, but I guess you are
using the same configuration as anyone else. So probably you have to update the
packages from the Spacemacs startup page (or press SPC f e U)

@dalanicolai
Copy link
Contributor

@lesliebinbin Thanks for the work. The PR looks almost good to me.
@lebensterben @MatthewZMD Also thanks for your work guys.

I have tested this PR on a clean Spacemacs install, and it seems to work fine on
Fedora (after applying a small fix to the install-eaf.el script
emacs-eaf/emacs-application-framework#841).

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/emacs-eaf/emacs-application-framework#2-installupdate-eaf-applications-and-dependencies][install the required dependencies manually]].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commands eaf-install and eaf-install-and-update work perfectly fine


* Usage
** Configuring applications
By default, all applications provided by eaf package are loaded, including:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not necessary to remove applications from here, because you have added the NOERROR flag to the require statement, so Emacs will simply skip loading if some package is not available.

Still, this variable is useful for users who would like to load only some of the packages by default.

(You could add this explanation here)

- eaf-camera

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned by @MatthewZMD, some keybindings might be added only conditionally. As checking all these bindings is a lot of work, you could simply add a warning about it. And add a request to report keybinding issues.

@@ -20,15 +20,13 @@
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.


(defconst eaf-packages
'(ctable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the ctable, deferred and epc packages declarations.

@@ -40,16 +38,12 @@
(defun eaf/init-epc ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the ctable, deferred and epc init-functions

@dalanicolai
Copy link
Contributor

dalanicolai commented Sep 1, 2021

Using the snippet from https://github.com/emacs-eaf/emacs-application-framework#1-download-eaf, won't correctly install eaf:

(quelpa '(eaf :fetcher github
              :repo  "emacs-eaf/emacs-application-framework"
              :files ("*")))

It shows

Compiling file /home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/eaf.el at Sat Aug 21 01:34:44 2021
Entering directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’
eaf.el:167:1:Error: Cannot open load file: No such file or directory, eaf-epc
Leaving directory ‘/home/lucius/.emacs.d/elpa/27.2/develop/eaf-20210821.113/’

I think you can simply change this to:

(quelpa '(eaf :fetcher github
              :repo  "emacs-eaf/emacs-application-framework"
              :files ("*" "core/*.el")))

@MatthewZMD You should simply add the files and locations required for building the package (see here).

@lebensterben
Copy link
Collaborator

yes this works.

(quelpa '(eaf :fetcher github
              :repo  "emacs-eaf/emacs-application-framework"
              :files ("*" "core/*.el")))

@MatthewZMD
Copy link

          :files ("*" "core/*.el")))

I think extension/*.el will also be needed.

Since it works for you, could you please check this discussion which reported on straight, I want to know does quelpa have the same behavior - which copies the contents in the app directory to a new destination?

@lebensterben
Copy link
Collaborator

quelpa clone the whole repository.
that thread is too long and I don't want to read.

@dalanicolai
Copy link
Contributor

          :files ("*" "core/*.el")))

I think extension/*.el will also be needed.

Since it works for you, could you please check this discussion which reported on straight, I want to know does quelpa have the same behavior - which copies the contents in the app directory to a new destination?

Quelpa builds the package in the same directory as the source. But I had a look at the straight problem. I will comment in that discussion.

dalanicolai added a commit to dalanicolai/spacemacs that referenced this pull request Sep 17, 2021
smile13241324 pushed a commit that referenced this pull request Sep 17, 2021
zv added a commit to zv/spacemacs that referenced this pull request Oct 6, 2021
* checkversion/develop: (55 commits)
  [doc] use org-mode  example block for example
  Added COPYRIGHT file
  [ivy] Fix new src block in docs
  [ivy] counsel search commands use spacemacs--ivy-file-actions
  [core] Support packing elisp to *.elc and *.el.gz files
  [version-control] Switch default version control diff tool to git-gutter
  [python] Remove comments and fix new commands
  [bot] "built_in_updates" Wed Sep 29 19:18:45 UTC 2021
  Add pydoc to python layer for better python doc functionality
  [python] Make ipython version detection more robust
  Revise some smaller layers
  [bot] "documentation_updates" Fri Sep 17 19:24:14 UTC 2021
  Fix (activate) company-emoji completion
  [bot] "documentation_updates" Fri Sep 17 18:59:01 UTC 2021
  Add documentation about evilifying 'special-mode buffers' (+fix eww)
  Fix and update PR syl20bnr#14992: update eaf layer
  Update keybinding
  Extend spacemacs/copy-file command with extra actions (syl20bnr#14754)
  Add simple workaround to ebib kill buffer issue (syl20bnr#15048)
  [bot] "documentation_updates" Sat Sep 11 22:58:39 UTC 2021
  ...
2ynn pushed a commit to 2ynn/spacemacs that referenced this pull request Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants