emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/line-numbers 71e31ac 3/9: Support default-text-pro


From: Eli Zaretskii
Subject: [Emacs-diffs] scratch/line-numbers 71e31ac 3/9: Support default-text-properties
Date: Fri, 30 Jun 2017 10:41:19 -0400 (EDT)

branch: scratch/line-numbers
commit 71e31ac839b05d01486d728d4da9a8daaf1ae240
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Support default-text-properties
    
    * src/xdisp.c (should_produce_line_number): Call get-char-property
    at ZV as well, to support default-text-properties.
---
 src/xdisp.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 67266fd..ef2e264 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -21000,15 +21000,17 @@ should_produce_line_number (struct it *it)
 #endif
 
   /* If the character at current position has a non-nil special
-     property, disable line numbers for this row.  For ZV, we need to
-     use a special algorithm that only supports empty overlays at that
-     point, because get-char-property always returns nil for ZV.  */
-  Lisp_Object val;
-  if (IT_CHARPOS (*it) >= ZV)
+     property, disable line numbers for this row.  This is for
+     packages such as company-mode, which need this for their tricky
+     layout, where line numbers get in the way.  */
+  Lisp_Object val = Fget_char_property (make_number (IT_CHARPOS (*it)),
+                                       Qdisplay_line_numbers_disable,
+                                       it->window);
+  /* For ZV, we need to also look in empty overlays at that point,
+     because get-char-property always returns nil for ZV, except if
+     the property is in 'default-text-properties'.  */
+  if (NILP (val) && IT_CHARPOS (*it) >= ZV)
     val = disable_line_numbers_overlay_at_eob ();
-  else
-    val = Fget_char_property (make_number (IT_CHARPOS (*it)),
-                             Qdisplay_line_numbers_disable, it->window);
   return NILP (val) ? true : false;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]