* narrow color bar using display properties
@ 2013-03-05 6:26 Eric Abrahamsen
2013-03-05 15:46 ` Stefan Monnier
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Eric Abrahamsen @ 2013-03-05 6:26 UTC (permalink / raw)
To: help-gnu-emacs
I've got my cursor-type set to a colored bar, and looking at it today I
thought it would be very nice if I could create a similar effect with
code: presumably using text properties (I'm guessing the display
property) to lay a bar of color (either background color or a
transparent foreground color) over existing text, only a couple of
pixels wide and aligned left, without otherwise disturbing the placement
of the text beneath.
Right now the most promising approach seems to be the image display
property (presumably I could use the :data specification just to draw a
block of colored pixels), except that if I understand it correctly that
will replace the underlying text, not add to it.
Does anyone have advice on achieving this?
Thanks,
Eric
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: narrow color bar using display properties
[not found] <mailman.21422.1362464496.855.help-gnu-emacs@gnu.org>
@ 2013-03-05 14:33 ` Michael Heerdegen
0 siblings, 0 replies; 9+ messages in thread
From: Michael Heerdegen @ 2013-03-05 14:33 UTC (permalink / raw)
To: help-gnu-emacs
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> I've got my cursor-type set to a colored bar, and looking at it today I
> thought it would be very nice if I could create a similar effect with
> code: presumably using text properties (I'm guessing the display
> property) to lay a bar of color (either background color or a
> transparent foreground color) over existing text, only a couple of
> pixels wide and aligned left, without otherwise disturbing the placement
> of the text beneath.
>
> Right now the most promising approach seems to be the image display
> property (presumably I could use the :data specification just to draw a
> block of colored pixels), except that if I understand it correctly that
> will replace the underlying text, not add to it.
>
> Does anyone have advice on achieving this?
You may want to try using faces using the stipple attribute (see (elisp)
Face Attributes) and use them in text properties or overlays.
Using stipple is easy, e.g. like this:
(defface test '((t (:stipple "hlines2"))) "Doc...")
The downside: stipple doesn't work in Windows AFAIK.
Regards,
Michael.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: narrow color bar using display properties
2013-03-05 6:26 narrow color bar using display properties Eric Abrahamsen
@ 2013-03-05 15:46 ` Stefan Monnier
2013-03-05 17:49 ` Eli Zaretskii
[not found] ` <mailman.21466.1362505829.855.help-gnu-emacs@gnu.org>
2 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2013-03-05 15:46 UTC (permalink / raw)
To: help-gnu-emacs
> I've got my cursor-type set to a colored bar, and looking at it today I
> thought it would be very nice if I could create a similar effect with
> code: presumably using text properties (I'm guessing the display
> property) to lay a bar of color (either background color or a
> transparent foreground color) over existing text, only a couple of
> pixels wide and aligned left, without otherwise disturbing the placement
> of the text beneath.
I can't think of any way to get this effect with the current display
tricks provided to Elisp.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: narrow color bar using display properties
2013-03-05 6:26 narrow color bar using display properties Eric Abrahamsen
2013-03-05 15:46 ` Stefan Monnier
@ 2013-03-05 17:49 ` Eli Zaretskii
2013-03-05 18:16 ` Peter Dyballa
[not found] ` <mailman.21466.1362505829.855.help-gnu-emacs@gnu.org>
2 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2013-03-05 17:49 UTC (permalink / raw)
To: help-gnu-emacs
> From: Eric Abrahamsen <eric@ericabrahamsen.net>
> Date: Tue, 05 Mar 2013 14:26:45 +0800
>
> I've got my cursor-type set to a colored bar, and looking at it today I
> thought it would be very nice if I could create a similar effect with
> code: presumably using text properties (I'm guessing the display
> property) to lay a bar of color (either background color or a
> transparent foreground color) over existing text, only a couple of
> pixels wide and aligned left, without otherwise disturbing the placement
> of the text beneath.
I don't get it: do you mean to have a color bar to the left of _every_
character in a region of text? Why would want something like that?
Or did I misunderstand what you want?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: narrow color bar using display properties
2013-03-05 17:49 ` Eli Zaretskii
@ 2013-03-05 18:16 ` Peter Dyballa
2013-03-05 18:43 ` Eli Zaretskii
2013-03-05 18:45 ` Drew Adams
0 siblings, 2 replies; 9+ messages in thread
From: Peter Dyballa @ 2013-03-05 18:16 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
Am 05.03.2013 um 18:49 schrieb Eli Zaretskii:
> I don't get it: do you mean to have a color bar to the left of _every_
> character in a region of text?
I think Eric has a horizontal bar cursor and wants to "underline" text…
--
Greetings
Pete
The future will be much better tomorrow.
– George W. Bush
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: narrow color bar using display properties
[not found] ` <mailman.21466.1362505829.855.help-gnu-emacs@gnu.org>
@ 2013-03-05 18:26 ` Dan Espen
0 siblings, 0 replies; 9+ messages in thread
From: Dan Espen @ 2013-03-05 18:26 UTC (permalink / raw)
To: help-gnu-emacs
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Date: Tue, 05 Mar 2013 14:26:45 +0800
>>
>> I've got my cursor-type set to a colored bar, and looking at it today I
>> thought it would be very nice if I could create a similar effect with
>> code: presumably using text properties (I'm guessing the display
>> property) to lay a bar of color (either background color or a
>> transparent foreground color) over existing text, only a couple of
>> pixels wide and aligned left, without otherwise disturbing the placement
>> of the text beneath.
>
> I don't get it: do you mean to have a color bar to the left of _every_
> character in a region of text? Why would want something like that?
> Or did I misunderstand what you want?
I'm not sure what the OP wants either, but if you've ever seen
an IBM 5251 with the "column separator" attribute that would be one
explanation. But column separators formed a bucket around an
input character:
| |
|_|
Actually pretty nice for indicating input fields vs. protected fields.
--
Dan Espen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: narrow color bar using display properties
2013-03-05 18:16 ` Peter Dyballa
@ 2013-03-05 18:43 ` Eli Zaretskii
2013-03-05 18:45 ` Drew Adams
1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2013-03-05 18:43 UTC (permalink / raw)
To: help-gnu-emacs
> From: Peter Dyballa <Peter_Dyballa@Web.DE>
> Date: Tue, 5 Mar 2013 19:16:27 +0100
> Cc: help-gnu-emacs@gnu.org
>
> I think Eric has a horizontal bar cursor and wants to "underline" text…
Then what's wrong with a underline font/face?
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: narrow color bar using display properties
2013-03-05 18:16 ` Peter Dyballa
2013-03-05 18:43 ` Eli Zaretskii
@ 2013-03-05 18:45 ` Drew Adams
2013-03-06 1:52 ` Eric Abrahamsen
1 sibling, 1 reply; 9+ messages in thread
From: Drew Adams @ 2013-03-05 18:45 UTC (permalink / raw)
To: 'Peter Dyballa', 'Eli Zaretskii'; +Cc: help-gnu-emacs
> > I don't get it: do you mean to have a color bar to the left
> > of _every_ character in a region of text?
>
> I think Eric has a horizontal bar cursor and wants to
> "underline" text.
Really? In that case, I don't understand Stefan's message saying that you can't
do that with Emacs.
You can easily use a face that has attribute `underline' and/or `overline' as a
text property or overlay. And the line(s) can be any color.
(Like Eli, I too did (do?) not understand what the request is.)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: narrow color bar using display properties
2013-03-05 18:45 ` Drew Adams
@ 2013-03-06 1:52 ` Eric Abrahamsen
0 siblings, 0 replies; 9+ messages in thread
From: Eric Abrahamsen @ 2013-03-06 1:52 UTC (permalink / raw)
To: help-gnu-emacs
"Drew Adams" <drew.adams@oracle.com> writes:
>> > I don't get it: do you mean to have a color bar to the left
>> > of _every_ character in a region of text?
>>
>> I think Eric has a horizontal bar cursor and wants to
>> "underline" text.
>
> Really? In that case, I don't understand Stefan's message saying that you can't
> do that with Emacs.
>
> You can easily use a face that has attribute `underline' and/or `overline' as a
> text property or overlay. And the line(s) can be any color.
>
> (Like Eli, I too did (do?) not understand what the request is.)
Ha, sorry to create confusion, I thought I'd articulated myself well! I
do want a color bar to the left of a series of characters, but
vertically-aligned characters, creating a multi-line vertical bar (I'm
trying to prettify Org Agenda's display of multi-day agenda items).
Initial experimentation indicates that Michael Heerdegen's stipple
suggestion might do the trick!
Thanks,
Eric
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-03-06 1:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05 6:26 narrow color bar using display properties Eric Abrahamsen
2013-03-05 15:46 ` Stefan Monnier
2013-03-05 17:49 ` Eli Zaretskii
2013-03-05 18:16 ` Peter Dyballa
2013-03-05 18:43 ` Eli Zaretskii
2013-03-05 18:45 ` Drew Adams
2013-03-06 1:52 ` Eric Abrahamsen
[not found] ` <mailman.21466.1362505829.855.help-gnu-emacs@gnu.org>
2013-03-05 18:26 ` Dan Espen
[not found] <mailman.21422.1362464496.855.help-gnu-emacs@gnu.org>
2013-03-05 14:33 ` Michael Heerdegen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.