bugGNU nano - Bugs: bug #56043, [Request] the ability to create a...

 
 

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

bug #56043: [Request] the ability to create a clean-looking itemized list

Submitted by:  Seb <seb5903>
Submitted on:  Sun 31 Mar 2019 03:08:42 PM UTC  
 
Severity:  1 - Wish Status:  Ready For Test
Assigned to:  None Open/Closed:  Open

( Jump to the original submission)

Sat 21 Sep 2019 05:04:58 PM UTC, comment #8: 

The zeroing of the indentation when <Enter> is typed on a blank line, is not a convenient behavior.  And it could cause crashes, for example when trying to undo <Tab><Tab><Enter><Tab><Tab><Enter>.  So the attached updated version of the patch removes this zeroing.

(file #47558)

Benno Schulenberg <bens>
Project Administrator
Wed 18 Sep 2019 07:36:35 PM UTC, comment #7: 

Thanks Benno, this works really well!

Seb <seb5903>
Fri 13 Sep 2019 11:21:00 AM UTC, comment #6: 

Attached patch implements the <Enter><Enter>.  It also allows the itemized lists to be indented: the * or - do not need to at the start of the line.  Please check it out and tell me what you think.

(file #47507)

Benno Schulenberg <bens>
Project Administrator
Wed 03 Apr 2019 11:26:03 AM UTC, comment #5: 

Hi Benno,

I have used your patch several times today for various emails, and indeed your idea of making <Enter><Enter> cancel existing indentation would be quite convenient. If you can spare a little time for this, I'd be grateful.

Thanks!

Seb <seb5903>
Tue 02 Apr 2019 07:14:56 PM UTC, comment #4: 

Thanks Benno for the patch!

I'll leave it to you to decide if this patch should be associated with an option, but I can say this: if somebody comes across the option in man nanorc, she might give it a try and at least know it's there. It's not something you long for unless you've seen it somewhere. There are some options in quite a few programs that I didn't know I needed until I saw them. But then, they became must haves.

Anyway, in my opinion the wish has been granted and the request can be closed. Thanks again!

Seb <seb5903>
Tue 02 Apr 2019 12:30:14 PM UTC, comment #3: 

Ah!  Yes, 2.9.8 improved the detection of paragraphs -- I had forgotten about that.  So, cool, ^J will work on a bulleted list.

For treating ^star-space as ^space-space when autoindent is on, see attached patch.

However, I don't think it is worth adding this patch, because, when --autoindent is on, then it is very little trouble to type <Space><Space> after the first line of the bulleted item, and for the rest of the lines auto-indentation takes over.  Also, when wanting to start a new bullet item, you have to type <Bsp><Bsp> anyway to get rid of the two spaces that the auto-indentation provides.  Or it would require an extra patch to make <Enter><Enter> cancel any existing indentation.

So, all in all, I think it's already easy enough to make an itemized list when using --autoindent, and, after editing an item, ^J can be used without any problem to rejustify it.

(file #46697)

Benno Schulenberg <bens>
Project Administrator
Mon 01 Apr 2019 09:10:24 PM UTC, comment #2: 

Hi Benno,

Thanks for the explanation! I'm wondering though if there could not be a shortcut.

  • When a paragraph is typeset the way I suggested ("* " on the first line, "  " on subsequent lines), ^J already works as expected. I just tested this (nano-4.0 with the two patches you sent me this week-end). It works even if the paragraphs are not separated by a blank line.
  • To typeset a paragraph in this way, the lazy solution could be to type two spaces at the beginning of the first line, use auto-indent, and when the text/mail is finished, to replace the first space by a star.

In light of this, perhaps it would be sufficient for Nano (with the right option in .nanorc) to regard ^\*\s as equivalent to ^\s\s with regard to autoindentation?

Seb.

Seb <seb5903>
Mon 01 Apr 2019 06:43:26 PM UTC, comment #1: 

The hardest (but unmentioned) part of your request is that ^J should respect such an itemized list.

However, if I wanted to make an itemized list with the current nano, I would do the following: switch autoindent on (M-I), type two spaces whenever I start a new item, and when I'm finished, ^Up back to the first item.  Then I would define a macro of the following keystrokes: <Del> <Space> ^J <Ctrl+Up> <Del> * <Ctrl+Down>.  This will justify an item and replace its first space with a star.  When I later edit an item, I can use the same macro to rejustify the item.

Instead of manually recording the macro, one could make a string bind.  It would look like this:

  bind M-5 justify main
  bind M-| "^[[3~ ^[5^[[1;5A^[[3~*^[[1;5B" main

In there, each ^[ is an actual Escape character, 0x1B.  The string can be entered by typing the mentioned series of commands and preceding each keystroke with M-V.  The bind of M-5 is needed, because ^J cannot be entered into a buffer: it is the newline character, it would cut the line in two.

Benno Schulenberg <bens>
Project Administrator
Sun 31 Mar 2019 03:08:42 PM UTC, original submission:  

A long time ago in a memory far, far away, Pine had a nice trick for itemized lists. When one wrote "* " at the beginning of a line, each subsequent new line started with "  " (two spaces) until one created an empty line (by pressing Enter twice). This was visually very appealing.

Would it be possible to add this feature, which would be enabled through an option in .nanorc?

Seb <seb5903>

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by seb5903 (Submitted the item)
  • -email is unavailable- added by seb5903
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-21 bens Attached File- => Added 0001-text-treat-a-star-dash-plus-a-space-as-double-space-.patch, #47558
    2019-09-13 bens Attached File- => Added 0001-text-treat-a-star-plus-a-space-as-a-double-space-whe.patch, #47507
        StatusNone => Ready For Test
    2019-04-02 bens Attached File- => Added 0001-text-treat-star-space-as-space-space-when-auto-inden.patch, #46697
        Summary[Request] the ability to create a clean-looking itemized lists => [Request] the ability to create a clean-looking itemized list
    2019-04-01 bens Severity3 - Normal => 1 - Wish
        Summary[Request] clean-looking itemized lists => [Request] the ability to create a clean-looking itemized lists
    2019-03-31 seb5903 Carbon-Copy- => Added seb@h-k.fr

    Back to the top


    Powered by Savane 3.5