0

I have two versions of emacs installed on my system (Linux Mint 21 Cinnamon):

~ $ type --all emacs
emacs is /usr/local/bin/emacs
emacs is /usr/bin/emacs

The /usr/local/bin/emacs is the version 28.2 I have installed from source and /usr/bin/emacs is the version 27.1 installed using apt from repositories.

After making changes to `~/.emacs I have noticed that the version 27.1 loads them from that file, but the version 28.2 does not.

What is wrong with my expectation that the version 28.2 should load the ~/.emacs on start and what should I do in order to make the version 28.2 loading the initial settings?

There is nor other .emacs nor other .emacs.d on the system.

~ $ locate -b **/.emacs.d
/home/neo/.emacs.d
~ $ locate -b [.]emacs
/home/neo/.emacs

Below an image of how the two Emacs Windows look like. I have first started the 27.1, then the 28.2 version:

emacss

If both versions would load the same initialization file they should look the same way, right? But they don't.

7
  • Check your value of variable user-emacs-directory? Have you set a HOME environment variable?
    – Drew
    Mar 18 at 15:29
  • @Drew : see my answer for the actual reason of the difference in background colors. What is still not clear to me is which option I have to set in the ~\.emacs file to get the font faces shown the same way. Any idea what makes the boxes scattered over the words instead of having one around the line?
    – Claudio
    Mar 18 at 16:05
  • By the way: how to check the value of the variable user-emacs-directory? M-x user-emacs-directory does not work ...
    – Claudio
    Mar 18 at 16:09
  • It's a variable. C-h v user-emacs-directory.
    – Drew
    Mar 18 at 16:56
  • (defvar user-emacs-directory ;; The value does not matter since Emacs sets this at startup. nil LOL . Isn't it weird? Help says the variable will be set there to ` ~/.emacs.d/`. The script tells it doesn't matter ... WHAT of this is now really true???
    – Claudio
    Mar 18 at 17:01

1 Answer 1

0

If both versions would load the same initialization file they should look the same way, right?

No, not right. Both of the versions can load the same initialization file, but in spite of that still look different.

How could it be? The reason for this is the fact that although all Emacs versions load the same initialization file looking for it in same places and in same order, different versions can come with different default values not addressed by the initialization file. In addition to that different Emacs versions store the theme files in different folders. To see it yourself you can use locate with the name of one of the themes coming packaged with both versions like for example the adwaita-theme:

~ $ locate adwaita-theme.el
/usr/local/share/emacs/28.2/etc/themes/adwaita-theme.el
/usr/share/emacs/27.1/etc/themes/adwaita-theme.el

In other words, your assumption that Emacs 28.2 does not load the initialization file is wrong. It does load it as you can see from the non-standard font-face shown in both windows, but ... it can't find the custom theme you provided for the version 27.1 because it is not stored in the folder the version 28.2 checks for themes. This is the actual reason for the different colors of the background.

To solve the problem with not the same background color in both windows copy the themes present in the 27.1 folder over to the themes folder of version 28.2. With this done the windows started one after another will look like:

emacses2

You can see that now the background color of both windows is the same what shows you that Emacs 28.2 has loaded the initial settings from the ~/.emacs file.

Why there are still differences in the layout of both windows is out of scope here as the main issue addressed by your question is solved by revealing the reason why you erroneously assumed that the initialization file is not loaded by the other Emacs version.

And please be aware that if you modify the theme in one of the Emacs versions it will not be mirrored in the other one, like it is the case if you modify the settings in the ~/.emacs initialization file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.