help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: setnu.el / setnu+.el


From: Drew Adams
Subject: RE: setnu.el / setnu+.el
Date: Wed, 21 Dec 2005 23:24:17 -0800

    >     my line numbers have the same highlighting as
    >     the adjacent code.
    >
    > I just checked in Emacs 22, and you're right. However, in
    > Emacs 20, the line numbers are not highlighted. I believe that
    > this is the code, in setnu.el, that is in question:
    >
    > (defun setnu-set-glyph-face (g face)
    >    (put-text-property 0 (length g) 'face face g))
    >
    > This code is intended to impose the given face (just bold, by
    > default) on the line-number overlay text. It does that correctly,
    > but I guess it does not also remove other text properties that
    > might be on the same overlay (imposed by font-locking).
    >
    > It appears that if the newline at the end of a line is
    > fontified (matches a regexp that imposes fontification), then
    > the line-number overlay is fontified in the same way.

I should have said instead that it appears that if the first character in a
line is fontified then the line number has the same face. I'm seeing this in
an emacs-lisp-buffer, where this occurs, coincidentally, for multiline
strings and start-of-line comments, which I believe are fontified
differently, IIUC - so-called "syntactic" font-lock"? I don't know if that
is pertinent.

    Each overlay has its before-string property set to the fontified string
    returned by setnu-set-glyph-face.  That string is intended to be
    displayed before the overlay, which starts at the beginning of the line
    and ends after the newline (i.e. at the beginning of the next line).

    I don't know what change in Emacs 22 causes the before-string to inherit
    properties from the adjacent text, but according to the Overlay
    Properties node of the Emacs Lisp manual, all overlays take priority
    over text properties.  So maybe it would work to set the overlay's face
    property in setnu-make-setnu-extent:

         (setnu-set-extent-property e 'face nil) ; or 'default

Without really knowing what I'm doing, I tried each of those. Nil had no
effect. `default' caused the entire buffer to lose its fontification when
the line numbers are shown.







reply via email to

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