[Pkg-jed-commit] r411 - in jed/trunk/debian: . patches

Jörg Sommer jo-guest at costa.debian.org
Thu Sep 7 00:05:42 UTC 2006


Author: jo-guest
Date: 2006-09-07 00:05:41 +0000 (Thu, 07 Sep 2006)
New Revision: 411

Added:
   jed/trunk/debian/patches/fix-pymode-tab-space.dpatch
Modified:
   jed/trunk/debian/changelog
   jed/trunk/debian/patches/00list
Log:
* patches/fix-pymode-tab-space.dpatch patches/00list changelog
  + Added a patch to fix the problem with tab vs space characters as
    indention character in Python.


Modified: jed/trunk/debian/changelog
===================================================================
--- jed/trunk/debian/changelog	2006-09-06 15:29:31 UTC (rev 410)
+++ jed/trunk/debian/changelog	2006-09-07 00:05:41 UTC (rev 411)
@@ -1,18 +1,22 @@
 jed (0.99.18-5) unstable; urgency=low
 
-  * debian/jed-common.templates: fixed a typo the the debconf question; thanks
+  * jed-common.templates: fixed a typo the the debconf question; thanks
     to Sven Joachim <sven_joachim at web.de> (closes: #384726) [JS]
 
-  * debian/po/fr.po: Updated the French debconf translation; thanks to
+  * po/fr.po: Updated the French debconf translation; thanks to
     Thomas Huriaux <thomas.huriaux at gmail.com> (closes: #384683) [JS]
 
-  * debian/po/cs.po: Updated the Czech debconf translation; thanks to
+  * po/cs.po: Updated the Czech debconf translation; thanks to
     Miroslav Kure <kurem at upcase.inf.upol.cz> (closes: #384751) [JS]
 
-  * debian/po/de.po: Added a German debconf translation [JS]
+  * po/de.po: Added a German debconf translation [JS]
 
- -- Rafael Laboissiere <rafael at debian.org>  Sun, 27 Aug 2006 11:42:45 +0200
+  * patches/fix-pymode-tab-space.dpatch: Added a patch to make python mode
+    use the right indention character for a file (tab vs. space)
+    (closes: #305668) [JS]
 
+ -- Rafael Laboissiere <rafael at debian.org>  Thu, 7 Sep 2006 01:46:42 +0200
+
 jed (0.99.18-4) unstable; urgency=low
 
   * debian/watch: Added file [RL]

Modified: jed/trunk/debian/patches/00list
===================================================================
--- jed/trunk/debian/patches/00list	2006-09-06 15:29:31 UTC (rev 410)
+++ jed/trunk/debian/patches/00list	2006-09-07 00:05:41 UTC (rev 411)
@@ -15,3 +15,4 @@
 
 fix-pymode-block-end
 doc
+fix-pymode-tab-space

Added: jed/trunk/debian/patches/fix-pymode-tab-space.dpatch
===================================================================
--- jed/trunk/debian/patches/fix-pymode-tab-space.dpatch	                        (rev 0)
+++ jed/trunk/debian/patches/fix-pymode-tab-space.dpatch	2006-09-07 00:05:41 UTC (rev 411)
@@ -0,0 +1,142 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix-pymode-tab-space.dpatch by Jörg Sommer <joerg at alea.gnuu.de>
+##
+## DP: In Python, it is forbidden to mix up tabs and spaces as indention
+## DP: characters. This patch enhances the python mode to take care of the
+## DP: prefered indention character in a file. Fixes #305668
+
+ at DPATCH@
+diff -urNad trunk~/lib/pymode.sl trunk/lib/pymode.sl
+--- trunk~/lib/pymode.sl	(Revision 35) 
++++ trunk/lib/pymode.sl	        (Arbeitskopie)
+@@ -139,10 +139,16 @@
+     
+    col = what_column() - 1;
+     
++   variable indent;
++   if ( get_blocal_var("py_use_tab") )
++      indent = TAB;
++   else
++      indent = Py_Indent_Level;
++
+    if (py_line_ends_with_colon())
+-      col += Py_Indent_Level;
++      col += indent;
+    if (py_endblock_cmd() or (subblock and not py_line_starts_block()))
+-      col -= Py_Indent_Level;
++      col -= indent;
+ }
+ 
+ define py_indent_line()
+@@ -151,6 +157,9 @@
+     
+    col = py_indent_calculate();
+    bol_trim ();
++   if ( get_blocal_var("py_use_tab") )
++      loop (col / TAB) insert_char('\t');
++   else
+    whitespace( col );
+ }
+ 
+@@ -246,11 +255,19 @@
+    bskip_white(); 
+    if (bolp() and (col > 1)) { 
+       pop_spot();                                                     
++      if ( blooking_at("\t") )
++      {
++          () = left(1);
++          del();
++      }
++      else
++      {
+       bol_trim (); 
+       col--;                                                         
+       if (col mod Py_Indent_Level == 0) 
+         col--; 
+       whitespace ( (col / Py_Indent_Level) * Py_Indent_Level ); 
++      }
+    } 
+    else { 
+       pop_spot(); 
+@@ -261,6 +278,9 @@
+ define py_shift_line_right()
+ {
+    bol_skip_white();
++   if ( get_blocal_var("py_use_tab") )
++      insert_char('\t');
++   else
+    whitespace(Py_Indent_Level);
+ }
+ 
+@@ -293,9 +313,17 @@
+ {
+    bol_skip_white();
+    if (what_column() > Py_Indent_Level) {
++      if ( get_blocal_var("py_use_tab") )
++      {
++          () = left(1);
++          del();
++      }
++      else
++      {
+       push_mark();
+       goto_column(what_column() - Py_Indent_Level);
+       del_region();
++      }
+    }
+ }
+ 
+@@ -440,11 +468,17 @@
+ 	 % Indent is wrong.  Hopefully it's a continuation line.
+ 	 level = oldlevel;	% reset level
+ 	 bol_trim();
++         if ( get_blocal_var("py_use_tab") )
++            loop (level) insert_char('\t');
++         else
+ 	 whitespace(level * Py_Indent_Level + (col - current_indent));
+       } else {
+ 	 current_indent = col;
+ 	 indent_level[level] = col;
+ 	 bol_trim();
++         if ( get_blocal_var("py_use_tab") )
++            loop (level) insert_char('\t');
++         else
+ 	 whitespace(level * Py_Indent_Level);
+       }
+    } while (down(1) == 1);
+@@ -578,12 +612,29 @@
+ {
+    variable python = "python";
+    
+-   % TAB is checked by whitespace(). If TAB=0 no tab character is used,
+-   % which avoids mixing up whitespace and tab indention
+-   if (Py_Indent_Level == 8)
+-     TAB = 8;
+-   else
+-     TAB = 0;
++   create_blocal_var("py_use_tab");
++   set_blocal_var(Py_Indent_Level == TAB, "py_use_tab");
++   push_spot();
++   bob();
++   do
++   {
++       skip_white();
++       if ( looking_at("\"\"\"") )
++       {
++           () = right(1);
++           () = fsearch("\"\"\"");
++       }
++       else
++         !if (looking_at_char('#') or eolp() or what_column() == 1)
++         {
++             message("foo" + string(what_line()));
++             bol();
++             set_blocal_var(looking_at_char('\t'), "py_use_tab");
++             break;
++         }
++   }
++   while ( down(1) );
++   pop_spot();
+ 
+    set_mode (python, 0x4); % flag value of 4 is generic language mode
+    use_keymap(python);




More information about the Pkg-jed-commit mailing list