branch: externals/fontaine
commit fe78a2be64b09f55748fa0c6e62d59e787b761b4
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Update to Fontaine version 3.0.0
---
CHANGELOG.org | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
README.org | 18 ++++++-------
fontaine.el | 2 +-
3 files changed, 96 insertions(+), 10 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index a7cca2d0c3..1b64834427 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -12,6 +12,92 @@ the manual: <https://protesilaos.com/emacs/fontaine>.
#+toc: headlines 1 insert TOC here, with one headline level
+* Version 3.0.0 on 2025-02-20
+:PROPERTIES:
+:CUSTOM_ID: h:a8cd979f-851f-4e97-ae90-96022b4cfe7a
+:END:
+
+This version changes the underlying implementation of Fontaine's font
+configuration presets. In principle, this should not have any effect
+on how users experience the package, though there are some important
+details that are different.
+
+** Fontaine is now a "theme"
+:PROPERTIES:
+:CUSTOM_ID: h:6d051d64-2623-4877-935f-4792579888a3
+:END:
+
+Fontaine has always modified typography-related faces, such as
+~default~, ~fixed-pitch~, and ~variable-pitch~, to apply the font
+family, height, and weight specified by the user. In the past, this
+was done in a way that could get overridden under certain conditions,
+such as by loading a theme after setting a Fontaine preset configuration.
+
+By making Fontaine a theme, we guarantee that its settings are not
+undone. In practice, this means that users do not have to re-apply the
+current preset after loading a theme. The function
~fontaine-apply-current-preset~
+is thus obsolete.
+
+In Emacs, a "theme" is a bundle of configurations. Those typically
+cover colours (such as with my ~modus-themes~), but a theme can focus
+on other settings as well. For example, the popular ~use-package~ is
+internally done as a theme (check the value of ~custom-known-themes~).
+
+Fontaine is a theme in the same way ~use-package~ is, meaning that it
+will (i) persist its effects, (ii) not show up in the
+~custom-enabled-themes~ and so not be affected by something like
+~(mapc #'disable-theme custom-enabled-themes)~,
+and (iii) not be an option among those presented by ~load-theme~.
+
+There are no known bugs, though please contact me if you encounter a
+scenario where Fontaine does not do the right thing. Thanks, in this
+regard, to Haruko and Emily Hyland for reporting a couple of bugs:
+
+- <https://github.com/protesilaos/fontaine/issues/14>.
+- <https://github.com/protesilaos/fontaine/issues/15>.
+
+** Fontaine no longer has frame-specific effects
+:PROPERTIES:
+:CUSTOM_ID: h:01648e81-6499-41ef-b200-b6784cbf4c96
+:END:
+
+In the past, users could apply a Fontaine preset to the current frame
+without affecting other frames. While this could be useful in certain
+situations, it was ultimately making the code more complex for
+marginal gains. As part of the transition to a theme, which is anyway
+global, I am removing everything related to frame-specific functionality.
+
+** Quality-of-life refinements
+:PROPERTIES:
+:CUSTOM_ID: h:e4e3a4c0-aefd-4398-a46b-dbfa102b04fa
+:END:
+
+- The ~fontaine-generic-face-families~ are used when necessary to
+ guard against ~nil~ values. Those font families are symbolic
+ references to whatever the operating system is configured to use
+ (e.g. on Linux this is handled by fontconfig).
+
+- If Fontaine is instructed to load an invalid preset, it displays a
+ warning and does nothing else. Before, it would produce an error,
+ which could prevent Emacs from starting up normally if this were to
+ happen at startup. A warning is enough to inform the user of what is
+ happening.
+
+- Same principle as above when Emacs is not ran in a graphical
+ interface. In text terminals, Fontaine cannot work because it is not
+ possible to have different font families, styles, and heights, than
+ those of the terminal (hence the backronym of FONTAINE "Fonts,
+ Ornaments, and Neat Typography Are Irrelevant in Non-graphical
+ Emacs"). Thanks to Jorge Gomez for the patch in pull request 13:
+ <https://github.com/protesilaos/fontaine/pull/13>. Further tweaks by
+ me.
+
+- The ~fontaine-toggle-preset~ command will produce an error if it
+ cannot find the preset it is supposed to switch to. The toggle is
+ between the last two loaded presets, as done by the command
+ ~fontaine-set-preset~ (the ~fontaine-mode~ takes care to persist the
+ relevant history).
+
* Version 2.1.0 on 2024-09-02
:PROPERTIES:
:CUSTOM_ID: h:684117cb-76c6-4a74-97ef-a37852bd3612
diff --git a/README.org b/README.org
index 54a2ee5fd5..ea8b54f046 100644
--- a/README.org
+++ b/README.org
@@ -4,9 +4,9 @@
#+language: en
#+options: ':t toc:nil author:t email:t num:t
#+startup: content
-#+macro: stable-version 2.1.0
-#+macro: release-date 2024-09-02
-#+macro: development-version 3.0.0-dev
+#+macro: stable-version 3.0.0
+#+macro: release-date 2025-02-20
+#+macro: development-version 3.1.0-dev
#+export_file_name: fontaine.texi
#+texinfo_filename: fontaine.info
#+texinfo_dir_category: Emacs misc features
@@ -682,8 +682,8 @@ Remember to read the relevant doc strings.
[ Since version =2.0.0=, there exists the ~fontaine-mode~ which does
this automatically. The =fontaine-apply-current-preset= is obsolete
- as of {{{development-version}}} because Fontaine is now implemented
- as a "theme" and thus does not get overwritten by other themes. ]
+ as of version =3.0.0= because Fontaine is now implemented as a
+ "theme" and thus does not get overwritten by other themes. ]
#+findex: fontaine-apply-current-preset
#+vindex: fontaine-current-preset
@@ -708,8 +708,8 @@ a hook that is ran at the post ~load-theme~ phase.
[ Since version =2.0.0=, there exists the ~fontaine-mode~ which does
this automatically. The =fontaine-apply-current-preset= is obsolete
- as of {{{development-version}}} because Fontaine is now implemented
- as a "theme" and thus does not get overwritten by other themes. ]
+ as of version =3.0.0= because Fontaine is now implemented as a
+ "theme" and thus does not get overwritten by other themes. ]
Emacs 29 provides the ~enable-theme-functions~, which we can use to
persist or restore a font preset thus
([[#h:f1b48050-e8e1-4689-b92f-7776bbaa55a4][Persist font configurations on
theme switch]]):
@@ -725,8 +725,8 @@ persist or restore a font preset thus
([[#h:f1b48050-e8e1-4689-b92f-7776bbaa55a4
[ Since version =2.0.0=, there exists the ~fontaine-mode~ which does
this automatically. The =fontaine-apply-current-preset= is obsolete
- as of {{{development-version}}} because Fontaine is now implemented
- as a "theme" and thus does not get overwritten by other themes. ]
+ as of version =3.0.0= because Fontaine is now implemented as a
+ "theme" and thus does not get overwritten by other themes. ]
For versions of Emacs before 29, there is no built-in theme-agnostic
solution to persisting or restoring a font preset
([[#h:8f76ca89-a20c-4d76-89e6-423f1d8691a4][Theme-agnostic hook for Emacs 29 or
higher]]).
diff --git a/fontaine.el b/fontaine.el
index 93572c68cf..083c2965ed 100644
--- a/fontaine.el
+++ b/fontaine.el
@@ -5,7 +5,7 @@
;; Author: Protesilaos Stavrou <[email protected]>
;; Maintainer: Protesilaos Stavrou <[email protected]>
;; URL: https://github.com/protesilaos/fontaine
-;; Version: 2.1.0
+;; Version: 3.0.0
;; Package-Requires: ((emacs "29.1"))
;; This file is NOT part of GNU Emacs.