Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sml/setup and nyan-mode #156

Closed
junhan-z opened this issue Oct 26, 2015 · 2 comments
Closed

sml/setup and nyan-mode #156

junhan-z opened this issue Oct 26, 2015 · 2 comments

Comments

@junhan-z
Copy link

The package is awesome. Here I'm just reporting a trivial problem that I'm trying to solve. I think I need some help.

I use emacs nyan-mode for fun. I noticed that when I run M-x eval-buffer in the file which has (nyan-mode t) in it, since it is evaluated and will run again, nyan bar becomes two. It works fine when I haven't turn on smart-mode-line. It's not a big deal, but now that there is something just not compatible between these two, I'm curious and I haven't figured out why :( Sometimes I'm just lazy and use eval-buffer a lot. Now I used an if-else to detour this problem
(if nyan-mode () (nyan-mode t))

Therefore nyan-mode won't be set again when it is already set.

Before
wechat_1445845299
After
wechat_1445845326

I'm also reading and learning from your code and trying to solve and contribute. Currently the code doesn't have a function to indicate whether the smart-line-mode is on or off and seems there is no way to turn smart-mode-line off once it is on (sml/setup). Do you think that adding such functions could be handy when config this package?

I don't have too much experience in elisp, please correct me and give me some advice if there is anything I misunderstand, thanks!

@Malabarba
Copy link
Owner

I use emacs nyan-mode for fun. I noticed that when I run M-x eval-buffer in the file which has (nyan-mode t) in it, since it is evaluated and will run again, nyan bar becomes two. It works fine when I haven't turn on smart-mode-line.

Yeah, nyan-mode is probably making some assumption about the mode-line that is broken by sml. Because it's so corner case, and because you've already found a workaround, it's unlikely that I'll have the time to fix this.

If you'd like to investigate, try looking at nyan-mode's source code to understand how does it detect the its own presence in the mode-line.

I'm also reading and learning from your code and trying to solve and contribute. Currently the code doesn't have a function to indicate whether the smart-line-mode is on or off and seems there is no way to turn smart-mode-line off once it is on (sml/setup). Do you think that adding such functions could be handy when config this package?

Indeed, there's even a feature request asking for an off switch.

Feel free to try your hand at it if you'd like. :-)

@junhan-z
Copy link
Author

because you've already found a workaround, it's unlikely that I'll have the time to fix this.

Yes, the solution already works fine.

Indeed, there's even a feature request asking for an off switch.

I should have checked that before asking. Thanks for answering my question.

I'm gonna close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants