PR# 18716 Some context menu entries for a feature or cluster treat underscore in name incorrectly

Problem Report Summary
Submitter: prestoat2000
Category: EiffelStudio
Priority: Medium
Date: 2013/10/04
Class: Bug
Severity: Non-critical
Number: 18716
Release: 7.3.92766
Confidential: No
Status: Closed
Responsible:
Environment: Linux on x86 32-bit
Synopsis: Some context menu entries for a feature or cluster treat underscore in name incorrectly

Description
Some of the context menu entries for a feature do not treat an underscore in
the feature name correctly.  They treat it as though it indicated which
character to use when typing a shortcut key sequence, instead of as a
a part of the feature name.  This only seems to happen for features and 
clusters, not for classes.

There is a similar problem with names that contain an underscore in the
Favorite menu (after adding a favorite class or feature), the View/Go To menu
and the Window menu (and maybe there are other places I missed).

I assume this is easy to correct.


To Reproduce
Right-click (or Shift-right-click, if needed) on feature `default_create' in
class ANY.  In the Retarget to Feature menu entry and in
Info->Add Info to Feature and Info->Copy URL of Feature menu entries, the
underscore is placed under the "c" of create, instead of showing up as a
separator between "default" and "create".  So `default_create' is displayed
as `defaultcreate', with "c" underlined.

Similarly, examine the context menu for a cluster named "my_cluster".  Same
problem in the Info menu entries.


Problem Report Interactions
From:manus_eiffel    Date:2014/05/14    Status: Closed    Download   
This is fixed in rev#95062.

From:manus_eiffel    Date:2014/05/14    Download   
We found the reason for the behavior. To create shorcuts for menus, the EiffelVision2 syntax is to use an ampersand before the letter where the shortcut will be, e.g. &File.

However on GTK, the character used for this purpose in the underscore, not the ampersand. As a result, we do an escape of the _ to be __ so that they appear as _ in the menu, but we only do the escape if there is an ampersand. All the menu entries you mentionned do not have an ampersand and the escape is not done.

We are changing the mechanism so that we do the escape whenever there is a _ or a & in the string.

From:prestoat2000    Date:2014/04/15    Download   
Found one more place that treats underscores incorrectly.

The Fix menu item, which shows up when you right click on the Description
in the Inspector Eiffel window (e.g., a "Feature never called" rule violation,
which can be fixed automatically), does not treat underscores in the
feature name correctly.

From:prestoat2000    Date:2014/04/15    Download   
No, it occurs in many places:

View/Go To menu entries.
View/Tools Layout/Open Layout menu entries.
Favorites menu (favorite classes or features with underscore in name).
Window menu (windows showing a class or feature with underscore in name).
Context menu/Retarget to Feature (for context menu on feature)
Context menu/Retarget to Class (for context menu on class)
Context menu/Info/Add Info (for cluster, class and feature)
Context menu/Info/Copy URI (for cluster, class and feature)
Context menu/Run Inspector Eiffel on Class (for context menu on class)

and possibly other places that I didn't find.

This was with 14.05.94787 on Solaris x86.



From:manus_eiffel    Date:2014/04/15    Status: Analyzed    Download   
Can you confirm that it only applies to the menu entries for the Eiffel Information System?