From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: crstml@libero.it Newsgroups: gmane.emacs.help Subject: Re: emacs settings priority Date: Mon, 8 Apr 2024 16:52:59 +0200 Message-ID: <4f7175b5-4616-0379-f84f-818407d2d319@libero.it> References: <45fa1e7c-8397-89d9-3c25-ad4c0ffdef6c@libero.it> <86le5s57tm.fsf@gnu.org> <5eb56522-55f0-9b47-31ce-e6772b0622df@libero.it> <864jcf68ac.fsf@gnu.org> <86zfu61nmj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24444"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2 To: Eli Zaretskii , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 08 16:53:42 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rtqNR-00068c-Af for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 08 Apr 2024 16:53:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtqMy-0005H0-W5; Mon, 08 Apr 2024 10:53:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtqMw-0005GO-AR for help-gnu-emacs@gnu.org; Mon, 08 Apr 2024 10:53:10 -0400 Original-Received: from smtp-34.italiaonline.it ([213.209.10.34] helo=libero.it) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtqMt-0000PM-SZ for help-gnu-emacs@gnu.org; Mon, 08 Apr 2024 10:53:10 -0400 Original-Received: from [147.122.63.9] ([147.122.63.9]) by smtp-34.iol.local with ESMTPA id tqMlro05Xz7KJtqMqrCdvt; Mon, 08 Apr 2024 16:53:04 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2021; t=1712587984; bh=aumAjYgYx/Z3Hx7LiNFt/W49RUtETOczEpx2g5t9br0=; h=From; b=tGbI+AA/xi9xS8J00RYfZhAn/GyyiMzQ4cOlS6sBRw02s3tY7oov0qhzOAg557LSd P6iOiL3YEsWJ7D/VV0yAmjAsjR6hCRnSUqoP7M2jhrOhXlDMoD52yV3tRRUCoZ7Xwx rHZ6L8HrkPWWk7VmQMCAgN9mI/YV/ANqiysEzi6WvWMIAxVbCUakbnBlCUr4nkMUfv 2yRQeptNsjqYDnBuEvGzM4N6XiNj2ydr6SDezgq+/jptJyFwyNwrz7DKapdfHtRV2s ctOHWDVPcJG273UX7Yk5MvZrQShcW81SUBllugI+PEN1xbGrocU2wS/3stXLS/zl9Y omjCoZCeXPqug== X-CNFS-Analysis: v=2.4 cv=HcffTTE8 c=1 sm=1 tr=0 ts=661404d0 cx=a_exe a=aYAaEy0ZYSJpPb0aiD0MCQ==:117 a=aYAaEy0ZYSJpPb0aiD0MCQ==:17 a=IkcTkHD0fZMA:10 a=A5fSW98T59aef79GoVYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 In-Reply-To: <86zfu61nmj.fsf@gnu.org> X-CMAE-Envelope: MS4xfHpByD92F+U7I/QVJsa1FQ2MmmWjmxXmjTjefWk97Ag4VIPkk+Vsz7LlELjZiexBIS6E4mBwMjD9c0hznp+/CFRaD+1mBpXHmKs2AfHDmLNTK2hPDu7m AInnDTDxawmV6uFxHRB2vf9/QMMoDCL0tbRHXA/MxLsCw2TMZE/L4NoitPkGSprGk+rudHFk7aWuzMFTfkhOXVqgRTZUSUAjElk= Received-SPF: pass client-ip=213.209.10.34; envelope-from=crstml@libero.it; helo=libero.it X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.071, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146271 Archived-At: Eli Zaretskii wrote: >> From: crstml@libero.it >> Date: Sat, 6 Apr 2024 14:58:57 +0200 >> >> Eli Zaretskii wrote: >> (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. > I can reproduce this only partially. I don't have the 10x20 and > Lucida Sans Typewritere fonts, but I do have Lucida Sans Unicode, so I > tried > > emacs -fn "Lucida Sans Unicode-24" > > What this did is that Emacs uses Lucida Sans Unicode font as its > default, but does NOT use the "24" size-specification. If I remove > the ":height 113" part from your default-face spec in .emacs, then > both the font and the size specified on the command line are used. Also this one is a good test because it proves that settings in the configuration file can interfere with what was specified in the command line. >> From these tests it's obvious that -fn has lower precedence than the .emacs >> file. > That conclusion is generally incorrect. There's no "precedence" here. > The command-line options are processed _after_ the .emacs file, but if > you specify overlapping settings, what happens when the command line > is processed depends on what exactly you specified. In this case, you > specified the size in .emacs and font plus size on the command line, > and what happens as result is subject to the Emacs logic of merging > overlapping font specifications. This is valuable information. > >> 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). > Any reason why you specify the font size both on the command line and > in the init file? Not any very special reason. However, here is my usecase: I use emacs daily and I have a init file that I use since years. Now, I need in certain circumstances to start an emacs instance from a script with some different faces (different background color and font size) than those in the configuration file. Trying to do it provided "no results"... due to the reasons you have mentioned above. > >> 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. > The best advice and practice I can recommend is never to specify > overlapping or contradicting settings. Then you will not need to > wonder which one takes precedence and what will be the result. Take > it from someone who uses Emacs for the past 30+ years. > Good to know. In this case I think that probably the best solution for my case would be to start emacs with a different init file. Thank you for your advice Cristian