[Top][All Lists]

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

Re: no good way to highlight rectangle while region is highlighted

From: Joe Wells
Subject: Re: no good way to highlight rectangle while region is highlighted
Date: Fri, 27 Jul 2007 14:27:49 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

"Ehud Karni" <address@hidden> writes:

> On Fri, 27 Jul 2007 08:52:16, Joe Wells wrote:
>> "Ehud Karni" <address@hidden> writes:
>> How does your code work in combination with the Emacs C code that
>> highlights the region using the "region" face?  I think your code will
>> have the same problems that I have already described.
> The overlay is set to priority 99 and I sure see it OVER the region.

Hi, Ehud,

How is this possible?  From (info "(elisp)Displaying Faces"):

     “If these various sources together specify more than one face for a
  particular character, Emacs merges the attributes of the various faces
  specified.  For each attribute, Emacs tries first the face of any
  special glyph; then the face for region highlighting, if appropriate;
  then the faces specified by overlays, followed by those specified by
  text properties, then the `mode-line' or `mode-line-inactive' or
  `header-line' face (if in a mode line or a header line), and last the
  `default' face.”

So the only faces which can override the “region” face are the faces
for glyphs set with display tables.  Overlays can't do that.  Because
the default “region” face sets a background color, there is no way an
overlay can override the background color of the region.

>> I notice that your code modifies the buffer.  This is very undesirable
>> for the purpose I have in mind (which is constantly showing the
>> current rectangle).
> The code does NOT modify the buffer (you can check it on read only
> buffer), please try it before you state such observation.

Your goto-col function contains code to modify the buffer.  I assumed
that this code was used (because otherwise why would it be there?).
(By the way (just curious), but why aren't you using Emacs's standard
move-to-column function instead?)

Anyway, I couldn't try your code because it is incomplete.  As far as
I can tell, the entry point in what you supplied is mark-set-face and
this merely raises an error because there is no code to assign values
to the variables mark-1st and mark-2nd that it depends on.

>> > I think a strong background color (I use red) is much better because
>> > it can not be missed. A frame only (box) can be overlooked, especially
>> > when the rectangle is greater than the screen size.
>> A frame ("box") can be seen fairly easily if its borders are in a
>> strong color.
> Not if the area border is not on the screen (which can happen when the
> rectangle is greater than a screen, e.g. 150 lines by 120 chars).

When one uses the “box” face feature, every _individual_ line shows a
top and bottom border.  So there is no possibility of not seeing the


reply via email to

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