diff options
| author | Eli Zaretskii | 2017-12-09 15:21:21 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-12-09 15:21:21 +0200 |
| commit | cda219c3df688cb54b20bf8d061dac56b8f754be (patch) | |
| tree | 66b51de1ef6da0c99a1b95e1cf6a86ed667c23f2 /src | |
| parent | 1056b3cbcd8ec149df8a117df90fb0a4f388ea4c (diff) | |
| download | emacs-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.c | 45 |
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 | ||
| 19482 | DEFUN ("dump-glyph-row", Fdump_glyph_row, Sdump_glyph_row, 1, 2, "", | 19482 | DEFUN ("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. |
| 19484 | GLYPH 0 means don't dump glyphs. | 19484 | Interactively, ROW is the prefix numeric argument and defaults to |
| 19485 | GLYPH 1 means dump glyphs in short form. | 19485 | the row which displays point. |
| 19486 | GLYPH > 1 or omitted means dump glyphs in long form. */) | 19486 | Optional argument GLYPHS 0 means don't dump glyphs. |
| 19487 | GLYPHS 1 means dump glyphs in short form. | ||
| 19488 | GLYPHS > 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 | ||
| 19503 | DEFUN ("dump-tool-bar-row", Fdump_tool_bar_row, Sdump_tool_bar_row, 1, 2, "", | 19518 | DEFUN ("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. |
| 19505 | GLYPH 0 means don't dump glyphs. | 19520 | Interactively, ROW is the prefix numeric argument and defaults to zero. |
| 19506 | GLYPH 1 means dump glyphs in short form. | 19521 | GLYPHS 0 means don't dump glyphs. |
| 19507 | GLYPH > 1 or omitted means dump glyphs in long form. | 19522 | GLYPHS 1 means dump glyphs in short form. |
| 19523 | GLYPHS > 1 or omitted means dump glyphs in long form. | ||
| 19508 | 19524 | ||
| 19509 | If there's no tool-bar, or if the tool-bar is not drawn by Emacs, | 19525 | If there's no tool-bar, or if the tool-bar is not drawn by Emacs, |
| 19510 | do nothing. */) | 19526 | do 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); |