Improve interactive debugging commands in xdisp.c
* src/xdisp.c (Fdump_glyph_row, Fdump_tool_bar_row): Allow to specify ROW via prefix argument. Fix the doc strings.
This commit is contained in:
parent
1056b3cbcd
commit
cda219c3df
1 changed files with 33 additions and 12 deletions
39
src/xdisp.c
39
src/xdisp.c
|
@ -19479,19 +19479,34 @@ Only text-mode frames have frame glyph matrices. */)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DEFUN ("dump-glyph-row", Fdump_glyph_row, Sdump_glyph_row, 1, 2, "",
|
DEFUN ("dump-glyph-row", Fdump_glyph_row, Sdump_glyph_row, 1, 2, "P",
|
||||||
doc: /* Dump glyph row ROW to stderr.
|
doc: /* Dump glyph row ROW to stderr.
|
||||||
GLYPH 0 means don't dump glyphs.
|
Interactively, ROW is the prefix numeric argument and defaults to
|
||||||
GLYPH 1 means dump glyphs in short form.
|
the row which displays point.
|
||||||
GLYPH > 1 or omitted means dump glyphs in long form. */)
|
Optional argument GLYPHS 0 means don't dump glyphs.
|
||||||
|
GLYPHS 1 means dump glyphs in short form.
|
||||||
|
GLYPHS > 1 or omitted means dump glyphs in long form. */)
|
||||||
(Lisp_Object row, Lisp_Object glyphs)
|
(Lisp_Object row, Lisp_Object glyphs)
|
||||||
{
|
{
|
||||||
struct glyph_matrix *matrix;
|
struct glyph_matrix *matrix;
|
||||||
EMACS_INT vpos;
|
EMACS_INT vpos;
|
||||||
|
|
||||||
|
if (NILP (row))
|
||||||
|
{
|
||||||
|
int d1, d2, d3, d4, d5, ypos;
|
||||||
|
bool visible_p = pos_visible_p (XWINDOW (selected_window), PT,
|
||||||
|
&d1, &d2, &d3, &d4, &d5, &ypos);
|
||||||
|
if (visible_p)
|
||||||
|
vpos = ypos;
|
||||||
|
else
|
||||||
|
vpos = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
CHECK_NUMBER (row);
|
CHECK_NUMBER (row);
|
||||||
matrix = XWINDOW (selected_window)->current_matrix;
|
|
||||||
vpos = XINT (row);
|
vpos = XINT (row);
|
||||||
|
}
|
||||||
|
matrix = XWINDOW (selected_window)->current_matrix;
|
||||||
if (vpos >= 0 && vpos < matrix->nrows)
|
if (vpos >= 0 && vpos < matrix->nrows)
|
||||||
dump_glyph_row (MATRIX_ROW (matrix, vpos),
|
dump_glyph_row (MATRIX_ROW (matrix, vpos),
|
||||||
vpos,
|
vpos,
|
||||||
|
@ -19500,11 +19515,12 @@ GLYPH > 1 or omitted means dump glyphs in long form. */)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DEFUN ("dump-tool-bar-row", Fdump_tool_bar_row, Sdump_tool_bar_row, 1, 2, "",
|
DEFUN ("dump-tool-bar-row", Fdump_tool_bar_row, Sdump_tool_bar_row, 1, 2, "P",
|
||||||
doc: /* Dump glyph row ROW of the tool-bar of the current frame to stderr.
|
doc: /* Dump glyph row ROW of the tool-bar of the current frame to stderr.
|
||||||
GLYPH 0 means don't dump glyphs.
|
Interactively, ROW is the prefix numeric argument and defaults to zero.
|
||||||
GLYPH 1 means dump glyphs in short form.
|
GLYPHS 0 means don't dump glyphs.
|
||||||
GLYPH > 1 or omitted means dump glyphs in long form.
|
GLYPHS 1 means dump glyphs in short form.
|
||||||
|
GLYPHS > 1 or omitted means dump glyphs in long form.
|
||||||
|
|
||||||
If there's no tool-bar, or if the tool-bar is not drawn by Emacs,
|
If there's no tool-bar, or if the tool-bar is not drawn by Emacs,
|
||||||
do nothing. */)
|
do nothing. */)
|
||||||
|
@ -19515,8 +19531,13 @@ do nothing. */)
|
||||||
struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix;
|
struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix;
|
||||||
EMACS_INT vpos;
|
EMACS_INT vpos;
|
||||||
|
|
||||||
|
if (NILP (row))
|
||||||
|
vpos = 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
CHECK_NUMBER (row);
|
CHECK_NUMBER (row);
|
||||||
vpos = XINT (row);
|
vpos = XINT (row);
|
||||||
|
}
|
||||||
if (vpos >= 0 && vpos < m->nrows)
|
if (vpos >= 0 && vpos < m->nrows)
|
||||||
dump_glyph_row (MATRIX_ROW (m, vpos), vpos,
|
dump_glyph_row (MATRIX_ROW (m, vpos), vpos,
|
||||||
TYPE_RANGED_INTEGERP (int, glyphs) ? XINT (glyphs) : 2);
|
TYPE_RANGED_INTEGERP (int, glyphs) ? XINT (glyphs) : 2);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue