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

Submitter:  Hartmut <hardy>
Submitted:  Thu 01 Oct 2015 08:44:21 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 13 May 2018 05:28:57 PM UTC, comment #10: 

As mentioned in comment #9, it is no problem to configure the shortcuts meeting personal preferences. Therefore, I am closing this bug report. Of course, if several shortcuts for the same actions are desired in the future, a new related report can be opened.

Torsten Lilge <ttl>
Group Member
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>
Group 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>
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>
Group 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 Lilge <ttl>
Group 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>
Group 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 Lilge <ttl>
Group 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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by hardy (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-13 ttl StatusNone Wont Fix
        Open/ClosedOpen Closed
    2015-10-18 pantxo Attached File- Added emacs.okb, #35222

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code