all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Different fonts per region
@ 2016-03-02 10:52 henry atting
  2016-03-02 13:17 ` tomas
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: henry atting @ 2016-03-02 10:52 UTC (permalink / raw)
  To: help-gnu-emacs

Okay, I can change the font per buffer, frame, mode or set another
default font.
Is it also possible to set the font per region, say have three different
regions in a buffer with three different fonts?
Just to know if it's possible; outside emacs it would be of little avail
anyway.

henry


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
  2016-03-02 10:52 Different fonts per region henry atting
@ 2016-03-02 13:17 ` tomas
  2016-03-03  0:37 ` Emanuel Berg
       [not found] ` <mailman.6589.1456965467.843.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: tomas @ 2016-03-02 13:17 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Mar 02, 2016 at 11:52:52AM +0100, henry atting wrote:
> Okay, I can change the font per buffer, frame, mode or set another
> default font.
> Is it also possible to set the font per region, say have three different
> regions in a buffer with three different fonts?
> Just to know if it's possible; outside emacs it would be of little avail
> anyway.

Yes. There are basically two mechanisms you can attach attributes to:
"text properties" and "overlays". In both cases one of those properties
is a "face" property, which (among many other things like colours)
determines the font this text is to be displayed with. This face
property is either a name of some previously defined thing or a
list of name-value pairs for each of the properties.

See the relevant part in the Emacs Lisp manual, either in your local
copy or possibly online here[1] [2] [3]

[1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html#Text-Properties
[2] https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties
[3] https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces.html#Faces

> 
> henry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlbW5+sACgkQBcgs9XrR2kZSLwCfUB8KRemocbW5AXd+4aqKK02O
MlsAniNLB0/xncGe5yRSsyh47SjPswmt
=D3bT
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
  2016-03-02 10:52 Different fonts per region henry atting
  2016-03-02 13:17 ` tomas
@ 2016-03-03  0:37 ` Emanuel Berg
       [not found] ` <mailman.6589.1456965467.843.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 13+ messages in thread
From: Emanuel Berg @ 2016-03-03  0:37 UTC (permalink / raw)
  To: help-gnu-emacs

henry atting <atting@posteo.de> writes:

> Okay, I can change the font per buffer, frame, mode
> or set another default font. Is it also possible to
> set the font per region, say have three different
> regions in a buffer with three different fonts?
> Just to know if it's possible; outside emacs it
> would be of little avail anyway.

It is possible:

Just look! (It is red.)

And this is yellow: I'm rubber, you're glue.

Have a look:

    http://user.it.uu.se/~embe8573/pics/region-colors.png

Note tho I had to do `text-mode' first as the
colorizing stuff isn't supported for `message-mode'
just yet. Something you could add, perhaps?

Anyway what you look for is the `facemenu-' stuff,
e.g., `facemenu-set-foreground' which I used for the
examples above.

By the way, anyone who is interested in colorizing the
message buffer, check out this little pearl from the
bottomless pit of the technicolor ocean:

(font-lock-add-keywords 'message-mode
 '(
   ("`\\(.*?\\)'" (1 font-lock-reference-face))
   )
 t)

And the next step is a function that colorizes it red
if there isn't such a function or variable defined!

Dig (dive) deep :)

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
       [not found] ` <mailman.6589.1456965467.843.help-gnu-emacs@gnu.org>
@ 2016-03-03  1:29   ` HASM
  2016-03-03  2:02     ` Emanuel Berg
                       ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: HASM @ 2016-03-03  1:29 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> writes:

> It is possible:

Not denying it ..

> Just look! (It is red.)
> And this is yellow: I'm rubber, you're glue.

Not sure what's red or yellow, those two lines are all white on dark
blue on my emacs terminal (ssh/gnuclient).  There is some coloring in
the posted *Article*, though, courtesy of font-lock.

-- HASM


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
  2016-03-03  1:29   ` HASM
@ 2016-03-03  2:02     ` Emanuel Berg
  2016-03-03  4:41     ` Emanuel Berg
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Emanuel Berg @ 2016-03-03  2:02 UTC (permalink / raw)
  To: help-gnu-emacs

HASM <hasm@example.invalid> writes:

>> Just look! (It is red.) And this is yellow: I'm
>> rubber, you're glue.
>
> Not sure what's red or yellow, those two lines are
> all white on dark blue on my emacs terminal
> (ssh/gnuclient). There is some coloring in the
> posted *Article*, though, courtesy of font-lock.

Really? You honestly don't see it?

