emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 0704818: Allow the fringe face to be remapped local


From: Eli Zaretskii
Subject: [Emacs-diffs] master 0704818: Allow the fringe face to be remapped locally in a buffer
Date: Sat, 3 Nov 2018 06:41:22 -0400 (EDT)

branch: master
commit 07048183a86134b63cb7132038fab6f36a1e57ca
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Allow the fringe face to be remapped locally in a buffer
    
    * src/fringe.c (draw_window_fringes): Switch to window's
    buffer to get the local value of face-remapping-alist, if
    necessary.  (Bug#33244)
    * src/xfaces.c (syms_of_xfaces) <Qface_remapping_alist>: New
    DEFSYM.
---
 src/fringe.c | 8 ++++++++
 src/xfaces.c | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/fringe.c b/src/fringe.c
index 6a44de1..a1016ad 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -909,6 +909,12 @@ draw_window_fringes (struct window *w, bool no_fringe_p)
   if (w->pseudo_window_p)
     return updated_p;
 
+  /* We must switch to the window's buffer to use its local value of
+     the fringe face, in case it's been remapped in face-remapping-alist.  */
+  Lisp_Object window_buffer = w->contents;
+  struct buffer *oldbuf = current_buffer;
+  set_buffer_internal_1 (XBUFFER (window_buffer));
+
   /* Must draw line if no fringe */
   if (no_fringe_p
       && (WINDOW_LEFT_FRINGE_WIDTH (w) == 0
@@ -926,6 +932,8 @@ draw_window_fringes (struct window *w, bool no_fringe_p)
       updated_p = 1;
     }
 
+  set_buffer_internal_1 (oldbuf);
+
   return updated_p;
 }
 
diff --git a/src/xfaces.c b/src/xfaces.c
index 50593f6..6e06d56 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6755,6 +6755,7 @@ Because Emacs normally only redraws screen areas when the 
underlying
 buffer contents change, you may need to call `redraw-display' after
 changing this variable for it to take effect.  */);
   Vface_remapping_alist = Qnil;
+  DEFSYM (Qface_remapping_alist,"face-remapping-alist");
 
   DEFVAR_LISP ("face-font-rescale-alist", Vface_font_rescale_alist,
               doc: /* Alist of fonts vs the rescaling factors.



reply via email to

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