[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: |
Ehud Karni |
Subject: |
Re: no good way to highlight rectangle while region is highlighted |
Date: |
Fri, 27 Jul 2007 22:43:41 +0300 |
On Fri, 27 Jul 2007 14:27:49, Joe Wells wrote:
>
> "Ehud Karni" <address@hidden> writes:
>
> > The overlay is set to priority 99 and I sure see it OVER the region.
>
> 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 think the keyword is "merges" that you somehow ignored.
> >> 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?)
My `goto-col' is used for other purposes too. Here it is used ONLY with
the NOSPC arg set to t.
> 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.
The code is a small part of a much larger (1320 lines) package.
Here is sample code to set mark-1st to current cursor position.
(setq mark-1st (cons
(save-excursion (beginning-of-line) (point-marker))
(col (1- (column-no)))))
Ehud.
--
Ehud Karni Tel: +972-3-7966-561 /"\
Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign
Insurance agencies (USA) voice mail and X Against HTML Mail
http://www.mvs.co.il FAX: 1-815-5509341 / \
GnuPG: 98EA398D <http://www.keyserver.net/> Better Safe Than Sorry
- Re: no good way to highlight rectangle while region is highlighted, (continued)
Re: no good way to highlight rectangle while region is highlighted, Johan Bockgård, 2007/07/23
Re: no good way to highlight rectangle while region is highlighted, Ehud Karni, 2007/07/26
Re: no good way to highlight rectangle while region is highlighted, Dan Nicolaescu, 2007/07/27