<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div class="ydp59b24c26yahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div><div><span><span><div><div>I would like the conversion of leading tabs to spaces for 
Python files and of leading spaces to tabs (but more importantly NOT vice 
versa) for Php files.<span><span><span>  I am sure many of you have addressed this issue already and know how best to handle it in Geany.</span></span> I don't see an obviously good way to handle it. I can only guess a special configuration file might do it, and call me lazy.<br></span></div></div></span></span></div><div><span><br></span></div><div><span>Python (*.py):<br></span></div><div><span>The custom and better way in Python is leading spaces not leading tabs. If spaces and tabs are mixed, the visual appearance is not indicative of actual block nesting. Per PEP 8, Python 3 forbids mixing (unlike Python 2) and prefers spaces, 4 for each indent level: <a href="https://www.python.org/dev/peps/pep-0008/" rel="nofollow" target="_blank" class="enhancr_card_8014116518">PEP 8 -- Style Guide for Python Code</a>.</span><div><br></div><div id="ydp322e6be2enhancr_card_8014116518" class="ydp322e6be2yahoo-link-enhancr-card ydp322e6be2ymail-preserve-class ydp322e6be2ymail-preserve-style" style="max-width:400px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif" data-url="https://www.python.org/dev/peps/pep-0008/" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://www.python.org/dev/peps/pep-0008/" style="text-decoration:none !important;color:#000 !important" class="ydp322e6be2yahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table class="ydp322e6be2card-wrapper ydp322e6be2yahoo-ignore-table" style="max-width:400px" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="400"><table class="ydp322e6be2card ydp322e6be2yahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td class="ydp322e6be2card-primary-image-cell" style="background-color: rgb(0, 0, 0); background-repeat: no-repeat; background-size: cover; position: relative; border-radius: 2px 2px 0px 0px; min-height: 175px;" valign="top" height="175" bgcolor="#000000" background="https://s.yimg.com/lo/api/res/1.2/sYpbcHiDByqbm9Wn48HnhA--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://www.python.org/static/opengraph-icon-200x200.png.cf.jpg"><!--[if gte mso 9]><v:rect fill="true" stroke="false" style="width:396px;height:175px;position:absolute;top:0;left:0;"><v:fill type="frame" color="#000000" src="https://s.yimg.com/lo/api/res/1.2/sYpbcHiDByqbm9Wn48HnhA--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://www.python.org/static/opengraph-icon-200x200.png.cf.jpg"/></v:rect><![endif]--><table class="ydp322e6be2card-overlay-container-table ydp322e6be2yahoo-ignore-table" style="width:100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td class="ydp322e6be2card-overlay-cell" style="background-color: transparent; border-radius: 2px 2px 0px 0px; min-height: 175px;" valign="top" bgcolor="transparent" background="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png"><!--[if gte mso 9]><v:rect fill="true" stroke="false" style="width:396px;height:175px;position:absolute;top:-18px;left:0;"><v:fill type="pattern" color="#000000" src="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png"/><v:textbox inset="0,0,20px,0"><![endif]--><table class="ydp322e6be2yahoo-ignore-table" style="width: 100%; min-height: 175px;" height="175" border="0"><tbody><tr><td class="ydp322e6be2card-richInfo2" style="text-align:left;padding:15px 0 0 15px;vertical-align:top"></td><td class="ydp322e6be2card-actions" style="text-align:right;padding:15px 15px 0 0;vertical-align:top"><div class="ydp322e6be2card-share-container"></div></td></tr></tbody></table><!--[if gte mso 9]></v:textbox></v:rect><![endif]--></td></tr></tbody></table></td></tr><tr><td><table class="ydp322e6be2card-info ydp322e6be2yahoo-ignore-table" style="background-color: rgb(255, 255, 255); background-repeat: repeat; background-attachment: scroll; background-image: none; background-size: auto; position: relative; z-index: 2; width: 100%; max-width: 400px; border-radius: 0px 0px 2px 2px; border-top: 1px solid rgb(224, 228, 233);" cellspacing="0" cellpadding="0" border="0" align="center"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px"></td><td style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0"><h2 class="ydp322e6be2card-title" style="font-size:14px;line-height:19px;margin:0 0 6px 0;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;word-break:break-word;color:#26282a">PEP 8 -- Style Guide for Python Code</h2><p class="ydp322e6be2card-description" style="font-size:12px;line-height:16px;margin:0;color:#979ba7;word-break:break-word">The official home of the Python Programming Language</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br></div><div><br></div></div><div><span><br></span></div><div><span>Php (*.php):</span></div><div><span>Wordpress recommends leading tabs: <a href="https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation" rel="nofollow" target="_blank" class="enhancr_card_8676284824">PHP Coding Standards | Wpcs Handbook Handbook | WordPress Developer Resources</a>.</span><div><br></div><div id="ydp49f8b1e3enhancr_card_8676284824" class="ydp49f8b1e3yahoo-link-enhancr-card ydp49f8b1e3yahoo-link-enhancr-not-allow-cover ydp49f8b1e3ymail-preserve-class ydp49f8b1e3ymail-preserve-style" style="max-width:400px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif" data-url="https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation" style="text-decoration:none !important;color:#000 !important" class="ydp49f8b1e3yahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table class="ydp49f8b1e3card-wrapper ydp49f8b1e3yahoo-ignore-table" style="max-width:400px" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="400"><table class="ydp49f8b1e3card ydp49f8b1e3yahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td><table class="ydp49f8b1e3card-info ydp49f8b1e3yahoo-ignore-table" style="background-color: rgb(255, 255, 255); background-repeat: repeat; background-attachment: scroll; background-image: none; background-size: auto; position: relative; z-index: 2; width: 100%; max-width: 400px; border-radius: 0px 0px 2px 2px; border-top: 1px solid rgb(224, 228, 233);" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px"></td><td style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0"><h2 class="ydp49f8b1e3card-title" style="font-size:14px;line-height:19px;margin:0 0 6px 0;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;word-break:break-word;color:#26282a">PHP Coding Standards | Wpcs Handbook Handbook | WordPress Developer Reso...</h2><p class="ydp49f8b1e3card-description" style="font-size:12px;line-height:16px;margin:0;color:#979ba7;word-break:break-word"></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br></div><br></div><div><span>I see this: Preferences -> Editor -> Indentation -> 'Detect type from file'. It is not working for me. I know, barely, that one can create a custom Geany configuration file. Can one specify the correct behavior by file extension, and is that a good or best way?</span></div><div><span><br></span></div><div><span>I notice on the Geany Plugin Wishlist this item (stale as it is): <br></span></div><div><span><br></span></div><div><span><span>Feature found in Slickedit: Tabs to spaces option should be file extension dependent (i.e. you might want it most of the time but not e.g. for the .mak file extension). (Tuesday, September 29, 2009) <br></span><br></span></div><div>For anyone who already knows,<span></span> what is the state of affairs on this desirable functionality? What good is the 'Detect type from file' setting? My experiments have been fruitless.<br></div><div><br></div><div class="ydp59b24c26signature"><div>Douglas Morris<br></div></div></div></div></body></html>