bugGNU Octave - Bugs: bug #46101, wish: make Ctrl+T a default...

 
 

bug #46101: wish: make Ctrl+T a default keyboard shortcut for un-commenting in the GUI editor

Submitted by:  Hartmut <hardy>
Submitted on:  Thu 01 Oct 2015 08:44:21 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: 4.0.0Operating System: Any

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)

Mon 07 Mar 2016 11:09:34 AM UTC, comment #9:

@Lachlan: My concern is how complicated the underlying code (shortcut_manager, GUI settings ...) can become and can we afford this (recall the time when you had 10th of patches no maintainer found the time to review ...)?
I expect a user to always type the same shortcut for a given action. If the one in place doesn't fit his habits (e.g. because he comes from Matlab) he has a very simple way to change it.

Pantxo Diribarne <pantxo>
Project Member
Wed 02 Mar 2016 09:32:23 AM UTC, comment #8:

I like the idea of the ability to have multiple shortcut combinations doing the same thing.

Instead of saying "what is the shortcut for this feature?", we would be saying "what is the feature for this shortcut?". I haven't checked how shortcuts are implemented, but the natural implementation is to have a lookup table from shortcuts to operations. Why limit it to a one-to-one table? We don't say that having something in the main menu stops it being in a context menu too.

Lachlan Andrew <lachlan>
Project Member
Tue 10 Nov 2015 12:41:13 PM UTC, comment #7:

@Torsten: I forgot to mention that the shortcut file we provide (and load) should be system dependent. Mac base shortcuts are often using META key where Linux/Windows use CTRL. Maybe we should have a naming scheme of the form:

NAME-OS.sc, eg. "octave-mac.sc", "matlab-win.sc", "vi-linux.sc"...

Pantxo Diribarne <pantxo>
Project Member
Sun 08 Nov 2015 02:53:12 PM UTC, comment #6:

I like the idea of providing some typical shortcut files. Changeset http://hg.savannah.gnu.org/hgweb/octave/rev/be130eb147f8
removes the second shortcut set as a first step. Next I will add the combo box for the standard files.

Torsten <ttl>
Project Member
Sun 18 Oct 2015 07:44:21 PM UTC, comment #5:

I agree that having a second shortcut set is not really useful.
Now about having two shortcuts for the same action, how would you document such shortcuts and what is the cost in terms of maintainability of the code?

Why not simply provide a few shortcut sets in the form of settings files (e.g. ML, emacs, vi ...) along with Octave sources? We would let users choose their base shortcut set using a combo box in the preference dialog. I attached a basic tentative emacs shortcut file.

(file #35222)

Pantxo Diribarne <pantxo>
Project Member
Sun 18 Oct 2015 06:07:35 PM UTC, comment #4:

My personal opinion in the proposed discussion:

  • The possibility to save and load shortcut schemes seems very useful to me. But having two sets of shortcuts defined, does NOT add any more value in my opinion.
  • I don't know how common the Ctrl+T shortcut is for swapping lines in other editors. But when I personally do programming, then I NEVER had the wish to swap two lines so far.
Hartmut <hardy>
Wed 14 Oct 2015 04:18:49 PM UTC, comment #3:

Implementing the possibility for a second shortcut might be generally a good idea.
Before thinking about a possible realization I would like to discuss whether the implemented possibility to switch between two sets of shortcuts is really needed, especially since there is the possibility to save and load shortcut schemes.

Concerning the Ctrl+T as default for uncommenting I would ask to consider that several editors use Ctrl+T for swapping lines.

Torsten <ttl>
Project Member
Fri 02 Oct 2015 08:22:30 PM UTC, comment #2:

Yes, the direction of my feature request was to make Ctrl+T a default keyboard shortcut for un-commenting in the editor. People shoudn't need to change anything in the options in order to have this behavior (as discussed in the original post).

But I also wouldn't want to destroy the nice Octave editor behavior, that we have currently (Ctrl+R for commenting, and Ctrl+Shift+R for uncommenting). My suggestion was to have something like this as default in the Octave editor:

  • Ctrl + R = commenting
  • Ctrl + Shift + R = uncommenting
  • Ctrl + T = uncommenting (second way of doing the same thing, for former Matlab users)
  • Ctrl + something else = swap two text lines

It's only now that I realise that the current way of setting the keyboard shortcuts in Octave is NOT able to achieve this :( There is a list of actions in the settings tab, and each action can have (only) ONE keyboard shortcut. So it wouldn't be possible at all (as I suggested) to have TWO shortcuts for the same action (i.e. uncommenting).

This is a pity. But I could understand if noone wants to change the whole way of defining keyboard shortcuts in the settings tab, just to make this small wish happen.

Hartmut <hardy>
Fri 02 Oct 2015 06:12:45 AM UTC, comment #1:

Hi,

It is easy to not notice that shortcuts are configurable in the whole Octave GUI. So just to be sure: your request is that people don't have to change this ctrl+T them selves if they want it as in Matlab?
If so I must say I don't like this change: it is wide spread practice that adding shift modifier undoes what the shift-less shortcut does. In that sense Octave's approach here is more universal than Matlab's.

Pantxo Diribarne <pantxo>
Project Member
Thu 01 Oct 2015 08:44:21 PM UTC, original submission:

This is a feature request (to make the Octave GUI editor more easily used by former Matlab users):

Could we make "Ctrl+T" the default keyboard shortcut for un-commenting in the GUI editor?

Currently the default values in Octave are:

  • Ctrl + R = commenting
  • Ctrl + Shift + R = uncommenting
  • Ctrl + T = swap two text lines

The Matlab keyboard shortcuts in the GUI editor (for commenting) are:

  • Ctrl + R = commenting
  • Ctrl + Shift + R = doesn't do anything
  • Ctrl + T = uncommenting

Making "Ctrl + T" the Octave shortcut for uncommenting would help former Matlab users to quickly use the Octave editor. Commenting and uncommenting is often used (at least by myself) during Octave programming. And an unexpected swapping of two code lines via the trained Ctrl+T movement (instead of the expected uncommenting of the marked code block) can really screw up your code easily.

To not disturbe any adopted Octave users, we could still keep "Ctrl+Shift+R" as a second keyboard shortcut for uncommenting. I myself would not even miss the "swap two lines" feature, but maybe we can just have a new shortcut for it and keep it as well.

Hartmut <hardy>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #35222:  emacs.okb added by pantxo (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by ttl (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by hardy (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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 18 Oct 2015 07:44:21 PM UTCpantxoAttached File-=>Added emacs.okb, #35222

    Back to the top


    Powered by Savane 3.1-cleanup1