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

 
 

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

Submitted by:  Julien Bect <jbect>
Submitted on:  Tue 07 Jan 2014 03:40:42 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.8.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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 <ttl>
Project 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 <ttl>
Project 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 <ttl>
Project 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 File(s):
   
   
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
  • -unavailable- added by ttl (Posted a comment)
  • -unavailable- added by jbect (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Jan 2014 05:13:38 PM UTCjbectAttached File-=>Added jbPatchValidIdentifier.patch, #30329
    Sun 19 Jan 2014 07:28:16 AM UTCjbectAttached File-=>Added jbPatchTypo.patch, #30308
    Tue 14 Jan 2014 08:04:59 PM UTCttlStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1