emacs-diffs
[Top][All Lists]
Advanced

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

master 18ce031 4/5: Remove the `mode-line-percent-position' min width ha


From: Lars Ingebrigtsen
Subject: master 18ce031 4/5: Remove the `mode-line-percent-position' min width hack
Date: Mon, 20 Dec 2021 23:26:15 -0500 (EST)

branch: master
commit 18ce031f9b21942586255fca86a5acf364742600
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Remove the `mode-line-percent-position' min width hack
    
    * lisp/bindings.el (mode-line-position): Remove hack to get
    min-width to work on the `mode-line-percent-position' bit.
    * src/xdisp.c (display_string): Respect min-width in the non-Lisp
    string case (bug#52332).
---
 lisp/bindings.el |  2 +-
 src/xdisp.c      | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/lisp/bindings.el b/lisp/bindings.el
index ba3bf81..98a12a2 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -501,7 +501,7 @@ mouse-1: Display Line and Column Mode Menu"))
 
 (defvar mode-line-position
   `((:propertize
-     (" " mode-line-percent-position)
+     ("" mode-line-percent-position)
      local-map ,mode-line-column-line-number-mode-map
      display (min-width (5.0))
      mouse-face mode-line-highlight
diff --git a/src/xdisp.c b/src/xdisp.c
index 0c35d24..35675a6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -27640,6 +27640,21 @@ display_string (const char *string, Lisp_Object 
lisp_string, Lisp_Object face_st
                                   0, &endptr, it->base_face_id, false, 0);
       face = FACE_FROM_ID (it->f, it->face_id);
       it->face_box_p = face->box != FACE_NO_BOX;
+
+      /* If we have a display spec, but there's no Lisp being
+        displayed, then check whether we've got one from the
+        :propertize being passed in and use that.  */
+      if (NILP (lisp_string))
+       {
+         Lisp_Object display = Fget_text_property (make_fixnum (0), Qdisplay,
+                                                   face_string);
+         if (!NILP (display))
+           {
+             Lisp_Object min_width = Fplist_get (display, Qmin_width);
+             if (!NILP (min_width))
+               display_min_width (it, 0, face_string, min_width);
+           }
+       }
     }
 
   /* Set max_x to the maximum allowed X position.  Don't let it go



reply via email to

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