Man, I remember my mother was very hesitant when my
father related his plans to break me out of the mental
institution... But we didn't listen. WE JUST
DIDN'T LISTEN!

    http://user.it.uu.se/~embe8573/pics/region-colors.png

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
  2016-03-03  1:29   ` HASM
  2016-03-03  2:02     ` Emanuel Berg
@ 2016-03-03  4:41     ` Emanuel Berg
  2016-03-03  6:12       ` Yuri Khan
       [not found]       ` <mailman.6603.1456985552.843.help-gnu-emacs@gnu.org>
       [not found]     ` <mailman.6594.1456970578.843.help-gnu-emacs@gnu.org>
       [not found]     ` <mailman.6596.1456980102.843.help-gnu-emacs@gnu.org>
  3 siblings, 2 replies; 13+ messages in thread
From: Emanuel Berg @ 2016-03-03  4:41 UTC (permalink / raw)
  To: help-gnu-emacs

HASM <hasm@example.invalid> writes:

>> Just look! (It is red.) And this is yellow: I'm
>> rubber, you're glue.
>
> Not sure what's red or yellow, those two lines are
> all white on dark blue on my emacs terminal
> (ssh/gnuclient). There is some coloring in the
> posted *Article*, though, courtesy of font-lock.

Well, obviously you didn't see the URL. And indeed one
tends to develop a blind eye to them...

But it is interesting. For the colorization to stick
thru the ether that would have to be encoded somehow
in the message and then put back together.

Or one could pass the colorization metadata as an
attachment and then at the other end one could choose
to evaluate it...

That sounds pretty cool until you realize that would
en up with the much heckled HTML mails...

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
  2016-03-03  4:41     ` Emanuel Berg
@ 2016-03-03  6:12       ` Yuri Khan
       [not found]       ` <mailman.6603.1456985552.843.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Yuri Khan @ 2016-03-03  6:12 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

On Thu, Mar 3, 2016 at 10:41 AM, Emanuel Berg <embe8573@student.uu.se> wrote:

> Or one could pass the colorization metadata as an
> attachment and then at the other end one could choose
> to evaluate it...
>
> That sounds pretty cool until you realize that would
> en up with the much heckled HTML mails...

HTML mail might actually have been useful and usable if everybody
agreed to use only the Strict subset of HTML 4 or later, with no
presentational markup or sender-defined CSS.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
       [not found]     ` <mailman.6594.1456970578.843.help-gnu-emacs@gnu.org>
@ 2016-03-03 15:10       ` HASM
  0 siblings, 0 replies; 13+ messages in thread
From: HASM @ 2016-03-03 15:10 UTC (permalink / raw)
  To: help-gnu-emacs


>>> Just look! (It is red.) And this is yellow: I'm
>>> rubber, you're glue.
>>
>> Not sure what's red or yellow, those two lines are
>> all white on dark blue on my emacs terminal
>> (ssh/gnuclient). There is some coloring in the
>> posted *Article*, though, courtesy of font-lock.

> Really? You honestly don't see it?

Not in my gnus Article buffer.

> http://user.it.uu.se/~embe8573/pics/region-colors.png

I saw that, but that is a png image, not a gnus Article buffer.

-- HASM


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
       [not found]     ` <mailman.6596.1456980102.843.help-gnu-emacs@gnu.org>
@ 2016-03-03 15:14       ` HASM
  2016-03-04 18:32         ` Emanuel Berg
  0 siblings, 1 reply; 13+ messages in thread
From: HASM @ 2016-03-03 15:14 UTC (permalink / raw)
  To: help-gnu-emacs


Emanuel Berg <embe8573@student.uu.se> writes:

> HASM <hasm@example.invalid> writes:
>
>>> Just look! (It is red.) And this is yellow: I'm
>>> rubber, you're glue.
>>
>> Not sure what's red or yellow, those two lines are
>> all white on dark blue on my emacs terminal
>> (ssh/gnuclient). There is some coloring in the
>> posted *Article*, though, courtesy of font-lock.
>
> Well, obviously you didn't see the URL. And indeed one
> tends to develop a blind eye to them...

Again, I did.

Looking back at the article I'm now following up to, there are plenty of
colors in it (even in a ssh/gnuclient/terminal).

The quote from your post, with double '>' at the front, is red.
The quote from my post, with single '>' at the front is blue.
The *Article* in there is in bold, courtesy of the bounding *.

You red/yellow stuff doesn't make it through though..

-- HASM


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
       [not found]       ` <mailman.6603.1456985552.843.help-gnu-emacs@gnu.org>
