* I can't make a custom face to take effect
@ 2024-03-30 11:33 Kepa
2024-03-30 11:43 ` Ihor Radchenko
0 siblings, 1 reply; 3+ messages in thread
From: Kepa @ 2024-03-30 11:33 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 942 bytes --]
Hi
I have added a custom face, but it doesn't work unless I do "M-x
org-mode-restart".
The custom face:
(defun yant/apply-custom-faces ()
(add-to-list 'org-font-lock-extra-keywords
'("(\\([^)]*?[A-Z]+[^)]+?[0-9]\\{3,4\\}[^)]*\\))" . (0 'shadow prepend))
'append))
(add-hook 'org-font-lock-set-keywords-hook #'yant/apply-custom-faces)
I have tried saving the desktop manually, but it doesn't take effect, I
have to reload org-mode each session.
This is my desktop-save config:
'(desktop-auto-save-timeout nil)
'(desktop-base-file-name "emacs-desktop")
'(desktop-file-name-format 'tilde)
'(desktop-lazy-idle-delay 0)
'(desktop-load-locked-desktop t)
'(desktop-missing-file-warning nil)
'(desktop-path '("~/.emacs.d/"))
'(desktop-restore-eager t)
'(desktop-restore-forces-onscreen 'all)
'(desktop-save nil)
(setq desktop-restore-frames t)
(setq desktop-restore-in-current-display t)
(desktop-read)
[-- Attachment #2: Type: text/html, Size: 1919 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: I can't make a custom face to take effect
2024-03-30 11:33 I can't make a custom face to take effect Kepa
@ 2024-03-30 11:43 ` Ihor Radchenko
2024-03-30 12:15 ` Kepa
0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2024-03-30 11:43 UTC (permalink / raw)
To: Kepa; +Cc: emacs-orgmode
Kepa <gnu.cognition199@slmails.com> writes:
> I have added a custom face, but it doesn't work unless I do "M-x
> org-mode-restart".
>
> The custom face:
>
> (defun yant/apply-custom-faces ()
> (add-to-list 'org-font-lock-extra-keywords
> '("(\\([^)]*?[A-Z]+[^)]+?[0-9]\\{3,4\\}[^)]*\\))" . (0 'shadow prepend))
> 'append))
>
> (add-hook 'org-font-lock-set-keywords-hook #'yant/apply-custom-faces)
>
> I have tried saving the desktop manually, but it doesn't take effect, I
> have to reload org-mode each session.
I suspect that the part of your config defining the hook is loaded too
late. Try to reproduce the problem starting from emacs -Q, as described
in https://orgmode.org/manual/Feedback.html#Feedback
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: I can't make a custom face to take effect
2024-03-30 11:43 ` Ihor Radchenko
@ 2024-03-30 12:15 ` Kepa
0 siblings, 0 replies; 3+ messages in thread
From: Kepa @ 2024-03-30 12:15 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 876 bytes --]
You're right, I moved it near the top of my init file, and it works
Solved!
Thanks
On 30/03/2024 12:43, yantar92 at posteo.net wrote:
> Kepa<gnu.cognition199@slmails.com> writes:
>
>> I have added a custom face, but it doesn't work unless I do "M-x
>> org-mode-restart".
>>
>> The custom face:
>>
>> (defun yant/apply-custom-faces ()
>> (add-to-list 'org-font-lock-extra-keywords
>> '("(\\([^)]*?[A-Z]+[^)]+?[0-9]\\{3,4\\}[^)]*\\))" . (0 'shadow prepend))
>> 'append))
>>
>> (add-hook 'org-font-lock-set-keywords-hook #'yant/apply-custom-faces)
>>
>> I have tried saving the desktop manually, but it doesn't take effect, I
>> have to reload org-mode each session.
> I suspect that the part of your config defining the hook is loaded too
> late. Try to reproduce the problem starting from emacs -Q, as described
> inhttps://orgmode.org/manual/Feedback.html#Feedback
>
[-- Attachment #2: Type: text/html, Size: 1766 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-30 12:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-30 11:33 I can't make a custom face to take effect Kepa
2024-03-30 11:43 ` Ihor Radchenko
2024-03-30 12:15 ` Kepa
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).