unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 67449@debbugs.gnu.org, Dan Jacobson <jidanni@jidanni.org>
Subject: bug#67449: Manual: add how to change default global font size in .emacs
Date: Thu, 30 Nov 2023 08:23:00 +0100	[thread overview]
Message-ID: <87msuvhfhn.fsf@gmail.com> (raw)
In-Reply-To: <83plzs7mln.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 Nov 2023 14:47:16 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> > and the font size can be changed interactively (*note
>> > Text Scale::).
>> 
>> We don't want to change it interactively. We just want to put a line in
>> our .emacs file to change it.
>> 
>> >    There are several different ways to specify a different font:
>> 
>> We don't want to specify a different font. We don't care about the font.
>> We just want to make it use a different size as default.
>
> So just specify the same font with the different size.  Case closed.
>
>> >    • Add a line to your init file, modifying the variable
>> >      ‘default-frame-alist’ to specify the ‘font’ parameter (*note Frame
>> >      Parameters::), like this:
>> > 
>> >           (add-to-list 'default-frame-alist
>> >                        '(font . "DejaVu Sans Mono-10"))
>> 
>> Yes we want to add a line to our .emacs file. But we don't want to have
>> to say some font name. We just want to tell emacs to use "default size
>> 14, not 10".
>
> So just specify the same font with the different size.  Case closed.
>
>> >      This makes the font the default on all graphical frames created
>> >      after restarting Emacs with that init file.
>> > 
>> >    • Add an ‘emacs.font’ X resource setting to your X resource file,
>> >      like this:
>> > 
>> >           emacs.font: DejaVu Sans Mono-12
>> 
>> Again we are forced to name a font. We don't want to name a font. We
>> just want to tell emacs to do what it does, but at scale 14 not 10.
>
> So just specify the same font with the different size.  Case closed.
>
>> Anyway maybe there is a glimmer of hope with some line like
>> -*-*-*-14-*-*-*- or something, but it so frustrating.
>
> A two-liner in the init file or a X resource setting cannot be
> anywhere near frustrating.
>
>> Whereas in other apps one can just choose a default font size, in
>> emacs ... well you have to go down to the car dealership and learn
>> about muffler types. You can't just tell the rental agency to
>> deliver an economy sized car.
>
> Or you can do the above, which is easy and a no-brainer, really.  Case
> closed.  And this bug is also closed.  Please accept the decision and
> stop pushing.

FWIW, I've been following this thread because I empathize with Dan in
this report: depending on the system I use, emacs -Q gets me either
Ubuntu Mono (GNOME/Ubuntu 22.04), Noto Sans Mono (Plasma/Debian 12) or
Source Code Pro (Plasma/openSUSE Tumbleweed).

In practice I customize Emacs to pick DejaVu Sans Mono in every setup,
but that's a decision I take for incidental reasons (character coverage,
bold/italic variants); so indeed I happen to

> just specify the same font

but I can imagine wanting to keep the system's default _family_, yet
have a consistent font _size_ across all my setups, in which case having
to spell out the font in my dotfiles is a bother.

(Granted, the X resource solution cited above might work?  Would it work
--with-pgtk on Wayland?)

(Granted², as soon as each "setup" differs in screen size, resolution,
or density, "a consistent font _size_ across all my setups" probably
requires bespoke face heights for each setup; still, that does not mean
I'd want to mess with the _family_)

FWIW², if I were to attempt to "just set the size, ignoring the font" in
my dotfiles, I'd probably go with either

  ;; (1)
  (set-face-attribute 'default nil :height my/height)

or

  ;; (2)
  (let* ((family (face-attribute 'default :family))
         (font-desc (format "%s-%s" family my/size)))
    (add-to-list 'default-frame-alist
                 (cons 'font font-desc)))

?  Not saying that's worth documenting, just hoping that'll help Dan
sort out his config.





  reply	other threads:[~2023-11-30  7:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-26  2:18 bug#67449: Manual: add how to change default global font size in .emacs Dan Jacobson
2023-11-26  5:50 ` Eli Zaretskii
2023-11-26 13:28   ` Dan Jacobson
2023-11-26 13:50     ` Eli Zaretskii
2023-11-26 20:55       ` Dan Jacobson
2023-11-27  3:27         ` Eli Zaretskii
2023-11-29  3:10           ` Dan Jacobson
2023-11-29 12:47             ` Eli Zaretskii
2023-11-30  7:23               ` Kévin Le Gouguec [this message]
2023-11-30  8:39                 ` Eli Zaretskii
2023-12-02  3:16                   ` Dan Jacobson
2023-12-02  7:42                     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87msuvhfhn.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=67449@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jidanni@jidanni.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).