all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: crstml@libero.it
To: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org
Subject: Re: emacs settings priority
Date: Sat, 6 Apr 2024 14:58:57 +0200	[thread overview]
Message-ID: <d867e206-2a20-b6a3-2352-604aff10e214@libero.it> (raw)
In-Reply-To: <864jcf68ac.fsf@gnu.org>

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.
>




  reply	other threads:[~2024-04-06 12:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  7:17 emacs settings priority crstml
2024-04-05 12:10 ` Eli Zaretskii
2024-04-05 16:07   ` crstml
2024-04-05 17:14     ` Eli Zaretskii
2024-04-06 12:58       ` crstml [this message]
2024-04-06 16:07         ` Eli Zaretskii
2024-04-08 14:52           ` crstml
2024-04-06 17:55         ` tpeplt
2024-04-06 18:17           ` tpeplt
2024-04-08 14:58             ` crstml

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d867e206-2a20-b6a3-2352-604aff10e214@libero.it \
    --to=crstml@libero.it \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.