reddit / emacs

Same set up in 2 machines, one is not working

kaerfkeerg · 2022-10-25 16:33
I've something strange going on since I made a basic Emacs set up in my PC (Mx-linux) but I can't seem to get it right on my Laptop (ZorinOs) [Here](https://gist.github.com/hor00s/bbabfd29a1549b8c4a7290c93bbf0288) is my ```init.el``` For the record both machines have ```.emacs.d``` in ```home``` directory (```~/.emacs.d/init.el```) and as far as I checked, neither do I have any other ```.emacs``` dir in my laptor nor any duplicate ```init.el``` 2 Issued I have 1) ```init.el``` is not loaded unless I manually ```Mx load-file``` ```Load file: ~/.emacs.d/init.el``` 2) When I do load manually, relative line numbers and *disabling* the *welcome screen* do not work when all the rest (multi-cursor/auto-complete etc.) work normally And again, I've this issue only on my Laptop, when on my PC I get the setup fairly quickly and easily Well, I did the sane thing, deleted ```~/.emacs.d``` and started all over again by doing the steps one by one instead of copying the script straight in. What I noticed is that the following piece of code gets written automatically after ```Mx package-refresh-contents``` and should not be initially in (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages '(multiple-cursors auto-complete use-package))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) Everything seems to be working now. I should've taken it easy and slowly instead of rushing in.. lol! Everyone that tried to help, appreciated! But, what I did was stupid enough that none could've guessed!
igorepst · 2022-10-25 16:46
Start Emacs in your laptop from command line with `emacs --debug-init`. Post the output here. Disabling welcome screen doesn't work because, as far as I understand your description, it is shown already when you load the init file. I think the same holds for relative line numbers. In addition, you require `package` twice for some reason
ieure · 2022-10-25 18:49
Same version of Emacs on both machines? Is there a `~/.emacs` file on either?
kaerfkeerg · 2022-10-25 19:56
Error: file missing "Can not open load file "Ni such file or directory "multiple -cursors" require (multiple -cursors) The multiple cursor is working tho Edit: Also note that none of my configuration load unless I do it manually, so Idk the accuracy of this debug msg
kaerfkeerg · 2022-10-25 19:56
```~/.emacs.d``` in both machines
igorepst · 2022-10-25 20:14
Multiple cursors start working only after you load the file. They however prevent your init from loading. Move their require before you bind the keys and after the `custom` section, or, much better, use `use-package` for them instead of requiring.
kaerfkeerg · 2022-10-25 20:42
Ok, I didn't expect this to happen but this fixed everything except autocompletion with this new error message which I guess says that something is undefined? &#x200B; Debugger entered--Lisp error: (void-function use-package) (use-package auto-complete :ensure t :init (progn (ac-config-default) (global-auto-complete-mode t))) eval-buffer(#<buffer \*load\*> nil "/home/zorin/.emacs.d/init.el" nil t) ; Reading at buffer position 1270 load-with-code-conversion("/home/zorin/.emacs.d/init.el" "/home/zorin/.emacs.d/init.el" t t) load("/home/zorin/.emacs.d/init" t t) \#f(compiled-function () #<bytecode 0x1e0f4d>)() command-line() normal-top-level()
igorepst · 2022-10-25 20:47
`use-package` is not defined. Meaning probably you didn't install it at all. Or you need to require it beforehand. Read how to do it: https://github.com/jwiegley/use-package#installing-use-package
kaerfkeerg · 2022-10-25 20:57
But, it worked before.. I'm a bit lost!
igorepst · 2022-10-26 04:57
Are you sure it is autocomplete that worked? Because Emacs has completion built in. Please try to use official instructions from the site I linked to anyway, as you cannot expect `use-package` to load `autocomplete` without `(eval-when-compile (require 'use-package))`
kaerfkeerg · 2022-10-26 05:08
I'm sure autocompletion worked. I'll follow your instructions later because I'm at work now. I fail to understand why it works on my PC and it's so much of a hustle for my laptop
igorepst · 2022-10-26 05:32
When you are back at home, try to copy from PC to laptop all the `~/.emacs.d` directory, define `use-package` as per official instructions and rewrite `multiple-cursors` to use it as well (remove `require` and learn to use `:bind`)
kaerfkeerg · 2022-10-26 05:33
Gotcha. I'll do and update. Thanks!
LordOfSwines · 2022-10-26 08:16
`~/.emacs` **not** `~/.emacs.d` if so then delete `~/.emacs`
kaerfkeerg · 2022-10-26 08:22
>\~/.emacs >delete ~/.emacs Do you mean delete ```~/.emacs.d``` and make ```~/.emacs```?
LordOfSwines · 2022-10-26 08:54
No, **if** you have the file `~/.emacs` then delete that one but leave `~/.emacs.d`
kaerfkeerg · 2022-10-26 08:57
No, I already checked as I said and I do not have any other folders than ```emacs.d```
[deleted] · 2022-10-26 13:22
[deleted]