aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorEli Zaretskii2017-06-25 20:53:05 +0300
committerEli Zaretskii2017-06-25 20:53:05 +0300
commit5d1025e7162db46b3c8d7c19facd8f9b9eff6f49 (patch)
tree24040876a17ba2296b57b318e239c5436b273d1f /src/buffer.c
parent540669cda984f64964d7baeb7369d3eea424a34c (diff)
downloademacs-5d1025e7162db46b3c8d7c19facd8f9b9eff6f49.tar.gz
emacs-5d1025e7162db46b3c8d7c19facd8f9b9eff6f49.zip
Allow to disable display of line numbers beyond EOB
* src/buffer.c (disable_line_numbers_overlay_at_eob): New function. * src/lisp.h (disable_line_numbers_overlay_at_eob): Add prototype. * src/xdisp.c (should_produce_line_number): When at ZV, call disable_line_numbers_overlay_at_eob to determine whether line numbers should be displayed beyond ZV.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 80dbd3318dc..780e4d7a7d6 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3054,6 +3054,33 @@ mouse_face_overlay_overlaps (Lisp_Object overlay)
3054 return i < n; 3054 return i < n;
3055} 3055}
3056 3056
3057/* Return the value of the 'display-line-numbers-disable' property at
3058 EOB, if there's an overlay at ZV with a non-nil value of that property. */
3059Lisp_Object
3060disable_line_numbers_overlay_at_eob (void)
3061{
3062 ptrdiff_t n, i, size;
3063 Lisp_Object *v, tem = Qnil;
3064 Lisp_Object vbuf[10];
3065 USE_SAFE_ALLOCA;
3066
3067 size = ARRAYELTS (vbuf);
3068 v = vbuf;
3069 n = overlays_in (ZV, ZV, 0, &v, &size, NULL, NULL);
3070 if (n > size)
3071 {
3072 SAFE_NALLOCA (v, 1, n);
3073 overlays_in (ZV, ZV, 0, &v, &n, NULL, NULL);
3074 }
3075
3076 for (i = 0; i < n; ++i)
3077 if ((tem = Foverlay_get (v[i], Qdisplay_line_numbers_disable),
3078 !NILP (tem)))
3079 break;
3080
3081 SAFE_FREE ();
3082 return tem;
3083}
3057 3084
3058 3085
3059/* Fast function to just test if we're at an overlay boundary. */ 3086/* Fast function to just test if we're at an overlay boundary. */