summaryrefslogtreecommitdiff
path: root/src/fontset.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-09-09 02:21:16 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-09-09 02:22:24 -0700
commit6e5d81ff4536ed117dfac269357c46dbdc1890c9 (patch)
treece637dad553f16c3dab02720bee505c938416beb /src/fontset.c
parent39dca94701de81d02c75316e32d67e3677bd685d (diff)
downloademacs-6e5d81ff4536ed117dfac269357c46dbdc1890c9.tar.gz
Improvements for curved quotes on Linux consule
This should help Emacs work better out-of-the-box on Linux consoles, which have only limited support for displaying Unicode characters. Also, undo the recent change that caused text-quoting-style to affect quote display on terminals, so that the two features are independent. See Alan Mackenzie in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00244.html Finally, add a style parameter to startup--setup-quote-display, so that this function can also be invoked after startup, with different styles depending on user preference at the time. * configure.ac: Check for linux/kd.h header. * doc/emacs/display.texi (Text Display): Document quote display. * doc/lispref/display.texi (Active Display Table): * etc/NEWS: * lisp/startup.el (startup--setup-quote-display, command-line): text-quoting-style no longer affects quote display. * doc/lispref/frames.texi (Terminal Parameters): Fix typo. * lisp/international/mule-util.el (char-displayable-p): * lisp/startup.el (startup--setup-quote-display): On a text terminal supporting glyph codes, use the reported glyph codes instead of the terminal coding system, as this is more accurate on the Linux console. * lisp/startup.el (startup--setup-quote-display): New optional arg STYLE. * src/fontset.c (Finternal_char_font): Report glyph codes for a text terminal, if they are available. Currently this is supported only for the Linux console. * src/termhooks.h (struct terminal): New member glyph-code-table. * src/terminal.c [HAVE_LINUX_KD_H]: Include <errno.h>, <linux/kd.h>. (calculate_glyph_code_table) [HAVE_LINUX_KD_H]: New function. (terminal_glyph_code): New function.
Diffstat (limited to 'src/fontset.c')
-rw-r--r--src/fontset.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 50fcc648548..f8334f16e55 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1786,18 +1786,23 @@ update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset)
}
}
+/* Return a description of the font at POSITION in the current buffer.
+ If the 2nd optional arg CH is non-nil, it is a character to check
+ the font instead of the character at POSITION.
-/* Return a cons (FONT-OBJECT . GLYPH-CODE).
+ For a graphical display, return a cons (FONT-OBJECT . GLYPH-CODE).
FONT-OBJECT is the font for the character at POSITION in the current
buffer. This is computed from all the text properties and overlays
that apply to POSITION. POSITION may be nil, in which case,
FONT-SPEC is the font for displaying the character CH with the
- default face.
+ default face. GLYPH-CODE is the glyph code in the font to use for
+ the character.
- GLYPH-CODE is the glyph code in the font to use for the character.
-
- If the 2nd optional arg CH is non-nil, it is a character to check
- the font instead of the character at POSITION.
+ For a text terminal, return a nonnegative integer glyph code for
+ the character, or a negative integer if the character is not
+ displayable. Terminal glyph codes are system-dependent integers
+ that represent displayable characters: for example, on a Linux x86
+ console they represent VGA code points.
It returns nil in the following cases:
@@ -1809,6 +1814,8 @@ update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset)
(3) If POSITION is not nil, and the current buffer is not displayed
in any window.
+ (4) For a text terminal, the terminal does not report glyph codes.
+
In addition, the returned font name may not take into account of
such redisplay engine hooks as what used in jit-lock-mode if
POSITION is currently not visible. */
@@ -1860,7 +1867,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
if (! CHAR_VALID_P (c))
return Qnil;
if (!FRAME_WINDOW_P (f))
- return Qnil;
+ return terminal_glyph_code (FRAME_TERMINAL (f), c);
/* We need the basic faces to be valid below, so recompute them if
some code just happened to clear the face cache. */
if (FRAME_FACE_CACHE (f)->used == 0)