emacs-devel
[Top][All Lists]
Advanced

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

Re: buffer-face-set changes the fringe, is it a bug?


From: Gregory Heytings
Subject: Re: buffer-face-set changes the fringe, is it a bug?
Date: Tue, 7 Jul 2020 17:47:55 +0200 (CEST)
User-agent: Alpine 2.21 (NEB 202 2017-01-01)



This is not what I see. The left/right-fringe display property (which was introduced in Emacs 22.1, btw) behaves in Emacs 22 exactly like it behaves in the current codebase: if the optional FACE parameter is omitted, it uses the foreground of the 'default' face and the background of the 'fringe' face (because the 'fringe' face by default doesn't specify the foreground). Try this:

 (set-face-attribute 'fringe nil :background "red")
 (let ((o (make-overlay 0 1)) (s "_"))
   (put-text-property 0 1 'display '(left-fringe question-mark) s)
   (overlay-put o 'after-string s)
   (set-face-foreground 'default "green"))


Why did you change my code, which demonstrated the problem, into another one which indeed does not show the problem? Try this:

(set-face-attribute 'fringe nil :background "red" :foreground "blue")
(let ((o (make-overlay 0 1)) (s "_"))
  (put-text-property 0 1 'display '(left-fringe question-mark) s)
  (overlay-put o 'after-string s))
(progn (set-face-background 'default "yellow") (set-face-foreground 'default 
"red")) [1]
(face-remap-add-relative 'default '(:background "yellow" :foreground "red")) [2]

After [1] the behavior is what I expect: red on yellow in the buffer, blue on red in the fringe.

After [2] the behavior is *not* what I expect anymore: red on yellow in the buffer, red on yellow for the question mark in the fringe (the other parts of the fringe remain red, and other bitmaps in the fringe, e.g. curly arrows, remain blue on a red background).

Gregory



reply via email to

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