GNU bug report logs - #22915
foreground-color-at-point doesn't return the foreground color at point (when overlays are present)

Previous Next

Package: emacs;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Sat, 5 Mar 2016 06:11:02 UTC

Severity: minor

Full log


View this message in rfc822 format

From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
To: 22915 <at> debbugs.gnu.org
Subject: bug#22915: foreground-color-at-point doesn't return the foreground color at point (when overlays are present)
Date: Sat, 5 Mar 2016 01:10:37 -0500
[Message part 1 (text/plain, inline)]
Reproduction with emacs -Q:

(with-current-buffer (get-buffer-create "*broken*")
  (require 'cl-lib)
  (erase-buffer)
  (delete-all-overlays)
  (fundamental-mode)
  (insert "AAAAA")
  (goto-char (point-min))

  ;; Add two faces
  (set-text-properties (point-min) (point-max) '(face font-lock-type-face))
  (let ((ov (make-overlay (point-min) (point-max))))
    (overlay-put ov 'face 'font-lock-negation-char-face))

  ;; This passes, proving that font-lock-negation-char-face is not contributing to the
  ;; foreground color
  (cl-assert (eq (face-attribute 'font-lock-negation-char-face :foreground)
                 'unspecified))

  ;; This fails: foreground-color-at-point reads the face of the overlay, sees that it's undefined, 
  ;; and ignores the 'face text property 
  (cl-assert (eq (foreground-color-at-point)
                 (face-attribute 'font-lock-type-face :foreground)))

  (pop-to-buffer (current-buffer)))

Let me know if I can provide more info.
Clément.

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 9 years and 103 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.