[Emacs] Remove w3m layer, compile configuration files when exported

The w3m layer is now removed as I did not use it at all.

The conlanging layer is moved to ~/fromGIT/emacs-packages and now a
symlink points to its new location. This is done in order to prevent
Emacs from compiling its .el files when recompiling its configuration
files.

Configuration files are now compiled when emacs.org is tangled by Emacs
itself or if the .el files are newer than the .elc files.

TODO: find a way to natively compile and load these files instead of
just byte-compile them if native compilation is available
This commit is contained in:
Lucien Cartier-Tilet 2020-12-23 01:54:07 +01:00
parent bcd9ec58b5
commit b1f2be0016
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
6 changed files with 34 additions and 32 deletions

@ -1 +0,0 @@
Subproject commit 15ae526299b4274948dcd62a0829fec631024dd9

View File

@ -0,0 +1 @@
/home/phundrak/fromGIT/emacs-packages/conlanging

@ -1 +0,0 @@
Subproject commit df38ad925491e57bfc8db1bcde2fb032c5d2e35c

5
.gitmodules vendored
View File

@ -2,11 +2,8 @@
path = .config/tmux path = .config/tmux
url = https://github.com/gpakosz/.tmux.git url = https://github.com/gpakosz/.tmux.git
[submodule ".config/emacs/private/conlanging"] [submodule ".config/emacs/private/conlanging"]
path = .config/emacs/private/conlanging path = fromGIT/emacs-packages/conlanging
url = https://labs.phundrak.com/phundrak/conlang-layer url = https://labs.phundrak.com/phundrak/conlang-layer
[submodule ".config/emacs/private/w3m"]
path = .config/emacs/private/w3m
url = https://github.com/venmos/w3m-layer.git
[submodule ".mozilla/firefox/lruehqec.default/chrome"] [submodule ".mozilla/firefox/lruehqec.default/chrome"]
path = .mozilla/firefox/lruehqec.default/chrome path = .mozilla/firefox/lruehqec.default/chrome
url = git@labs.phundrak.com:phundrak/blurredfox-nord.git url = git@labs.phundrak.com:phundrak/blurredfox-nord.git

View File

@ -6,14 +6,14 @@ before layer configuration.
It should only modify the values of Spacemacs settings." It should only modify the values of Spacemacs settings."
(setq phundrak//dotspacemacs-src-dir "~/.config/emacs/private/" (setq phundrak//dotspacemacs-src-dir "~/.config/emacs/private/"
phundrak//dotspacemacs-src "~/org/config/emacs.org" phundrak//dotspacemacs-src "~/org/config/emacs.org"
phundrak//dotspacemacs-si (concat phundrak//dotspacemacs-src-dir "spacemacs-init.el") phundrak//dotspacemacs-si (concat phundrak//dotspacemacs-src-dir "spacemacs-init")
phundrak//dotspacemacs-sl (concat phundrak//dotspacemacs-src-dir "spacemacs-layers.el") phundrak//dotspacemacs-sl (concat phundrak//dotspacemacs-src-dir "spacemacs-layers")
phundrak//dotspacemacs-uc (concat phundrak//dotspacemacs-src-dir "user-config.el") phundrak//dotspacemacs-uc (concat phundrak//dotspacemacs-src-dir "user-config")
phundrak//dotspacemacs-ui (concat phundrak//dotspacemacs-src-dir "user-init.el")) phundrak//dotspacemacs-ui (concat phundrak//dotspacemacs-src-dir "user-init"))
(when (or (file-newer-than-file-p phundrak//dotspacemacs-src phundrak//dotspacemacs-si) (when (or (file-newer-than-file-p phundrak//dotspacemacs-src (concat phundrak//dotspacemacs-si ".el"))
(file-newer-than-file-p phundrak//dotspacemacs-src phundrak//dotspacemacs-sl) (file-newer-than-file-p phundrak//dotspacemacs-src (concat phundrak//dotspacemacs-sl ".el"))
(file-newer-than-file-p phundrak//dotspacemacs-src phundrak//dotspacemacs-ui) (file-newer-than-file-p phundrak//dotspacemacs-src (concat phundrak//dotspacemacs-ui ".el"))
(file-newer-than-file-p phundrak//dotspacemacs-src phundrak//dotspacemacs-uc)) (file-newer-than-file-p phundrak//dotspacemacs-src (concat phundrak//dotspacemacs-uc ".el")))
(message "Exporting new Emacs configuration from spacemacs.org through org-babel...") (message "Exporting new Emacs configuration from spacemacs.org through org-babel...")
(with-temp-buffer (with-temp-buffer
(shell-command (format "emacs -Q --batch %s %s %s" (shell-command (format "emacs -Q --batch %s %s %s"
@ -22,13 +22,16 @@ It should only modify the values of Spacemacs settings."
(format "--eval '(org-babel-tangle-file \"%s\")'" (format "--eval '(org-babel-tangle-file \"%s\")'"
phundrak//dotspacemacs-src)) phundrak//dotspacemacs-src))
(current-buffer))) (current-buffer)))
(message "done")) (message "Exporting new Emacs configuration from spacemacs.org through org-babel...done")
(load-file phundrak//dotspacemacs-si)) (with-temp-buffer
(byte-recompile-directory phundrak//dotspacemacs-src-dir
0 t)))
(load phundrak//dotspacemacs-si))
(defun dotspacemacs/layers () (defun dotspacemacs/layers ()
"Layer configuration: "Layer configuration:
This function should only modify configuration layer settings." This function should only modify configuration layer settings."
(load-file phundrak//dotspacemacs-sl)) (load phundrak//dotspacemacs-sl))
(defun dotspacemacs/user-env () (defun dotspacemacs/user-env ()
"Environment variables setup. "Environment variables setup.
@ -44,7 +47,7 @@ This function is called immediately after `dotspacemacs/init', before layer
configuration. configuration.
It is mostly for variables that should be set before packages are loaded. It is mostly for variables that should be set before packages are loaded.
If you are unsure, try setting them in `dotspacemacs/user-config' first." If you are unsure, try setting them in `dotspacemacs/user-config' first."
(load-file phundrak//dotspacemacs-ui)) (load phundrak//dotspacemacs-ui))
(defun dotspacemacs/user-load () (defun dotspacemacs/user-load ()
"Library to load while dumping. "Library to load while dumping.
@ -59,7 +62,7 @@ This function is called at the very end of Spacemacs startup, after layer
configuration. configuration.
Put your configuration code here, except for variables that should be set Put your configuration code here, except for variables that should be set
before packages are loaded." before packages are loaded."
(load-file phundrak//dotspacemacs-uc)) (load phundrak//dotspacemacs-uc))
;; Do not write anything past this comment. This is where Emacs will ;; Do not write anything past this comment. This is where Emacs will

@ -0,0 +1 @@
Subproject commit 15ae526299b4274948dcd62a0829fec631024dd9

View File

@ -80,6 +80,7 @@ With the variable ~dotspacemacs-additional-packages~, it is possible to install
| outorg | edit comments as Org-mode buffers | | outorg | edit comments as Org-mode buffers |
| pinentry | enter a GPG password from Emacs | | pinentry | enter a GPG password from Emacs |
| s | The long lost Emacs string manipulation library. | | s | The long lost Emacs string manipulation library. |
| sicp | Texinfo version of the [[https://mitpress.mit.edu/sites/default/files/sicp/index.html][SICP]] |
| visual-fill-column | allow the use of ~fill-column~ in ~visual-line-mode~ | | visual-fill-column | allow the use of ~fill-column~ in ~visual-line-mode~ |
| wrap-region | easily wrap region with delimiters | | wrap-region | easily wrap region with delimiters |
| wttrin | weather in Emacs | | wttrin | weather in Emacs |
@ -510,9 +511,9 @@ Unfortunately, I have to write Swift code for one of my university courses, so h
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: Spacemacs_layers_and_packages-Layers-Custom_layers-69473533 :CUSTOM_ID: Spacemacs_layers_and_packages-Layers-Custom_layers-69473533
:END: :END:
Lastly, two custom layers have been enabled: a w3m layer, and my custom layers for conlanging tools. Lastly, one custom layers have been enabled: my custom layers for conlanging tools.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
conlanging w3m conlanging
#+END_SRC #+END_SRC
# Dont delete this code block, it wraps the layers # Dont delete this code block, it wraps the layers
@ -1563,7 +1564,7 @@ When Im in Eshell, sometimes I wish to open multiple files at once in Emacs.
(defadvice find-file (around find-files activate) (defadvice find-file (around find-files activate)
"Also find all files within a list of files. This even works recursively." "Also find all files within a list of files. This even works recursively."
(if (listp filename) (if (listp filename)
(loop for f in filename do (find-file f wildcards)) (cl-loop for f in filename do (find-file f wildcards))
ad-do-it)) ad-do-it))
#+END_SRC #+END_SRC
@ -1639,7 +1640,7 @@ The banner for Eshell will collect some system information and display them grac
- How full are its mountpoints - How full are its mountpoints
Some of these information can be grabbed directly from Emacs built-in functions, but some others need to be retrieved manually. Lets first get into it with the mounted partitions for which well define a structure: Some of these information can be grabbed directly from Emacs built-in functions, but some others need to be retrieved manually. Lets first get into it with the mounted partitions for which well define a structure:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defstruct phundrak/mounted-partitions (cl-defstruct phundrak/mounted-partitions
"Object representing a mounted partition found in the system" "Object representing a mounted partition found in the system"
path size used percent) path size used percent)
#+END_SRC #+END_SRC
@ -3085,8 +3086,8 @@ Now, lets declare the following keybindings:
:END: :END:
A couple of keybindings will be added to Dired. The first one is the opening parenthesis which will enable or disable ~dired-hide-details-mode~. On the other hand, a closing parenthesis will show git information in the current Dired buffer. A couple of keybindings will be added to Dired. The first one is the opening parenthesis which will enable or disable ~dired-hide-details-mode~. On the other hand, a closing parenthesis will show git information in the current Dired buffer.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(evil-define-key 'normal dired-mode-map "(" 'dired-hide-details-mode) (define-key dired-mode-map (kbd "(") 'dired-hide-details-mode)
(evil-define-key 'normal dired-mode-map ")" 'dired-git-info-mode) (define-key dired-mode-map (kbd ")") 'dired-git-info-mode)
#+END_SRC #+END_SRC
Something I use from time to time is ~S-F1~ for opening dired in my ~$HOME~ directory. For that, I simply did the following: Something I use from time to time is ~S-F1~ for opening dired in my ~$HOME~ directory. For that, I simply did the following:
@ -3096,9 +3097,9 @@ Something I use from time to time is ~S-F1~ for opening dired in my ~$HOME~ dire
A couple of other useful utilities, sach as opening all marked files, sorting files, opening them externally and renaming them, are also bound to a simple key press: A couple of other useful utilities, sach as opening all marked files, sorting files, opening them externally and renaming them, are also bound to a simple key press:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(evil-define-key 'normal dired-mode-map "f" 'phundrak/open-marked-files) (define-key dired-mode-map (kbd "f") 'phundrak/open-marked-files)
(evil-define-key 'normal dired-mode-map "F" 'xah/open-in-external-app) (define-key dired-mode-map (kbd "F") 'xah/open-in-external-app)
(evil-define-key 'normal dired-mode-map "s" 'xah/dired-sort) (define-key dired-mode-map (kbd "s") 'xah/dired-sort)
#+END_SRC #+END_SRC
*** Files *** Files
@ -3130,10 +3131,11 @@ Just to make it easier to launch it, Ill declare a shortcut for launching tet
Apparently, no evil keybindings are set for Tetris. Lets declare them (adapted to the bépo layout): Apparently, no evil keybindings are set for Tetris. Lets declare them (adapted to the bépo layout):
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(evil-define-key 'emacs tetris-mode-map "c" 'tetris-move-left) (require 'tetris)
(evil-define-key 'emacs tetris-mode-map "t" 'tetris-move-down) (define-key tetris-mode-map (kbd "c") 'tetris-move-left)
(evil-define-key 'emacs tetris-mode-map "s" 'tetris-rotate-prev) (define-key tetris-mode-map (kbd "t") 'tetris-move-down)
(evil-define-key 'emacs tetris-mode-map "r" 'tetris-move-right) (define-key tetris-mode-map (kbd "s") 'tetris-rotate-prev)
(define-key tetris-mode-map (kbd "r") 'tetris-move-right)
#+END_SRC #+END_SRC
*** Multiple cursors *** Multiple cursors