]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix minor issues with functions that dump glyph matrices.
authorEli Zaretskii <eliz@gnu.org>
Mon, 3 Nov 2014 17:14:50 +0000 (19:14 +0200)
committerEli Zaretskii <eliz@gnu.org>
Mon, 3 Nov 2014 17:14:50 +0000 (19:14 +0200)
 src/xdisp.c (Fdump_glyph_matrix, Fdump_frame_glyph_matrix): Doc fix.
 (Fdump_frame_glyph_matrix): Don't segfault if invoked on a GUI
 frame; instead, print an error message.

src/ChangeLog
src/xdisp.c

index 006e5c4b4a02afc539d647e0f0a1b313100ccd71..f30cad15f02648b7f315d98ebbead7e03b1d9fe8 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-03  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (Fdump_glyph_matrix, Fdump_frame_glyph_matrix): Doc fix.
+       (Fdump_frame_glyph_matrix): Don't segfault if invoked on a GUI
+       frame; instead, print an error message.
+
 2014-11-03  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsfns.m (ns_set_doc_edited): Check for FRAME_NS (Bug#18925).
index c12ef753a45a023316f831b252c2711d07eb26a0..0558aa8099dd5a6bb7186432966a0fa9cd3ffb70 100644 (file)
@@ -18755,7 +18755,10 @@ DEFUN ("dump-glyph-matrix", Fdump_glyph_matrix,
        doc: /* Dump the current matrix of the selected window to stderr.
 Shows contents of glyph row structures.  With non-nil
 parameter GLYPHS, dump glyphs as well.  If GLYPHS is 1 show
-glyphs in short form, otherwise show glyphs in long form.  */)
+glyphs in short form, otherwise show glyphs in long form.
+
+Interactively, no argument means show glyphs in short form;
+with numeric argument, its value is passed as the GLYPHS flag.  */)
   (Lisp_Object glyphs)
 {
   struct window *w = XWINDOW (selected_window);
@@ -18773,11 +18776,16 @@ glyphs in short form, otherwise show glyphs in long form.  */)
 
 
 DEFUN ("dump-frame-glyph-matrix", Fdump_frame_glyph_matrix,
-       Sdump_frame_glyph_matrix, 0, 0, "", doc: /* */)
+       Sdump_frame_glyph_matrix, 0, 0, "", doc: /* Dump the current glyph matrix of the selected frame to stderr.
+Only text-mode frames have frame glyph matrices.  */)
   (void)
 {
   struct frame *f = XFRAME (selected_frame);
-  dump_glyph_matrix (f->current_matrix, 1);
+
+  if (f->current_matrix)
+    dump_glyph_matrix (f->current_matrix, 1);
+  else
+    fprintf (stderr, "*** This frame doesn't have a frame glyph matrix ***\n");
   return Qnil;
 }