Skip to content

Add new custom variables#46

Open
JoanVC100 wants to merge 3 commits intotmalsburg:masterfrom
JoanVC100:master
Open

Add new custom variables#46
JoanVC100 wants to merge 3 commits intotmalsburg:masterfrom
JoanVC100:master

Conversation

@JoanVC100
Copy link
Copy Markdown

This pull request introduces two small enhancements to guess-language.

First, it allows users to customize the mode-line string when the default dictionary is used. The variable used for this is guess-language-mode-line-string, which defaults to "default". It can be used to translate the "default" string, or it can be set to nil to show no mode if no language is detected.

Second, the guess-language-issue-message-flag variable has been added to control the issuing of messages. If this variable is nil, no messages will be issued. Currently, this setting only affects the Detected language: ... string.

This variable can be used to change the string that appears in the mode's lighter when the default language is being used.
This flag can be used to silence the "Detected language: ..." message
@tmalsburg
Copy link
Copy Markdown
Owner

tmalsburg commented May 7, 2025

Could you very briefly explain what problem these changes are fixing? Thank you.

@JoanVC100
Copy link
Copy Markdown
Author

Of course! These two variables are just customizations to adapt the package to my preferences. However, I think they could also be useful to others.

I added the guess-language-issue-message flag because I think the Detected language message is redundant. Since the mode line already informs me which dictionary is in use, I added this option to hide the message. The variable defaults to t, so the behaviour remains the same to other people. But now you have the option to disable it.

As for the guess-language-mode-line-string , personally I set it to nil so that I don't see any mode until a language is detected. It's highly subjective, but I don't care about flyspell corrections until a dictionary other than the default one is loaded. But it can also be used to translate "default" mode-line, similar to how you can change the names shown for a dictionary in guess-language-langcodes. After all, this package is related to languages, so I think it should also be translatable :P

I hope this message clarified the problems being addressed.

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

Successfully merging this pull request may close these issues.

2 participants