all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Determining font weight
@ 2022-02-08  0:46 goncholden via Users list for the GNU Emacs text editor
  2022-02-08  1:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 8+ messages in thread
From: goncholden via Users list for the GNU Emacs text editor @ 2022-02-08  0:46 UTC (permalink / raw)
  To: goncholden via Users list for the GNU Emacs text editor

Is there a way to determine the font weight resulting from the command

(set-face-attribute 'default nil :height 160 :weight 'ultra-bold)

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

* Re: Determining font weight
  2022-02-08  0:46 Determining font weight goncholden via Users list for the GNU Emacs text editor
@ 2022-02-08  1:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-02-08  1:12   ` goncholden
  0 siblings, 1 reply; 8+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-02-08  1:04 UTC (permalink / raw)
  To: help-gnu-emacs

goncholden via Users list for the GNU Emacs text editor wrote:

> Is there a way to determine the font weight resulting from
> the command
>
> (set-face-attribute 'default nil :height 160 :weight
> 'ultra-bold)

`face-attribute' or `get-char-property' ... maybe.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Determining font weight
  2022-02-08  1:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2022-02-08  1:12   ` goncholden
  2022-02-08  1:26     ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 8+ messages in thread
From: goncholden @ 2022-02-08  1:12 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

------- Original Message -------

On Tuesday, February 8th, 2022 at 1:04 AM, Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> goncholden via Users list for the GNU Emacs text editor wrote:
>
> > Is there a way to determine the font weight resulting from
> >
> > the command
> >
> > (set-face-attribute 'default nil :height 160 :weight
> >
> > 'ultra-bold)
>
> `face-attribute' or` get-char-property' ... maybe.

I am changing font-lock-comment-face to normal weight.

(set-face-attribute 'font-lock-comment-face nil :weight 'normal))

But want to be able to change it back again to the default setting done initially
using

(set-face-attribute 'default nil :height 160 :weight 'ultra-bold)






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

* Re: Determining font weight
  2022-02-08  1:12   ` goncholden
@ 2022-02-08  1:26     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-02-08  1:48       ` goncholden
  0 siblings, 1 reply; 8+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-02-08  1:26 UTC (permalink / raw)
  To: help-gnu-emacs

goncholden wrote:

>>> Is there a way to determine the font weight resulting from
>>> the command
>>>
>>> (set-face-attribute 'default nil :height 160 :weight
>>>
>>> 'ultra-bold)
>>
>> `face-attribute' or` get-char-property' ... maybe.
>
> I am changing font-lock-comment-face to normal weight.
>
> (set-face-attribute 'font-lock-comment-face nil :weight 'normal))
>
> But want to be able to change it back again to the default
> setting done initially
> using
>
> (set-face-attribute 'default nil :height 160 :weight 'ultra-bold)

Do it.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Determining font weight
  2022-02-08  1:26     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2022-02-08  1:48       ` goncholden
  2022-02-08  2:00         ` goncholden
  0 siblings, 1 reply; 8+ messages in thread
From: goncholden @ 2022-02-08  1:48 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

------- Original Message -------

On Tuesday, February 8th, 2022 at 1:26 AM, Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> goncholden wrote:
>
> > > > Is there a way to determine the font weight resulting from
> > > >
> > > > the command
> > > >
> > > > (set-face-attribute 'default nil :height 160 :weight
> > > >
> > > > 'ultra-bold)
> > >
> > > `face-attribute' or` get-char-property' ... maybe.
> >
> > I am changing font-lock-comment-face to normal weight.
> > (set-face-attribute 'font-lock-comment-face nil :weight 'normal))
> > But want to be able to change it back again to the default
> > setting done initially using
> >
> > (set-face-attribute 'default nil :height 160 :weight 'ultra-bold)
>
> Do it.

The problem is that I would not know what weight was used in the user init
file, so I got to capture the weight (you mentioned face-attribute). But I
do not know  hon to use to set the comment face back to the original weight.





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

* Re: Determining font weight
  2022-02-08  1:48       ` goncholden
@ 2022-02-08  2:00         ` goncholden
  2022-02-08  8:24           ` irek
  2022-02-08  8:33           ` Kevin Vigouroux via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 8+ messages in thread
From: goncholden @ 2022-02-08  2:00 UTC (permalink / raw)
  To: goncholden; +Cc: Emanuel Berg, help-gnu-emacs

------- Original Message -------

On Tuesday, February 8th, 2022 at 1:48 AM, goncholden <goncholden@protonmail.com> wrote:

> ------- Original Message -------
>
> On Tuesday, February 8th, 2022 at 1:26 AM, Emanuel Berg via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org wrote:
>
> > goncholden wrote:
> >
> > > > > Is there a way to determine the font weight resulting from
> > > > >
> > > > > the command
> > > > >
> > > > > (set-face-attribute 'default nil :height 160 :weight
> > > > >
> > > > > 'ultra-bold)
> > > >
> > > > `face-attribute' or` get-char-property' ... maybe.
> > >
> > > I am changing font-lock-comment-face to normal weight.
> > >
> > > (set-face-attribute 'font-lock-comment-face nil :weight 'normal))
> > >
> > > But want to be able to change it back again to the default
> > >
> > > setting done initially using
> > >
> > > (set-face-attribute 'default nil :height 160 :weight 'ultra-bold)
> >
> > Do it.
>
> The problem is that I would not know what weight was used in the user init
> file, so I got to capture the weight (you mentioned face-attribute). But I
> do not know hon to use to set the comment face back to the original weight.

I would use (face-attribute face :weight), however what face should I use? so that
I con reset the weight of font-lock-comment-face?





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

* Re: Determining font weight
  2022-02-08  2:00         ` goncholden
@ 2022-02-08  8:24           ` irek
  2022-02-08  8:33           ` Kevin Vigouroux via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 8+ messages in thread
From: irek @ 2022-02-08  8:24 UTC (permalink / raw)
  To: goncholden; +Cc: help-gnu-emacs, moasenwood, goncholden

This is probably what you want.  Please note additional optional
attributes in face-attribute function.

;; Store initial width
(setq initial-weight (face-attribute 'font-lock-comment-face :weight nil t))

;; Change face width
(set-face-attribute 'font-lock-comment-face nil :weight 'bold)

;; Restore face width
(set-face-attribute 'font-lock-comment-face nil :weight initial-weight)



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

* Re: Determining font weight
  2022-02-08  2:00         ` goncholden
  2022-02-08  8:24           ` irek
@ 2022-02-08  8:33           ` Kevin Vigouroux via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 8+ messages in thread
From: Kevin Vigouroux via Users list for the GNU Emacs text editor @ 2022-02-08  8:33 UTC (permalink / raw)
  To: help-gnu-emacs

If your issue is related to the thread “Adding functionality to a minor
mode”, then I think you are mistaken.

Why define a minor mode to modify the syntax highlighting normally
defined inside a major mode using Font Lock mode?
-- 
Kevin Vigouroux
Best regards



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

end of thread, other threads:[~2022-02-08  8:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08  0:46 Determining font weight goncholden via Users list for the GNU Emacs text editor
2022-02-08  1:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-02-08  1:12   ` goncholden
2022-02-08  1:26     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-02-08  1:48       ` goncholden
2022-02-08  2:00         ` goncholden
2022-02-08  8:24           ` irek
2022-02-08  8:33           ` Kevin Vigouroux via Users list for the GNU Emacs text editor

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.