@ 2016-03-03 15:17         ` HASM
  2016-03-03 15:42           ` Yuri Khan
  0 siblings, 1 reply; 13+ messages in thread
From: HASM @ 2016-03-03 15:17 UTC (permalink / raw)
  To: help-gnu-emacs


emanuel> That sounds pretty cool until you realize that would
emanuel> en up with the much heckled HTML mails...

yuri> HTML mail might actually have been useful and usable if everybody
yuri> agreed to use only the Strict subset of HTML 4 or later, with no
yuri> presentational markup or sender-defined CSS.

HTML mail is horrible, and I completely disable it in my mh-e setup.

I don't want funny colors or fonts in email.  They're distracting just
like all the funny fonts people used to use when they discovered Word,
or all the useless crap on PowerPoint slides.

Content is no longer import, just the appearance.

-- HASM


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
  2016-03-03 15:17         ` HASM
@ 2016-03-03 15:42           ` Yuri Khan
  2016-03-04 18:38             ` Emanuel Berg
  0 siblings, 1 reply; 13+ messages in thread
From: Yuri Khan @ 2016-03-03 15:42 UTC (permalink / raw)
  To: HASM; +Cc: help-gnu-emacs@gnu.org

On Thu, Mar 3, 2016 at 9:17 PM, HASM <hasm@example.invalid> wrote:

> yuri> HTML mail might actually have been useful and usable if everybody
> yuri> agreed to use only the Strict subset of HTML 4 or later, with no
> yuri> presentational markup or sender-defined CSS.
>
> HTML mail is horrible, and I completely disable it in my mh-e setup.
>
> I don't want funny colors or fonts in email.  They're distracting just
> like all the funny fonts people used to use when they discovered Word,
> or all the useless crap on PowerPoint slides.

In other words, you completely agree with me.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
  2016-03-03 15:14       ` HASM
@ 2016-03-04 18:32         ` Emanuel Berg
  0 siblings, 0 replies; 13+ messages in thread
From: Emanuel Berg @ 2016-03-04 18:32 UTC (permalink / raw)
  To: help-gnu-emacs

HASM <hasm@example.invalid> writes:

> You red/yellow stuff doesn't make it through
> though..

Okaaay... (?)

The question: how can I put a region in
a certain color?

The answer: use the `facemenu-' stuff.

The screenshot: shows this.

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Different fonts per region
  2016-03-03 15:42           ` Yuri Khan
@ 2016-03-04 18:38             ` Emanuel Berg
  0 siblings, 0 replies; 13+ messages in thread
From: Emanuel Berg @ 2016-03-04 18:38 UTC (permalink / raw)
  To: help-gnu-emacs

Yuri Khan <yuri.v.khan@gmail.com> writes:

>>> HTML mail might actually have been useful and
>>> usable if everybody agreed to use only the Strict
>>> subset of HTML 4 or later, with no presentational
>>> markup or sender-defined CSS.
>>
>> HTML mail is horrible, and I completely disable it
>> in my mh-e setup. I don't want funny colors or
>> fonts in email. They're distracting just like all
>> the funny fonts people used to use when they
>> discovered Word, or all the useless crap on
>> PowerPoint slides.
>
> In other words, you completely agree with me.

Mail doesn't benefit from even the kind of HTML you
describe.

Mail should be focused to the point there shouldn't be
any need for any structure.

Mails should be super-fast to read *and* write!

If there is need for structure and extras the whole
thing should be put into a document - this could be
HTML or LaTeX or whatever - and this should be
published persistently - and the mail should instead
say "here is the material you need - use it!"

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-03-04 18:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-02 10:52 Different fonts per region henry atting
2016-03-02 13:17 ` tomas
2016-03-03  0:37 ` Emanuel Berg
     [not found] ` <mailman.6589.1456965467.843.help-gnu-emacs@gnu.org>
2016-03-03  1:29   ` HASM
2016-03-03  2:02     ` Emanuel Berg
2016-03-03  4:41     ` Emanuel Berg
2016-03-03  6:12       ` Yuri Khan
     [not found]       ` <mailman.6603.1456985552.843.help-gnu-emacs@gnu.org>
2016-03-03 15:17         ` HASM
2016-03-03 15:42           ` Yuri Khan
2016-03-04 18:38             ` Emanuel Berg
     [not found]     ` <mailman.6594.1456970578.843.help-gnu-emacs@gnu.org>
2016-03-03 15:10       ` HASM
     [not found]     ` <mailman.6596.1456980102.843.help-gnu-emacs@gnu.org>
2016-03-03 15:14       ` HASM
2016-03-04 18:32         ` Emanuel Berg

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.