summaryrefslogtreecommitdiff
path: root/src/window.h
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2019-11-12 16:44:30 +0100
committerMartin Rudalics <rudalics@gmx.at>2019-11-12 16:44:30 +0100
commit1e5392a4ae710486f77afb5898c552b5b0e85061 (patch)
tree6a84983f3bd19f2c728cc8342b7c38d91dfda856 /src/window.h
parent6eaf62df205569f234160e7035dd7116af57810e (diff)
downloademacs-1e5392a4ae710486f77afb5898c552b5b0e85061.tar.gz
Make sure buffer is live before retrieving underline properties (Bug#38038)
* src/window.h (WINDOW_BUFFER_LOCAL_VALUE): New macro. * src/nsterm.m (ns_draw_text_decoration): * src/w32term.c (w32_draw_glyph_string): * src/xterm.c (x_draw_glyph_string): Make sure buffer is live before retrieving underline properties from it (Bug#38038).
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h
index 71946a56955..5b9a3140c8f 100644
--- a/src/window.h
+++ b/src/window.h
@@ -608,6 +608,13 @@ wset_next_buffers (struct window *w, Lisp_Object val)
? (W)->contents \
: Qnil)
+/* Local value of variable V in window W's buffer. Nil if W has no
+ buffer. */
+#define WINDOW_BUFFER_LOCAL_VALUE(V, W) \
+ (BUFFERP ((W)->contents) \
+ ? buffer_local_value(V, (W)->contents) \
+ : Qnil)
+
/* Return the canonical column width of the frame of window W. */
#define WINDOW_FRAME_COLUMN_WIDTH(W) \
(FRAME_COLUMN_WIDTH (WINDOW_XFRAME ((W))))