aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2017-12-09 15:21:21 +0200
committerEli Zaretskii2017-12-09 15:21:21 +0200
commitcda219c3df688cb54b20bf8d061dac56b8f754be (patch)
tree66b51de1ef6da0c99a1b95e1cf6a86ed667c23f2 /src
parent1056b3cbcd8ec149df8a117df90fb0a4f388ea4c (diff)
downloademacs-cda219c3df688cb54b20bf8d061dac56b8f754be.tar.gz
emacs-cda219c3df688cb54b20bf8d061dac56b8f754be.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 3de57dbcd19..0a37013c560 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19479,19 +19479,34 @@ Only text-mode frames have frame glyph matrices. */)
19479} 19479}
19480 19480
19481 19481
19482DEFUN ("dump-glyph-row", Fdump_glyph_row, Sdump_glyph_row, 1, 2, "", 19482DEFUN ("dump-glyph-row", Fdump_glyph_row, Sdump_glyph_row, 1, 2, "P",
19483 doc: /* Dump glyph row ROW to stderr. 19483 doc: /* Dump glyph row ROW to stderr.
19484GLYPH 0 means don't dump glyphs. 19484Interactively, ROW is the prefix numeric argument and defaults to
19485GLYPH 1 means dump glyphs in short form. 19485the row which displays point.
19486GLYPH > 1 or omitted means dump glyphs in long form. */) 19486Optional argument GLYPHS 0 means don't dump glyphs.
19487GLYPHS 1 means dump glyphs in short form.
19488GLYPHS > 1 or omitted means dump glyphs in long form. */)
19487 (Lisp_Object row, Lisp_Object glyphs) 19489 (Lisp_Object row, Lisp_Object glyphs)
19488{ 19490{
19489 struct glyph_matrix *matrix; 19491 struct glyph_matrix *matrix;
19490 EMACS_INT vpos; 19492 EMACS_INT vpos;
19491 19493
19492 CHECK_NUMBER (row); 19494 if (NILP (row))
19495 {
19496 int d1, d2, d3, d4, d5, ypos;
19497 bool visible_p = pos_visible_p (XWINDOW (selected_window), PT,
19498 &d1, &d2, &d3, &d4, &d5, &ypos);
19499 if (visible_p)
19500 vpos = ypos;
19501 else
19502 vpos = 0;
19503 }
19504 else
19505 {
19506 CHECK_NUMBER (row);
19507 vpos = XINT (row);
19508 }
19493 matrix = XWINDOW (selected_window)->current_matrix; 19509 matrix = XWINDOW (selected_window)->current_matrix;
19494 vpos = XINT (row);
19495 if (vpos >= 0 && vpos < matrix->nrows) 19510 if (vpos >= 0 && vpos < matrix->nrows)
19496 dump_glyph_row (MATRIX_ROW (matrix, vpos), 19511 dump_glyph_row (MATRIX_ROW (matrix, vpos),
19497 vpos, 19512 vpos,
@@ -19500,11 +19515,12 @@ GLYPH > 1 or omitted means dump glyphs in long form. */)
19500} 19515}
19501 19516
19502 19517
19503DEFUN ("dump-tool-bar-row", Fdump_tool_bar_row, Sdump_tool_bar_row, 1, 2, "", 19518DEFUN ("dump-tool-bar-row", Fdump_tool_bar_row, Sdump_tool_bar_row, 1, 2, "P",
19504 doc: /* Dump glyph row ROW of the tool-bar of the current frame to stderr. 19519 doc: /* Dump glyph row ROW of the tool-bar of the current frame to stderr.
19505GLYPH 0 means don't dump glyphs. 19520Interactively, ROW is the prefix numeric argument and defaults to zero.
19506GLYPH 1 means dump glyphs in short form. 19521GLYPHS 0 means don't dump glyphs.
19507GLYPH > 1 or omitted means dump glyphs in long form. 19522GLYPHS 1 means dump glyphs in short form.
19523GLYPHS > 1 or omitted means dump glyphs in long form.
19508 19524
19509If there's no tool-bar, or if the tool-bar is not drawn by Emacs, 19525If there's no tool-bar, or if the tool-bar is not drawn by Emacs,
19510do nothing. */) 19526do nothing. */)
@@ -19515,8 +19531,13 @@ do nothing. */)
19515 struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix; 19531 struct glyph_matrix *m = XWINDOW (sf->tool_bar_window)->current_matrix;
19516 EMACS_INT vpos; 19532 EMACS_INT vpos;
19517 19533
19518 CHECK_NUMBER (row); 19534 if (NILP (row))
19519 vpos = XINT (row); 19535 vpos = 0;
19536 else
19537 {
19538 CHECK_NUMBER (row);
19539 vpos = XINT (row);
19540 }
19520 if (vpos >= 0 && vpos < m->nrows) 19541 if (vpos >= 0 && vpos < m->nrows)
19521 dump_glyph_row (MATRIX_ROW (m, vpos), vpos, 19542 dump_glyph_row (MATRIX_ROW (m, vpos), vpos,
19522 TYPE_RANGED_INTEGERP (int, glyphs) ? XINT (glyphs) : 2); 19543 TYPE_RANGED_INTEGERP (int, glyphs) ? XINT (glyphs) : 2);