bpo-34864: warn if "Prefer tabs when opening documents" set to "Always" #10464
Conversation
The idea is good in principle, thanks. But the code cannot assume that the preference is always available.
When you're done making the requested changes, leave the comment: |
Thanks for the review @ned-deily! I have made the requested changes; please review again. |
Thanks for making the requested changes! @ned-deily: please review the changes made to this pull request. |
LGTM, thanks for making the changes. BTW, I notice that, with macOS 10.13 at least, if a change to "Always" is made while IDLE is running, the change is honored on the next window open; no need to restart IDLE. So perhaps the message can be simplified. Also, just an FYI, if a tab (rather than a window) is created, it can be converted to a window by control-clicking on the tab title bar and selecting the "Move Tab to New Window" option; this is a standard macOS feature with tabs and seems to work OK with IDLE.
Thank you both for PR and review. IDLE still start normally on Windows with patch.
I removed 2.7 backport only because it will have to be done by hand.
Besides CI tests, I think manually testing it on Mac should be enough.
@@ -0,0 +1 @@ | |||
On macOS, warn if "Prefer tabs when opening documents" is set to "Always". |
For the idlelib/News.txt entry, I am thinking about the more specific
When opening IDLE with Shell on macOS, warn if System
Preference "Prefer tabs when opening documents" is set to "Always".
Do what you like best for the blurb.
I prefer not mentioning the shell, since that's an implementation detail of how we currently show warnings, and could change in the future.
The issue I addressed is when the check is made, which appears to at at startup if Shell is opened and no code is run by command line options. If 'always' is set after IDLE is open, there will be no warning until the next start.
Where messages go is a different issue, except that not using Shell will allow checks when IDLE is opened to edit a file. config._warn prints to stderr (the console if IDLE started from one). I am thinking all messages from IDLE should go to a message log (output) window that can be saved or printed.
When you're done making the requested changes, leave the comment: And if you don't make the requested changes, you will be put in the comfy chair! |
ae5a09c
to
81975d8
Thanks, I've updated the warning message. |
Thanks for the review @terryjreedy! I have made the requested changes; please review again. Regarding the 2.7 backport, I'll do it manually after this goes in. |
Thanks for making the requested changes! @ned-deily, @terryjreedy: please review the changes made to this pull request. |
If people changes to 'alway' while IDLE is running, there will be no warning until IDLE is started again. It is up to them to connect 'I changed the setting' to 'IDLE changed behavior'. |
Since this was written, there has been a question (report) about this on Stackoverflow. I added a note to idlelib/NEWS.txt and will merge when CI passes to get this in the upcoming rcs. |
Thanks @taleinat for the PR, and @terryjreedy for merging it |
@terryjreedy: Please replace |
GH-11013 is a backport of this pull request to the 3.7 branch. |
…s" (pythonGH-10464) * bpo-34864: warn if "Prefer tabs when opening documents" set to "Always" * add NEWS entry * address code review comments * address second code review comments * Add entry for idlelib/NEWS.txt. (cherry picked from commit 9ebe879) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
GH-11014 is a backport of this pull request to the 3.6 branch. |
…s" (pythonGH-10464) * bpo-34864: warn if "Prefer tabs when opening documents" set to "Always" * add NEWS entry * address code review comments * address second code review comments * Add entry for idlelib/NEWS.txt. (cherry picked from commit 9ebe879) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
The warning is displayed in new shell windows, except when running a command or a script. (This is identical to the existing behavior of the warning about problematic Tcl/Tk versions on macOS.)
https://bugs.python.org/issue34864
The text was updated successfully, but these errors were encountered: