~protesilaos/fontaine

3 2

FYI: adding to no-littering package

Christopher League <league@contrapunctus.net>
Details
Message ID
<87sfpop0dm.fsf@contrapunctus.net>
DKIM signature
missing
Download raw message
Thanks for fontaine, this is great!

I use no-littering to help keep the user-emacs-directory clean, in part
by defining etc/ and var/ subdirs for config and state.

It's easy enough to setq fontaine-latest-state-file in my own init, but
part of the philosophy of no-littering is to collect configurations that
help other packages stick to their file location conventions, so users
don't have to think about it.

So this is just a quick note that I made a PR to include
fontaine-latest-state-file in no-littering:
https://github.com/emacscollective/no-littering/pull/175

Thanks again.

Chris
Details
Message ID
<87sfporsuk.fsf@protesilaos.com>
In-Reply-To
<87sfpop0dm.fsf@contrapunctus.net> (view parent)
DKIM signature
missing
Download raw message
> From: Christopher League <league@contrapunctus.net>
> Date: Thu, 05 May 2022 09:36:21 -0400

Hello Chris!

> Thanks for fontaine, this is great!

You are welcome!

> I use no-littering to help keep the user-emacs-directory clean, in part
> by defining etc/ and var/ subdirs for config and state.
>
> It's easy enough to setq fontaine-latest-state-file in my own init, but
> part of the philosophy of no-littering is to collect configurations that
> help other packages stick to their file location conventions, so users
> don't have to think about it.
>
> So this is just a quick note that I made a PR to include
> fontaine-latest-state-file in no-littering:
> https://github.com/emacscollective/no-littering/pull/175

Very well!  I am monitoring the PR.  Once it gets merged, I will update
the manual to reference no-littering.

All the best,
Protesilaos (or simply "Prot")

-- 
Protesilaos Stavrou
https://protesilaos.com
Christopher League <league@contrapunctus.net>
Details
Message ID
<87pmksoyv6.fsf@contrapunctus.net>
In-Reply-To
<87sfporsuk.fsf@protesilaos.com> (view parent)
DKIM signature
missing
Download raw message
Protesilaos Stavrou <info@protesilaos.com> writes:

>> https://github.com/emacscollective/no-littering/pull/175
>
> Very well!  I am monitoring the PR.  Once it gets merged, I will update
> the manual to reference no-littering.

C’est parfait. (I had to laugh at your alleged acronym for ‘fontaine’)

One other note related to the latest-state functionality and the example
configuration in the manual. It seems that restore-latest-preset sets
the variable recovered-preset as a side effect, and then you feed that
to set-preset:

    (fontaine-restore-latest-preset)
    (if-let ((state fontaine-recovered-preset))
        (fontaine-set-preset state)
      (fontaine-set-preset 'regular))

I was wondering if the side-effect variable is really needed (maybe you
have a reason for it), because this seemed equivalent to me:

    (if-let ((state (fontaine-restore-latest-preset)))
        (fontaine-set-preset state)
      (fontaine-set-preset 'regular))

And once I got it there, I realized I could lift the set-preset outside
of the if logic, and I arrived at this:

    (fontaine-set-preset
      (or (fontaine-restore-latest-preset) 'regular))

I believe it just loads and falls back to 'regular in the same way. If
that seems simpler to you too, then enjoy!

Chris
Details
Message ID
<87o80cdpdu.fsf@protesilaos.com>
In-Reply-To
<87pmksoyv6.fsf@contrapunctus.net> (view parent)
DKIM signature
missing
Download raw message
> From: Christopher League <league@contrapunctus.net>
> Date: Thu, 05 May 2022 10:09:01 -0400
>
> Protesilaos Stavrou <info@protesilaos.com> writes:
>
>>> https://github.com/emacscollective/no-littering/pull/175
>>
>> Very well!  I am monitoring the PR.  Once it gets merged, I will update
>> the manual to reference no-littering.
>
> C’est parfait. (I had to laugh at your alleged acronym for ‘fontaine’)

Haha!  I try to do this when possible.  Keeps things interesting.

> One other note related to the latest-state functionality and the example
> configuration in the manual. It seems that restore-latest-preset sets
> the variable recovered-preset as a side effect, and then you feed that
> to set-preset:
>
>     (fontaine-restore-latest-preset)
>     (if-let ((state fontaine-recovered-preset))
>         (fontaine-set-preset state)
>       (fontaine-set-preset 'regular))
>
> I was wondering if the side-effect variable is really needed (maybe you
> have a reason for it), because this seemed equivalent to me:
>
>     (if-let ((state (fontaine-restore-latest-preset)))
>         (fontaine-set-preset state)
>       (fontaine-set-preset 'regular))
>
> And once I got it there, I realized I could lift the set-preset outside
> of the if logic, and I arrived at this:
>
>     (fontaine-set-preset
>       (or (fontaine-restore-latest-preset) 'regular))
>
> I believe it just loads and falls back to 'regular in the same way. If
> that seems simpler to you too, then enjoy!

Excellent, thank you!  I just updated the manual in commit 656efea and
mentioned you in the "Acknowledgements".  I will also do it for my
'cursory' package, which shares the same code.

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)