bugGNU Octave - Bugs: bug #41258, Make graphics_toolkit('bad') a...

 
 

bug #41258: Make graphics_toolkit('bad') a warning

Submitter:  Michael Godfrey <godfrey>
Submitted:  Fri 17 Jan 2014 04:04:28 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  None
Originator Name:  Michael Godfrey Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 25 Jan 2014 07:37:10 AM UTC, comment #5: 

I changed the message to an error and reworded the commit message. This is essentially a documentation fix, doesn't change behavior at all since all valid toolkits are registered, so I applied this to the stable branch. This will be part of the upcoming 3.8.1 point release. Thanks!

http://hg.savannah.gnu.org/hgweb/octave/rev/abc78c10acb6

Mike Miller <mtmiller>
Group Member
Fri 17 Jan 2014 04:15:07 PM UTC, comment #4: 

Well, I do not feel strongly about this. I do not
think that many users will be doing much toolkit
switching within functions or scripts. But, in
any case, since at present the plots have to be
rendered on the screen, the user will notice that
the toolkit did or did not change.

So, I am happy to leave it to the person who
pushes the changeset.  If you are doing it feel free
to change warning to error.
All that is needed is to change warning to error and,
for tidiness, delete following return. This can be
done by editing the diff.

Michael Godfrey <godfrey>
Group Member
Fri 17 Jan 2014 02:28:11 PM UTC, comment #3: 

I see, so you want to allow people to put graphics_toolkit whatever in scripts and only show a warning message and silently continue with whatever the current toolkit is? I have no strong opinion on that part of the change. On the one hand, maybe the user really doesn't care about the toolkit, in which case it should be a warning. On the other, maybe they are using a feature that can only work with a particular toolkit, in which case it should be an error.

What I like about your change is the error message, I think


octave:1> graphics_toolkit foo
error: graphics_toolkit: foo is not available. graphics_toolkit not changed


is much better than


octave:1> graphics_toolkit foo
error: feval: function '__init_foo__' not found
error: called from:
error:   /usr/share/octave/3.8.0/m/plot/util/graphics_toolkit.m at line 70, column 5


which doesn't tell an ordinary user anything.

Mike Miller <mtmiller>
Group Member
Fri 17 Jan 2014 05:24:02 AM UTC, comment #2: 

The current behavior is to execute error() with a
message that says the toolkit initialisation failed
due to an undefined reference.  If you like it that
way just recommend not applying this patch. The
intent of the patch is to be more friendly by
explaining that the requested toolkit does not
exist and doing nothing. I could also
have included a message showing the currently available
toolkits (that is what available_graphics_toolkits()
is for) but it is easy for a user to ask that if
needed.

Michael Godfrey <godfrey>
Group Member
Fri 17 Jan 2014 04:23:23 AM UTC, comment #1: 

Yeah, how about changing warning to error and no need for a return? Looks like a good idea to me.

Mike Miller <mtmiller>
Group Member
Fri 17 Jan 2014 04:04:28 AM UTC, original submission:  

Currently, a bad toolkit name causes an error when graphics_toolkit('bad') tries to initialize a toolkit
which does not exist.

It seems better to just warn the user and not change
the toolkit.

Particularly, now that it appears that there will a
considerable period when some systems will have fltk
and some will not, the warning seems more appropriate.

A changeset that implements this change is attached.

Michael Godfrey <godfrey>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #30297:  warn_bad_toolkit.diff added by godfrey (946B - 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 mtmiller (Posted a comment)
  • -email is unavailable- added by godfrey (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-25 mtmiller StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2014-01-17 mtmiller StatusNone Patch Submitted
    2014-01-17 godfrey Attached File- Added warn_bad_toolkit.diff, #30297

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code