|
From: | crstml |
Subject: | Re: emacs settings priority |
Date: | Sat, 6 Apr 2024 14:58:57 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2 |
Eli Zaretskii wrote:
From: crstml@libero.it Date: Fri, 5 Apr 2024 18:07:57 +0200 Eli Zaretskii wrote:I've tried without success to find in the manual information about these priorities/precedences. Is it possible to know how emacs decides what font is used when the same font is specified in more places: X resource, command line, init file?Why is it important to know?When a user specify some setting in the command line for example he expects some feedback from the application. If the effect of that setting is not visible the user must understand the cause.If you can describe a situation where a setting from the command line didn't have any effect, please do.
Of course. Here is my configuration: ---- begin OS Version ---- Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm Basically a clean Debian 12 installation. ---- end OS Version ---- ---- begin ~/.emacs ---- (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. '(default ((t (:inherit nil :extend nil :stipple nil :background "black" :foreground "gray" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 113 :width normal)))) '(font-lock-builtin-face ((t (:foreground "cornflower blue")))) '(font-lock-comment-delimiter-face ((default (:inherit font-lock-comment-face)) (((class color) (min-colors 16)) nil))) '(font-lock-comment-face ((t (:foreground "red")))) '(font-lock-function-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "gray" :weight bold)))) '(font-lock-keyword-face ((((class color) (min-colors 88) (background dark)) (:foreground "RoyalBlue")))) '(font-lock-string-face ((((class color) (min-colors 88) (background dark)) (:foreground "orange")))) '(font-lock-type-face ((((class color) (min-colors 88) (background dark)) (:foreground "darkslategray")))) '(font-lock-variable-name-face ((t (:foreground "goldenrod")))) '(mode-line ((((class color) (min-colors 88)) (:background "orange" :foreground "black"))))) ;;No other contents is present in this file ;; ---- end ~/.emacs ---- Here are the tests: 1) Try the following command lines: emacs -fn 10x20 & emacs -fn lucidasanstypewriter-24 & There is no difference between the emacs instances regarding the fonts. 2) Rename the .emacs to .emacs.disabled and run the same commands again. mv .emacs .emacs.disabled emacs -fn 10x20 & emacs -fn lucidasanstypewriter-24 & Now without the .emacs file the -fn command line option is taken into account. From these tests it's obvious that -fn has lower precedence than the .emacs file. It turns that probably I always need to specify an init file in the command line when I start emacs (if sometimes I want a different behavior). Not that it's impossible or difficult. But I had to do some experiments to understand what is going on and in the end I was interested if this stuff is documented probably with some advice/best practices about how the users should set up their environments.
Users aren't supposed to specify contradictory setting via several different means of doing so.Is the fact that the users aren't supposed to specify different settings via several different means an overall design decision? If yes, then the users should be aware of this decision and it should be specified in the manual. But (personal opinion based on my way of using emacs) such a design decision is not very wise. Users must be able to control how the settings are applied or what are the causes of their impossibility of specifying settings. Maybe I want to start an instance of emacs with a different background color and font size in a certain context (using the command line or a context dependent configuration file) and I see that these settings are not applied. How can I understand why not or what can I do?Please describe a specific situation where this happens, and let's take it from there. You seem to be talking about some general principles, and I'm not sure that is useful. In general, Emacs does sensible things in these cases, so it isn't like the user is completely in the dark.
[Prev in Thread] | Current Thread | [Next in Thread] |