diff options
| author | Eli Zaretskii | 2016-10-08 22:03:51 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-10-08 22:03:51 +0300 |
| commit | 4ff4b66df8da175d8df292d12a30ab50285b6917 (patch) | |
| tree | e08622cd6b0790172a9c2082a652876720e33e4f | |
| parent | c03d44bb3d975a982a9d84eea54b73cc3d049035 (diff) | |
| download | emacs-4ff4b66df8da175d8df292d12a30ab50285b6917.tar.gz emacs-4ff4b66df8da175d8df292d12a30ab50285b6917.zip | |
Allow selection of font for symbols as in Emacs 24.x
* src/fontset.c (syms_of_fontset) <use-default-font-for-symbols>:
New boolean variable.
(face_for_char): Use it to fall back to pre-Emacs 25.1 behavior
when selecting fonts for displaying symbol and punctuation
characters. (Bug#24644)
* etc/NEWS: Mention the new variable.
| -rw-r--r-- | etc/NEWS | 15 | ||||
| -rw-r--r-- | src/fontset.c | 13 |
2 files changed, 25 insertions, 3 deletions
| @@ -24,8 +24,19 @@ This is a bug-fix release with (almost) no new features. | |||
| 24 | `find-function-after-hook'. | 24 | `find-function-after-hook'. |
| 25 | 25 | ||
| 26 | +++ | 26 | +++ |
| 27 | *** New basic face 'fixed-pitch-serif', for a fixed-width font with serifs. | 27 | ** New basic face 'fixed-pitch-serif', for a fixed-width font with serifs. |
| 28 | The Info-quoted and tex-verbatim faces now default to inheriting from it. | 28 | The Info-quoted and tex-verbatim faces now default to inheriting from |
| 29 | it. | ||
| 30 | |||
| 31 | --- | ||
| 32 | ** New variable 'use-default-font-for-symbols' for backward compatibility. | ||
| 33 | This variable allows to get back pre-Emacs 25 behavior whereby the | ||
| 34 | font for displaying symbol and punctuation characters was always | ||
| 35 | selected according to your fontset setup. Emacs 25 by default tries | ||
| 36 | to use the default face's font for such characters, disregarding the | ||
| 37 | fontsets if the default font supports these characters. Set this | ||
| 38 | variable to nil to disable the new behavior and get back the old | ||
| 39 | behavior. | ||
| 29 | 40 | ||
| 30 | 41 | ||
| 31 | * Installation Changes in Emacs 25.1 | 42 | * Installation Changes in Emacs 25.1 |
diff --git a/src/fontset.c b/src/fontset.c index dc037a807cd..74e7df5ae09 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -883,7 +883,8 @@ face_for_char (struct frame *f, struct face *face, int c, | |||
| 883 | if (ASCII_CHAR_P (c) || CHAR_BYTE8_P (c)) | 883 | if (ASCII_CHAR_P (c) || CHAR_BYTE8_P (c)) |
| 884 | return face->ascii_face->id; | 884 | return face->ascii_face->id; |
| 885 | 885 | ||
| 886 | if (c > 0 && EQ (CHAR_TABLE_REF (Vchar_script_table, c), Qsymbol)) | 886 | if (use_default_font_for_symbols /* let the user disable this feature */ |
| 887 | && c > 0 && EQ (CHAR_TABLE_REF (Vchar_script_table, c), Qsymbol)) | ||
| 887 | { | 888 | { |
| 888 | /* Fonts often have characters for punctuation and other | 889 | /* Fonts often have characters for punctuation and other |
| 889 | symbols, even if they don't match the 'symbol' script. So | 890 | symbols, even if they don't match the 'symbol' script. So |
| @@ -2112,6 +2113,16 @@ This affects how a composite character which contains | |||
| 2112 | such a character is displayed on screen. */); | 2113 | such a character is displayed on screen. */); |
| 2113 | Vuse_default_ascent = Qnil; | 2114 | Vuse_default_ascent = Qnil; |
| 2114 | 2115 | ||
| 2116 | DEFVAR_BOOL ("use-default-font-for-symbols", use_default_font_for_symbols, | ||
| 2117 | doc: /* | ||
| 2118 | If non-nil, use the default face's font for symbols and punctuation. | ||
| 2119 | |||
| 2120 | By default, Emacs will try to use the default face's font for | ||
| 2121 | displaying symbol and punctuation characters, disregarding the | ||
| 2122 | fontsets, if the default font can display the character. | ||
| 2123 | Set this to nil to make Emacs honor the fontsets instead. */); | ||
| 2124 | use_default_font_for_symbols = 1; | ||
| 2125 | |||
| 2115 | DEFVAR_LISP ("ignore-relative-composition", Vignore_relative_composition, | 2126 | DEFVAR_LISP ("ignore-relative-composition", Vignore_relative_composition, |
| 2116 | doc: /* | 2127 | doc: /* |
| 2117 | Char table of characters which are not composed relatively. | 2128 | Char table of characters which are not composed relatively. |