protesilaos / logos

A simple "focus mode" which can be applied to any buffer for reading, writing, or even doing a presentation.
https://protesilaos.com/emacs/logos
GNU General Public License v3.0
30 stars 0 forks source link

Hook to enable a package #14

Open Ypot opened 1 year ago

Ypot commented 1 year ago

I would like to enable org-extra-emphasis just when logos is enabled. This doesn't work, any clue?


(defun my-logos-org-extra-emphasis ()
  (logos--mode 'org-extra-emphasis 1))
(add-hook 'logos-focus-mode-extra-functions #'my-logos-org-extra-emphasis)

Thanks for your work!

protesilaos commented 1 year ago

From: Ypot @.***> Date: Mon, 19 Jun 2023 12:33:22 -0700

I would like to enable org-extra-emphasis just when logos is enabled. This doesn't work, any clue?


(defun my-logos-org-extra-emphasis ()
  (logos--mode 'org-extra-emphasis 1))
(add-hook 'logos-focus-mode-extra-functions #'my-logos-org-extra-emphasis)

I cannot find org-extra-emphasis in my setup. Is this a separate package?

Thanks for your work!

You are welcome!

-- Protesilaos Stavrou https://protesilaos.com

Ypot commented 1 year ago

I cannot find org-extra-emphasis in my setup. Is this a separate package?

Yes, a joyful one!!!

https://github.com/QiangF/org-extra-emphasis

protesilaos commented 1 year ago

From: Ypot @.***> Date: Tue, 20 Jun 2023 06:07:31 -0700

I cannot find org-extra-emphasis in my setup. Is this a separate package?

Yes, a joyful one!!!

https://github.com/QiangF/org-extra-emphasis

Maybe the reason your code does not work is because Org mode needs to be restarted when this mode is enabled? Can you try the steps manually to see how it behaves? Namely, (i) enable logos-focus-mode, (ii) enable the Org extra emphasis, (iii) check if changes apply, and (iv) if changes do not apply do 'M-x org-mode-restart'.

-- Protesilaos Stavrou https://protesilaos.com

Ypot commented 1 year ago

From: Ypot @.***> Date: Tue, 20 Jun 2023 06:07:31 -0700 > I cannot find org-extra-emphasis in my setup. Is this a separate package? Yes, a joyful one!!! https://github.com/QiangF/org-extra-emphasis Maybe the reason your code does not work is because Org mode needs to be restarted when this mode is enabled? Can you try the steps manually to see how it behaves? Namely, (i) enable logos-focus-mode, (ii) enable the Org extra emphasis, (iii) check if changes apply, and (iv) if changes do not apply do 'M-x org-mode-restart'. -- Protesilaos Stavrou https://protesilaos.com

Changes apply without restarting

protesilaos commented 1 year ago

From: Ypot @.***> Date: Thu, 22 Jun 2023 04:29:28 -0700

[... 12 lines elided]

Changes apply without restarting

Strange... I would expect your original approach to work in this case. I am not sure what is going on.

-- Protesilaos Stavrou https://protesilaos.com