bugGNU Octave - Bugs: bug #41136, GUI Editor: should warn about...

 
 

bug #41136: GUI Editor: should warn about incorrect file names

Submitter:  Julien Bect <jbect>
Submitted:  Tue 07 Jan 2014 03:40:42 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 21 Jan 2014 10:21:01 PM UTC, comment #9: 

Thanks for the patch. I pushed it with some minor changes in changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/770c525a1a2b
The comment should contain all affected functions.

To your comment: "execute_command_in_terminal" queues the command and then an event is posted for handling the queue.

Still on my list is the implementation of preferences to switch the warnings on and off.

Torsten Lilge <ttl>
Group Member
Tue 21 Jan 2014 05:13:38 PM UTC, comment #8: 

Here is a patch that warns more generally when the script name is not a valid identifier.



(file #30329)

Julien Bect <jbect>
Tue 21 Jan 2014 12:26:25 PM UTC, comment #7: 

I have found the function "valid_identifier", which seems to do the job. I will propose a patch based on this, unless someone points me to a better direction.

http://octave.sourceforge.net/doxygen/html/d7/da9/utils_8cc_source.html#l00077

Julien Bect <jbect>
Tue 21 Jan 2014 12:20:39 PM UTC, comment #6: 

A similar problem occurs when the script name contains accented letters (which happens very often with French students :) or, more generally, when the script name is not a valid Octave command name.

The case of spaces is just a special case of this more general issue. I would like to propose a patch for this... Is there a simple way of checking whether a given string is a valid Octave command name ?

Julien Bect <jbect>
Mon 20 Jan 2014 09:41:41 PM UTC, comment #5: 

Patch applied, thanks

Torsten Lilge <ttl>
Group Member
Sun 19 Jan 2014 07:28:16 AM UTC, comment #4: 

Here is a patch that fixes the typo in file-editor-tab.cc



(file #30308)

Julien Bect <jbect>
Wed 15 Jan 2014 09:27:52 AM UTC, comment #3: 

About the QMessageBox in main-window.cc: considering that the user has already been warned about the dangers of using spaces in file names, I would personnally prefer to have "run" used automatically and silently, or perhaps with a warning in the command window.

After all, if I really choose to work with filenames containing spaces (why not ?), why should I be bothered with a QMessageBox each time that I run it ?

What do you think about this ?

Julien Bect <jbect>
Wed 15 Jan 2014 09:22:20 AM UTC, comment #2: 

Thanks Torsten, I will try this as soon as my build is finished :)

There is a typo in the string on l.17 of the diff:

"Do you wnat to chose another name?"
--> "Do you want to chose another name?"

Julien Bect <jbect>
Tue 14 Jan 2014 08:04:59 PM UTC, comment #1: 

Implemented with cset
http://hg.savannah.gnu.org/hgweb/octave/rev/3a26bb54655e
on gui-release.

Thanks for the suggestion.

Torsten Lilge <ttl>
Group Member
Tue 07 Jan 2014 03:40:42 PM UTC, original submission:  

A typical error for Octave novices is to create a script with spaces in its name. It would be nice if the GUI could warn about such errors.

Let us consider a simple scenario.

1) Create a new script from the GUI (File > New > Script)

2) Put some stuff in it and save as "to to.m"

3) Run the script from the menu in the editor

After stage 2), nothing happens. A warning dialog would be useful here, indicating that spaces in script names should be avoided (and perhaps that this script can be run using run ("to to.m") anyway, if the user insists on having spaces in its filename).

After stage 3), the editor itself doesn't tell me anything, and I can see the following message in the command window:

error: 'to' undefined near line 1 column 1

It would clearer if, instead, an error dialog could pop up and tell me that the script cannot be run because it has a space in its filename. Alternatively, the editor could use run ("to to.m"), in which case there would be no error.


Julien Bect <jbect>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #30329:  jbPatchValidIdentifier.patch added by jbect (3KiB - text/x-patch)
file #30308:  jbPatchTypo.patch added by jbect (985B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by jbect (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-21 jbect Attached File- Added jbPatchValidIdentifier.patch, #30329
    2014-01-19 jbect Attached File- Added jbPatchTypo.patch, #30308
    2014-01-14 ttl StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code