octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #54310] Synchronize file encoding used in edit


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #54310] Synchronize file encoding used in editor with the one used for executing m files
Date: Sat, 14 Jul 2018 13:35:46 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #1, bug #54310 (project octave):

A bit of brainstorming here:

This is probably an example of what I've imagined as an OOP-like way for the
GUI to override any function yet still call the (let's call it) "base script".
 In pseudo-code, say there were some C function or a script such as


install_custom_override (__mfile_encoding__, __gui_mfile_encoding__);


for which we could do


octave_value __gui_mfile_encoding__(octave_value args)
{
  CALL_BASE_FUNCTION (args);

  if (success)
    write_the_gui_code_here();
}


It would be a really convenient means of integrating a GUI (any, not
necessarily the Qt one) without extra code from the core's side.  All the
responsibility for debugging would be on the GUI side.  This would help in the
case of setting/clearing breakpoints, exit, etc.

So, at the start of the GUI code after launching the worker thread, it might
be something like


install_custom_override (dbstop, gui_dbstop);
install_custom_override (dbstep, gui_dbstep);
install_custom_override (dbclear, gui_dbclear);
install_custom_override (exit, gui_exit);
install_custom_override (__mfile_encoding__, __gui_mfile_encoding__);


The key thing is to still be able to call that existing base routine, just
like in OOP programming.  It's a bit of work on part of the parser and so on,
but once it's generalized, no more work on the core's part.  There must
already be function-pointer tables of some sort because Octave allows defining
functions.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54310>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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