bugGNU nano - Bugs: bug #58709, [Wish] let M-Bsp delete a word...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58709: [Wish] let M-Bsp delete a word backwards

Submitter:  Axel Scheepers <ascheepe>
Submitted:  Sun 05 Jul 2020 05:08:03 PM UTC
   
 
Severity:  1 - Wish Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Thu 13 Aug 2020 05:03:53 AM UTC, comment #6: 

Released in 5.1.  I've already come to like it.  :)

Benno Schulenberg <bens>
Group administrator
Fri 31 Jul 2020 04:56:35 PM UTC, comment #5: 

Added M-Bsp in git, commit 40b03162.

Benno Schulenberg <bens>
Group administrator
Sun 19 Jul 2020 11:10:21 AM UTC, comment #4: 

Oh that's nice, thank you!

Axel Scheepers <ascheepe>
Sat 18 Jul 2020 09:53:17 AM UTC, comment #3: 

I'm keeping this open, because now that I know that <Alt+Bsp> works in bash, it is too compelling to not have it in nano too.  Also because I can't think of anything else that would be a nice function for <Alt+Bsp>.

On my laptop, <Del> sits above <Bsp>, so it is jarring that <Alt+Del> and <Alt+Bsp> won't do opposite things.  But on a full keyboard, <Del> sits below <Ins>, and <Alt+Del> and <Alt+Ins> do very different things (in current git).  <Bsp> sits a bit to the left of <Ins>, so there it is less of a problem that <Alt+Bsp> is not similar in function to <Alt+Del>.

So... I think I will apply the patch anyway.  But not just yet: I don't want to drown it in the news for 5.0.

Benno Schulenberg <bens>
Group administrator
Mon 06 Jul 2020 02:40:02 PM UTC, comment #2: 

Ah yes, i tried to patch it myself but couldn't make it work (i omitted the CONTROL_SHIFT_DELETE part). I understand the reasoning behind not wanting to add it. My reasoning was that it would fit with ctrl-a and ctrl-e. The backspace key is a source for problems on unix systems indeed so maybe it's best to leave it as it is. Thanks for taking the time to explain.

Axel Scheepers <ascheepe>
Mon 06 Jul 2020 09:43:37 AM UTC, comment #1: 

I never knew that Alt+Bsp on the command line deletes a word backwards...  I was going to ask: what manual mentions this, because searching for Backspace doesn't find it.  But I finally found it in: info bash command bindable "commands for killing".  There it says:

'backward-kill-word (M-<DEL>)' Kill the word behind point.

(Fifteen lines up, they call the Backspace key "Rubout" instead of "DEL".  Pfff.  How is one to know what to search for?)

Anyway, as https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts#Text_editing shows, the common shortcuts for deleting a word backwards and forwards are  <Ctrl+Backspace> and <Ctrl+Delete>.  <Alt+Backspace> is an alternative keystroke only in Emacs.

Also https://defkey.com/what-means/ctrl-backspace and https://defkey.com/what-means/ctrl-del show that the Ctrl combinations with Bsp and Del are the most common for deleting words.  https://defkey.com/what-means/alt-backspace mentions Alt+Bsp only for the Atom editor.

As sample.nanorc says, <Ctrl+Backspace> cannot be bound by default to the 'chopwordleft' function because ^H needs to do a backspace by default.  But if you don't use ^H and you're not on a BSD console nor on a terminal emulator where the bare Backspace key produces ^H, then you can 'bind ^H chopwordleft main' to make <Ctrl+Backspace> delete a word backwards.

I don't want to make <Alt+Backspace> delete a word backwards because it doesn't fit with <Alt+Delete> which deletes the whole current line.

But... if you still want the binding, the patch is attached.

(file #49440)

Benno Schulenberg <bens>
Group administrator
Sun 05 Jul 2020 05:08:03 PM UTC, original submission:  

It would be nice if nano supported esc-backspace to delete a word backwards. Like in the shell and emacs.

Axel Scheepers <ascheepe>

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Updated the item)
  • -email is unavailable- added by ascheepe (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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-13 bens Open/ClosedOpen Closed
    2020-07-31 bens StatusNone Fixed
        Assigned toNone bens
    2020-07-06 bens Attached File- Added 0001-bindings-make-Alt-Backspace-delete-a-word-backwards.patch, #49440
        Severity3 - Normal 1 - Wish
        Summary[request] make M-BS delete word backwards [Wish] let M-Bsp delete a word backwards

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code