larstvei / Focus

Dim the font color of text in surrounding paragraphs
485 stars 16 forks source link

Use without theme #21

Closed jessekelly881 closed 4 years ago

jessekelly881 commented 4 years ago

Hi! I find the idea of focus fantastic. However, when I try to use focus I get "Can’t enable focus mode when no theme is loaded." It would be very nice if focus could work without a theme, similar to the way that fancy-narrow works(which I use often and love). Any plans for this? Thanks!

Possibly with just the ability to set the unfocused color.

emacs

larstvei commented 4 years ago

You're right! There's no good reason to not allow for a user-specified dim color. bf5fcff should fix this.

jessekelly881 commented 4 years ago

You are amazing. That was super fast. Thanks! Highly appreciated.

On Mon, Dec 2, 2019, 6:49 PM Lars Tveito notifications@github.com wrote:

You're right! There's no good reason to not allow for a user-specified dim color. bf5fcff https://github.com/larstvei/Focus/commit/bf5fcff0d03502218b559a202f1410b4f65a1dcf should fix this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/larstvei/Focus/issues/21?email_source=notifications&email_token=AFPAKM5WMC7LCE6XABJZ6T3QWWUITA5CNFSM4JUNOBD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFXWAPQ#issuecomment-560947262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFPAKM6ULOYUTGEWEQQQTFDQWWUITANCNFSM4JUNOBDQ .

jessekelly881 commented 4 years ago

Also, perhaps a face instead of a color would be more general. But maybe that's harder.

On Mon, Dec 2, 2019, 6:50 PM Jesse Kelly kellyjesse881@gmail.com wrote:

You are amazing. That was super fast. Thanks! Highly appreciated.

On Mon, Dec 2, 2019, 6:49 PM Lars Tveito notifications@github.com wrote:

You're right! There's no good reason to not allow for a user-specified dim color. bf5fcff https://github.com/larstvei/Focus/commit/bf5fcff0d03502218b559a202f1410b4f65a1dcf should fix this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/larstvei/Focus/issues/21?email_source=notifications&email_token=AFPAKM5WMC7LCE6XABJZ6T3QWWUITA5CNFSM4JUNOBD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFXWAPQ#issuecomment-560947262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFPAKM6ULOYUTGEWEQQQTFDQWWUITANCNFSM4JUNOBDQ .

larstvei commented 4 years ago

Hmm I’m not sure. Would that mean that you could for instance make the dimmed region transparent? Did you try it? If you give me an example of how you would like to customize it, then I can see if it’s hard to get working.

(I won’t be as quick with this one probably 😅)

larstvei commented 4 years ago

Hi again! Could you check out 19b3c7b? Setting focus-unfocused-face to a face will hopefully just work.

I sat the font-lock-comment-face as a default, giving the unfocused face the same look as comments; do you think this is a reasonable default? I'm considering adding a focused-face as well, allowing things like making the focused area boldface 🤓

In the branch I'm asking you to check out, I removed the option of setting the dimness and/or the color. I'm always a bit worried about removing stuff because I have no idea if anyone likes this option and uses it, but it might be okay if I bump the major version?

jessekelly881 commented 4 years ago

It is working beautifully! For me this branch is commit is perfect. Highly appreciated. As far as setting font-lock-comment-face as the default, it should be fine as its easy to override. But I'm really not sure. As far as removing the option for colors, I think its fine as the color can be easily set by setting the face(along with font type, size, weight, etc). Also by using a face it can be set with list-faces-display(for example).

larstvei commented 4 years ago

Nice! I'll play around a bit. I think it's probably better to define it as a face, so that it's easily configurable via list-faces-display as you suggest. I committed a version where you can set a face for the focused area to (like setting it bold or maybe to a bigger font). This seems way more flexible!

jessekelly881 commented 4 years ago

Yes! I think faces is the way to go. Its way more cristalizable.

larstvei commented 4 years ago

Nice, I added faces now.

The remaining question is if there is any way for a face to just make the text more transparent. This would resolve #2 👍

jessekelly881 commented 4 years ago

Thanks! Hmm. If you set the text close enough to the bg color it would be more or less invisible. I assume that's what is meant by transparent. Or literally transparent? I emacs in a terminal with a transparent bg(see pic above) and that is done by setting bg color to "undefinded-bg" but I don't think this works with text. I've never gotten it to work with foregrounds.

larstvei commented 4 years ago

I mean like setting opacity: 0.5 in CSS. That way, the syntax highlighting is maintained, but it's just a little bit out of focus.