-
Notifications
You must be signed in to change notification settings - Fork 152
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
QE-modes installatio with straight.el. #871
Comments
The following recipe makes use of the At a quick glance it looks like there is some unconventional packaging going on in their repo. (straight-use-package
'(qe-modes
:host gitlab
:repo "QEF/q-e"
:files ("GUI/QE-modes/qe-modes/*.el")
:includes
(cp-mode ld1-mode neb-mode ph-mode pp-mode pw-mode pwtk-mode qe-funcs qe-mode qe-modes))) Tested with: Yodel Report (2021-10-24 01:39:05): (yodel
:user-dir "qe-test"
:save t
:packages*
(qe-modes
:host gitlab
:repo "QEF/q-e"
:files
("GUI/QE-modes/qe-modes/*.el")
:includes
(cp-mode ld1-mode neb-mode ph-mode pp-mode pw-mode pwtk-mode qe-funcs qe-mode qe-modes))
:post*
(require 'cp-mode)) STDOUT:Loading /tmp/qe-test/straight-bootstrap-snippet.el (source)...
Bootstrapping straight.el...
Bootstrapping straight.el...done
Rebuilding all packages due to build cache schema change
Looking for gnu-elpa-mirror recipe -> Cloning melpa...
Looking for gnu-elpa-mirror recipe -> Cloning melpa...done
Looking for emacsmirror-mirror recipe -> Cloning gnu-elpa-mirror...
Looking for emacsmirror-mirror recipe -> Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe -> Cloning el-get...
Looking for emacsmirror-mirror recipe -> Cloning el-get...done
Looking for straight recipe -> Cloning emacsmirror-mirror...
Looking for straight recipe -> Cloning emacsmirror-mirror...done
Building straight...
Building straight...done
Cloning q-e (for qe-modes)...
Cloning q-e (for qe-modes)...done
Building qe-modes...
Building qe-modes...done Environment
Packages
|
So, it's used to solve the package dependencies among these modes themselves.
Thank you for pointing this out. I've created a PR here.
If some modes have been added or removed, the above method will not correctly reflect this situation. |
See previous discussion: #762 The |
It still looks complicated. |
If you have a better solution, please share it. |
I don't know if we can run lisp code under the |
See previous discussion: #762 I've outlined why that is not currently possible there. |
I tried the following in my init file: (use-package qe-modes
:straight (:host gitlab
:repo "QEF/q-e"
:files ("GUI/QE-modes/qe-modes/*.el")
:includes
(cp-mode ld1-mode neb-mode ph-mode pp-mode pw-mode pwtk-mode qe-funcs qe-mode qe-modes))) The above recipe will compile the el files automatically, but the whole repository, which is a huge project, must be cloned first. I wonder if I can just clone the files |
See: https://github.com/raxod502/straight.el/tree/develop#git-backend |
I tried with the following recipe: (use-package qe-modes
:straight (:host gitlab
:repo "QEF/q-e"
:files ("GUI/QE-modes/qe-modes/*.el")
:depth 1
:includes
(cp-mode ld1-mode neb-mode ph-mode pp-mode pw-mode pwtk-mode qe-funcs qe-mode qe-modes))) But the size still exceeds 1GB:
|
Apologies. I must've misread my test output. Unfortunately, we don't currently support sparse checkouts, as there is limited forge/git support for it at the moment. See: https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository Not much we can do about it if the elisp and the main project are hosted in the same repository. |
I have heard of this feature of git and, IIRC, have also used it before.
If I understand correctly, currently, the Makefile of this package relies on the main project to build this package: The package can be build by simply running the One more thing to note: If we use (use-package qe-modes
:straight (:host gitlab
:repo "QEF/q-e"
:files ("GUI/QE-modes/qe-modes/*.el")
:depth 1
:includes
(cp-mode ld1-mode neb-mode ph-mode pp-mode pw-mode pwtk-mode qe-funcs qe-mode qe-modes)))
:config
;; automatic filename recognition
;; (BEWARE: more general patterns must be specified first)
;; automatically open the *.in files with generic QE mode
(add-to-list 'auto-mode-alist '("\\.in\\'" . qe-mode))
;; automatically open the *.pwtk files with generic PWTK/QE mode
(add-to-list 'auto-mode-alist '("\\.pwtk\\'" . pwtk-mode))
;; automatically open the the pw.*.in, scf.*.in, nscf.*.in, relax.*.in,
;; vc-relax.*.in, md.*.in, vc-md.*.in files by pw.x mode
(add-to-list 'auto-mode-alist
'("/\\(pw\\|n?scf\\|\\(?:vc-\\)?\\(?:md\\|relax\\)\\)\\(\\.\\(?:.*\\)?\\)?\\.in\\'" . pw-mode))
;; automatically open the neb.*.in and smd.*.in files with neb.x mode
(add-to-list 'auto-mode-alist '("/\\(neb\\|smd\\)\\(\\.\\(?:.*\\)?\\)?\\.in\\'" . neb-mode))
;; automatically open the cp.*.in files with cp.x mode
(add-to-list 'auto-mode-alist '("/cp\\(\\.\\(?:.*\\)?\\)?\\.in\\'" . cp-mode))
;; automatically open the ph.*.in files with ph.x mode
(add-to-list 'auto-mode-alist '("/ph\\(\\.\\(?:.*\\)?\\)?\\.in\\'" . ph-mode))
;; automatically open the ld1.*.in files with ld1 mode
(add-to-list 'auto-mode-alist '("/ld1\\(\\.\\(?:.*\\)?\\)?\\.in\\'" . ld1-mode))
;; automatically open the pp.*.in files with pp.x mode
(add-to-list 'auto-mode-alist '("/pp\\(\\.\\(?:.*\\)?\\)?\\.in\\'" . pp-mode))
;;; default indentation offset is 3; uncomment below line and set the
;;; value accordingly if you prefer other value
;
;(setq qe-indent 4)
;;; uncomment below lines to disable the auto-indentation ...
;;; ( are you really sure you want to do this ? )
;
;;(dolist (hook '(qe-mode-hook
;; pw-mode-hook
;; cp-mode-hook
;; ph-mode-hook
;; ld1-mode-hook
;; pp-mode-hook))
;; (add-hook hook (lambda () (setq indent-line-function 'indent-relative)))) |
Is it possible or there a plan for straight to support such things like git sparse checkout? |
It's a relatively new feature of git itself and from what I understand has limited support on github. So not any time soon. |
Another question following-up your above point of view: Is it possible to use the powerful features of elisp, such as the advice function, to implement git sparse checkout in |
Try it out and let me know. |
But I've no idea what/where/how should I advise |
The QE-modes package is an open-source collection of Emacs major-modes for making the editing of Quantum ESPRESSO input files somewhat easier and more comfortable with Emacs editor.
I would like to know how to use
straight.el
to install and manage it.Regards,
HZ
The text was updated successfully, but these errors were encountered: