[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: locale encoding and core functions

From: Andrew Janke
Subject: Re: locale encoding and core functions
Date: Tue, 12 Mar 2019 06:41:43 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.3

On 3/12/19 12:49 AM, John W. Eaton wrote:
On 3/9/19 3:25 PM, Mike Miller wrote:
 > The PKG_ADD and PKG_DEL files can be dropped into any directory on the
 > load path, and they already support executing arbitrary commands.

Good point.  We might as well use those files.  As a separate issue, we might think about whether it is safe to execute arbitrary code found in those files..

 > Do we need to define a new file or can we install PKG_ADD files that run
 > some command that does what you need? Something like
 >      dn = fileparts (mfilename ("fullpath"));
 >      set_dir_file_encoding (dn);
Seems reasonable to me.


This sounds like it would work.

How about a more generic function that supports compatibility mode and other code base properties like jwe suggested earlier? Something like:

# Signature
codebase_properties (dir, property_name, property_val)

# Set encoding
my_dir = fileparts (mfilename ("fullpath"))
codebase_properties (my_dir, "encoding", "UTF-8")
# Set compatibility mode
codebase_properties (my_dir, "compatibility", "octave")
codebase_properties (my_dir, "compatibility", "matlab")  # or "traditional"

And maybe have no-arg codebase_properties() dump a list of all the dirs with properties set and the values of all their properties, as a debugging convenience.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]