Provide a modeline in generated source
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Quickly |
Fix Released
|
Wishlist
|
Unassigned | ||
quickly (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I was reading the 'getting started' documentation. And it had a section on how you should be careful about tabs/spaces and to either change gedit's tab settings or always press space bar 4 times.
Rubbish! :)
I recommend that quickly insert modelines near the top of source files it creates, like so:
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
This syntax originated with emacs I believe but is supported by several editors, notably gedit.
The Mode: bit is for syntax highlighting, the coding bit says to use utf-8 (allowing unicode literals in python); the indent-tabs-mode says to use spaces (use 't' for tabs), and the tab-width is obvious.
When an editor opens a document with such a modeline, it will use those settings for just that document.
If a user wants to create new source files, no problem. Either they copy the existing source and get the modeline or they start from scratch and they can use whatever default tabbing their editor uses, which will be fine since it will be per-file consistent which is all that python cares about.
Related branches
- Didier Roche-Tolomelli: Approve
-
Diff: 671 lines (+74/-68)54 files modifiedbin/quickly (+1/-1)
data/templates/ubuntu-application/add.py (+1/-1)
data/templates/ubuntu-application/configure.py (+1/-1)
data/templates/ubuntu-application/create.py (+1/-1)
data/templates/ubuntu-application/debug.py (+1/-1)
data/templates/ubuntu-application/design.py (+1/-1)
data/templates/ubuntu-application/edit.py (+1/-1)
data/templates/ubuntu-application/help/code/jotty (+1/-1)
data/templates/ubuntu-application/help/tutorial-ga.xml (+0/-6)
data/templates/ubuntu-application/help/tutorial.xml (+0/-6)
data/templates/ubuntu-application/internal/bzrutils.py (+1/-1)
data/templates/ubuntu-application/internal/launchpad_helper.py (+1/-1)
data/templates/ubuntu-application/internal/packaging.py (+1/-1)
data/templates/ubuntu-application/internal/quicklyutils.py (+1/-1)
data/templates/ubuntu-application/license.py (+1/-1)
data/templates/ubuntu-application/package.py (+1/-1)
data/templates/ubuntu-application/project_root/bin/project_name (+1/-1)
data/templates/ubuntu-application/project_root/python/Aboutcamel_case_nameDialog.py (+1/-1)
data/templates/ubuntu-application/project_root/python/Preferencescamel_case_nameDialog.py (+1/-1)
data/templates/ubuntu-application/project_root/python/helpers.py (+1/-1)
data/templates/ubuntu-application/project_root/python/python_nameconfig.py (+1/-1)
data/templates/ubuntu-application/project_root/setup.py (+1/-1)
data/templates/ubuntu-application/release.py (+1/-1)
data/templates/ubuntu-application/run.py (+1/-1)
data/templates/ubuntu-application/save.py (+1/-1)
data/templates/ubuntu-application/share.py (+1/-1)
data/templates/ubuntu-application/store/apport/apport/source_project_name.py (+1/-1)
data/templates/ubuntu-application/store/python/dialog_camel_case_nameDialog.py (+1/-1)
data/templates/ubuntu-application/store/python/indicator.py (+2/-1)
data/templates/ubuntu-application/test/internal/apport-test-script.sh (+7/-6)
data/templates/ubuntu-application/test/internal/test-project.no_lpi (+1/-1)
data/templates/ubuntu-application/test/internal/test_apportutils.py (+6/-0)
data/templates/ubuntu-application/tutorial.py (+1/-1)
data/templates/ubuntu-application/upgrade.py (+7/-1)
data/templates/ubuntu-cli/project_root/bin/project_name (+1/-1)
data/templates/ubuntu-cli/project_root/python/python_nameconfig.py (+1/-1)
data/templates/ubuntu-cli/project_root/setup.py (+1/-1)
data/templates/ubuntu-pygame/project_root/setup.py (+1/-1)
data/templates/ubuntu-pygame/tutorial.py (+1/-1)
etc/bash_completion.d/quickly (+1/-1)
quickly/api.py (+1/-1)
quickly/builtincommands.py (+1/-1)
quickly/bzrbinding.py (+1/-1)
quickly/commands.py (+1/-1)
quickly/configurationhandler.py (+1/-1)
quickly/coreupgrade.py (+1/-1)
quickly/launchpadaccess.py (+1/-1)
quickly/quicklyconfig.py (+2/-2)
quickly/templatetools.py (+1/-1)
quickly/tools.py (+1/-1)
quickly/version.py (+1/-1)
setup.py (+2/-2)
test/update-test-results.sh (+1/-0)
ubuntudevbar.py (+3/-0)
Changed in quickly (Ubuntu): | |
status: | New → Triaged |
Changed in quickly: | |
status: | Triaged → Fix Committed |
Changed in quickly: | |
status: | Fix Committed → Fix Released |
oh really? emacs modelines are supported by gedit? awesome!
Another path is to launch gedit with settings by default when you launch quickly edit. I'm working with desrt to get that on track for the upcoming gsettings, but it will be effective only in N as gedit is rewritting it's plugin system.
In any case, that's good to know, and to add to all boiler plate files :)
Thanks.