reddit / emacs

my GNU Emacs configuration doesn't work on other machine

Likhon-BaRoy · 2022-12-10 15:47
I've made my **Emacs** *config* on *Arch(DWM).* And that's totally works great for me. Some **Emacs lover** showed interest on my config and wish to use. So they gave it a try.But Alas! they didn't get anything of my config working on their machine. I've tried to search what cause the problem but couldn't find any. So it'd be very helpful If anyone here has time to look into my config and catch the bug for the lover of Emacs like us. [this is how it showed-up on opening:](https://preview.redd.it/36l3ltq0e35a1.png?width=671&format=png&auto=webp&s=d7f7eeceb128d9f7cdc354702846208e0c823f1a) [running emacs --debug-init give this output:](https://preview.redd.it/q15emtnid35a1.png?width=1366&format=png&auto=webp&s=0abbb93bd7bd3a11c25eb3ae050d69fe90035fcc) here's my config of : [GNU Emacs](https://github.com/Likhon-baRoy/.emacs.d#readme) *Please have a look in it. I hope it'll be very easy for you guy's* :)
Likhon-BaRoy · 2022-12-10 15:56
How should it looks on startup is like this: [*https://imgur.com/KUQTV7s*](https://imgur.com/KUQTV7s)
franburstall · 2022-12-10 16:53
This might help: https://www.reddit.com/r/emacs/comments/qbnrao/symbols_function_definition_is_void_makeclosure/
vfclists · 2022-12-10 20:39
Which version of Emacs are both of you using? Did he totally replace his `.emacs.d` directory with yours?
Likhon-BaRoy · 2022-12-10 22:38
I donno, if he is understanable of this or not. Could you please give it a try and see how that goes? 🥹
your_sweetpea · 2022-12-11 00:57
I suspect you should remove all `.elc` files in the `elpa` directory. Afterwards they may be able to `C-u 0 M-x byte-recompile-directory RET /path/to/.emacs.d/elpa RET` to recompile them, but I would recommend ensuring it all works before you do so.
Likhon-BaRoy · 2022-12-11 03:56
one question though, why `C-u 0 M-x` but not `M-x` ? and what would happen if i don't remove all `elpa` directory in the first place?
your_sweetpea · 2022-12-11 04:02
C-u 0 passes 0 as the prefix arg to the command. Try `C-h f byte-recompile-directory RET` in emacs for explanation of why this is a good idea in this case. We are trying to recursively compile `.el` files so prompting about each recursion/`.el` file without an existing `.elc` file is not desired. Essentially the reason for your error here (I believe) is the bytecode in the `.elc` files is generated for a different emacs version than the user you're attempting to share your emacs config with uses. Since emacs bytecode changes across versions, when their emacs tries to load the bytecode it has problems. By removing the bytecode their emacs will simply load the plaintext `.el` files which are not fragile in the same way and should load without problems, then by running `byte-recompile-directory` on the elpa directory they should be able to recompile to bytecode for their version of emacs. The reason you would wish to do this is because bytecode runs faster than plaintext elisp. Package.el compiles packages when installing them, I believe (I haven't used package.el in some time) in order to speed up your emacs. This is the origin of the `.elc` files in your elpa directory in the first place. **EDIT:** It's worth noting that since you are attempting to distribute your emacs config as a distribution you should give some thought to specifically a "bootstrapping sequence" on the user's system. This would probably involve downloading all packages for the user when they start emacs the first time rather than distributing them with your emacs config.
Likhon-BaRoy · 2022-12-11 04:46
Thanks a lot. I got your point of view and learned new things.
Likhon-BaRoy · 2022-12-11 04:55
> you should give some thought to specifically a "bootstrapping sequence" on the user's system. I've no idea! could please guide me about this?
your_sweetpea · 2022-12-11 05:13
Honestly I can't give you a specific guide, your choices will change based on your needs and wants for your distribution. In general I'm just talking about a system for getting from "user installs your distribution" to "distribution is ready to use". The most obvious of the steps required is installing the packages your distribution requires to run and byte-compiling them (or native compiling them if your user is using emacs with native comp enabled). This kind of thing is also useful just for installing emacs on a new machine and bootstrapping your configuration.
AlpY24upsal · 2022-12-12 11:37
Im using your config and i dont have this Problem.My Problems are 1.emojis do not show 2.I have to install fonts every time i use it
Likhon-BaRoy · 2022-12-12 14:51
1). for emoji support, you've to install `Noto color emoji` and `noto-cjk.` 2). are you talking about `all-the-icons` here? that you've to install everytime?
AlpY24upsal · 2022-12-13 20:00
I have to select a directory to install fonta everytime
Likhon-BaRoy · 2022-12-14 03:21
use this in my `init.el`, where I put `all-the-icons`config.`(use-package all-the-icons:if (display-graphic-p))` and then you can do `M-x` `all-the-icons-install-fonts` just one time. [see here for more](https://github.com/domtronn/all-the-icons.el)