Provide a modeline in generated source

Bug #606285 reported by Michael Terry
6
This bug affects 1 person
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

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

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.

Changed in quickly:
status: New → Triaged
importance: Undecided → Wishlist
Changed in quickly (Ubuntu):
status: New → Triaged
Changed in quickly:
status: Triaged → Fix Committed
Changed in quickly:
status: Fix Committed → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote :

quickly (0.6-0ubuntu1) maverick; urgency=low

  * New upstream release: (LP: #638130)
   + quickly core:
    - enhance API with real case usage: nautilus extension
    - move bzr call to use internal API (Jelmer Vernooij)
    - support user defined template paths (Barry Warsaw) (LP: #585617)
    - quickly quickly now uses import command functionality from the origin
      template
    - fix copyright file (Kyle Nitzsche) (LP: #610096)
   + ubuntu-application-template and derivatives:
    - push the tarball to launchpad instead of the .changes (LP: #594256)
    - move bzr call to use internal API (Jelmer Vernooij)
    - add apache license (Monty Taylor)
    - update and improvment of the tutorial (Ryan Macnish)
    - "$ quickly add indicator" to add indicator support to your project
      (Owais Lone)
    - add yelp dep for tutorial (Umang Varma) (LP: #610026)
    - some fixes to the tutorial (Henrik H.) (LP: #608421)
    - don't add changelog for quickly package command (Umang Varma)
      (LP: #587538)
    - add quickly configure distribution <distro> to release to another
      distribution than your current one (Umang Varma) (LP: #608191)
    - Provide a modeline in generated source (Michael Terry) (LP: #606285)
  * debian/control:
    - bump python-distutils-extra build-dep
    - new core breaks older ubuntu-application template (package command)
      (LP: #635624)
    - quickly-ubuntu-template now depends on yelp (LP: #610026)

 -- Didier Roche <email address hidden> Tue, 14 Sep 2010 17:12:23 +0200

Changed in quickly (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.