Re: [code] Textadept in the migration from Python2 to Python3

From: Arnel <rcl.att.openmailbox.org>
Date: Fri, 22 Apr 2016 15:54:02 +0800

On 22 April 2016 09:13AM, Pedro Andres Aranda Gutierrez wrote:
> I'm not saying that we change TextAdept to work with Python3 only. However,
> you will agree that this will be an issue in the future as more people
> start migrating. I would suggest that if a solution to this issue is found
> that makes TextAdept work with both Python2 and Python3, it is integrated
> into the release (i.e. not in the user's init.lua). This will make the case
> for textAdept only stronger :-)

I never suggested changing TA to work _only_ with Python3 - far from it.

The patterns change was to make TA identify scripts with hashbangs ending in
'python3' as Python3 scripts. However, the latter results in an additional
field for Python3 scripts, without a separate file extension to accompany that
change. I only pointed out what would happen.

If I misinterpreted how that system works, please correct me.

For syntax-checking Python3 scripts, all I have in my 'init.lua' is:

> textadept.run.syntax_commands.python = function()
> return ([[python3 -c
> "compile(open('%f').read(),'%f','exec',0,1)"]]):gsub('%%f',
> (buffer.filename:gsub('\\', '\\\\\\\\'))) end
>
> textadept.run.run_commands.python = 'python3 -u "%f"'

They're almost exact copies of what's in the TA modules, except for the
Python executable. That's it.

----
Thank you,
Arnel
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Fri 22 Apr 2016 - 03:54:02 EDT

This archive was generated by hypermail 2.2.0 : Fri 22 Apr 2016 - 06:52:30 EDT