Subject: Re: bug#75858: [PATCH] Display separators on tty menus with display table entries

From: Gerd Möllmann <[email-masked]>
Date: Sun, 26 Jan 2025 16:06:42 +0100

Eli Zaretskii <[email-masked]> writes:

> box-double-down-left is mentioned twice, box-double-up-right
> missing.

Please find fixes for these + NEWS + Elisp manual attached.

>From 50bcb9582df7eadef107badfe2369661a70cbab1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <[email-masked]>
Date: Sun, 26 Jan 2025 16:03:29 +0100
Subject: [PATCH] Info manual, NEWS, and further doc string fixes

---
 doc/lispref/display.texi | 36 ++++++++++++++++++++++++++++++------
 etc/NEWS                 | 13 ++++++++++++-
 lisp/disp-table.el       | 15 ++++++++-------
 3 files changed, 50 insertions(+), 14 deletions(-)

diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index b17ee2e96a1..39f182995c0 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -8715,6 +8715,20 @@ Display Tables
 windows, and if there are no vertical scroll bars and no dividers
 (@pxref{Window Dividers}), Emacs uses a thin line to indicate the
 border.
+
+@item 6 to 11
+
+The glyphs for a single-line border around child frames on a terminal,
+in the order of vertical, horizontal, down-right edge, down-left edge,
+up-right, and up-left edge glyphs.  The horizontal glyph is also used for
+the single-line tty menu separator.
+
+@item 12 to 17
+
+The glyphs for a double-line border, in the order of vertical,
+horizontal, down-right edge, down-left edge, up-right, and up-left edge
+glyphs. The horizontal glyph is also used for the single-line tty menu
+separator, the other glyphs are not yet used.
 @end table
 
   For example, here is how to construct a display table that mimics
@@ -8737,24 +8751,34 @@ Display Tables
 @defun display-table-slot display-table slot
 This function returns the value of the extra slot @var{slot} of
 @var{display-table}.  The argument @var{slot} may be a number from 0 to
-5 inclusive, or a slot name (symbol).  Valid symbols are
-@code{truncation}, @code{wrap}, @code{escape}, @code{control},
-@code{selective-display}, and @code{vertical-border}.
+17 inclusive, or a slot name, a symbol.
 @end defun
 
 @defun set-display-table-slot display-table slot value
 This function stores @var{value} in the extra slot @var{slot} of
 @var{display-table}.  The argument @var{slot} may be a number from 0 to
-5 inclusive, or a slot name (symbol).  Valid symbols are
-@code{truncation}, @code{wrap}, @code{escape}, @code{control},
-@code{selective-display}, and @code{vertical-border}.
+17 inclusive, or a slot name, a symbol.
 @end defun
 
+Valid slot name symbols are @code{truncation}, @code{wrap},
+@code{escape}, @code{control}, @code{selective-display},
+@code{vertical-border}, @code{box-vertical}, @code{box-horizontal},
+@code{box-down-right}, @code{box-down-left}, @code{box-up-right},
+@code{box-up-left}, @code{box-double-vertical},
+@code{box-double-horizontal}, @code{box-double-down-right},
+@code{box-double-down-left}, @code{box-double-down-left},
+@code{box-double-up-left}.
+
 @defun describe-display-table display-table
 This function displays a description of the display table
 @var{display-table} in a help buffer.
 @end defun
 
+@defun standard-display-unicode-special-glyphs
+This function sets the extra slots of @var{standard-display-table} with
+suitable Unicode characters.
+@end defun
+
 @deffn Command describe-current-display-table
 This command displays a description of the current display table in a
 help buffer.
diff --git a/etc/NEWS b/etc/NEWS
index 385e943c997..b27bb89248c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -47,7 +47,18 @@ init file.
 
 * Changes in Emacs 31.1
 
----
++++
+** standard-display-table now has more extra slots
+
+standard-display-table has been extended to allow specifying glyphs that
+are used for borders around child frames and menu separators on TTY
+frames.
+
+Call function standard-display-unicode-special-glyphs to set up the
+standard-display-table's extra slots with Unicode characters.  Please
+see the documentation of that function to see which slots of the display
+table it changes.
+
 ** Child frames are now supported on TTY frames.
 This supports use-cases like Posframe, Corfu, and child frames acting
 like tooltips.  Other use-cases of child frames are not supported yet.
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 08acfd04645..738887d0d00 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -68,9 +68,9 @@ display-table-slot
 Valid symbols are `truncation', `wrap', `escape', `control',
 `selective-display', `vertical-border', `box-vertical',
 `box-horizontal', `box-down-right', `box-down-left', `box-up-right',
-`box-up-left',`box-double-vertical',`box-double-horizontal',
+`box-up-left',`box-double-vertical', `box-double-horizontal',
 `box-double-down-right', `box-double-down-left',
-`box-double-down-left',`box-double-up-left',"
+`box-double-up-left', `box-double-up-left',"
   (let ((slot-number
 	 (if (numberp slot) slot
 	   (or (get slot 'display-table-slot)
@@ -84,9 +84,9 @@ set-display-table-slot
 Valid symbols are `truncation', `wrap', `escape', `control',
 `selective-display', `vertical-border', `box-vertical',
 `box-horizontal', `box-down-right', `box-down-left', `box-up-right',
-`box-up-left',`box-double-vertical',`box-double-horizontal',
+`box-up-left',`box-double-vertical', `box-double-horizontal',
 `box-double-down-right', `box-double-down-left',
-`box-double-down-left',`box-double-up-left',"
+`box-double-up-left', `box-double-up-left',"
   (let ((slot-number
 	 (if (numberp slot) slot
 	   (or (get slot 'display-table-slot)
@@ -179,9 +179,10 @@ describe-current-display-table
 (defun standard-display-unicode-special-glyphs ()
   "Display some glyps using Unicode characters.
 The glyphs being changed by this function are `vertical-border',
-`box-vertical',`box-horizontal', `box-down-right', `box-down-right',
-`box-up-left',`box-double-vertical',`box-double-horizontal',
-`box-double-down-right',`box-double-down-right', `box-double-up-left',"
+`box-vertical',`box-horizontal', `box-down-right', `box-down-left',
+`box-up-right', `box-up-left',`box-double-vertical',
+`box-double-horizontal', `box-double-down-right',
+`box-double-down-left', `box-double-up-right', `box-double-up-left',"
   (interactive)
   (set-display-table-slot standard-display-table
 			  'vertical-border (make-glyph-code #x2502))
-- 
2.48.1