1
/*********************/
/*  O r i g i n a l  */
/*********************/

-E : regex search"
-F : fast search"
-r : reverse order (newer first)"
--all : search all notes"
--txt : search text notes only "
--log : search logs only "
--newer-than <days> : useful with --log; search only in files that were modifier in the last <days> days "
--recent    : useful with --log; search only in files that were modified in the last 30 days"
--headings : search only in headings"

/*******************/
/* desired result */
/*******************/

                  -E : regex search"
                  -F : fast search"
                  -r : reverse order (newer first)"
               --all : search all notes"
               --txt : search text notes only "
               --log : search logs only "
 --newer-than <days> : useful with --log; search only in files that were modifier in the last <days> days "
            --recent : useful with --log; search only in files that were modified in the last 30 days"
          --headings : search only in headings"

/****************************************************************/
/*  C-u M-x align-regexp RET \(-[^:]+\s-+:\) RET -1 RET 1 RET n */
/****************************************************************/

                  -E : regex search"
                  -F : fast search"
                  -r : reverse order (newer first)"
               --all : search all notes"
               --txt : search text notes only "
               --log : search logs only "
 --newer-than <days> : useful with --log; search only in files that were modifier in the last <days> days "
     --recent        : useful with --log; search only in files that were modified in the last 30 days"
          --headings : search only in headings"




/****************************************************************/
/*  C-u M-x align-regexp RET \(-[^:]+\s-+\): RET -1 RET 1 RET n */
/****************************************************************/


                  -E : regex search"
                  -F : fast search"
                  -r : reverse order (newer first)"
               --all : search all notes"
               --txt : search text notes only "
               --log : search logs only "
 --newer-than <days> : useful with --log; search only in files that were modifier in the last <days> days "
     --recent   : useful with --log; search only in files that were modified in the last 30 days"
          --headings : search only in headings"

In the first attempt the colon : is inside the capturing group. All colons are aligned with the exception of the line with --recent which has too much space before the colon (actually it's a tab)

I thought I'd rectify this in my second attempt by putting the colon inside the capturing group, but doing so I lost the alignment on :.

Ideas?

Drew
  • 75,699
  • 9
  • 109
  • 225
ychaouche
  • 207
  • 1
  • 7
  • It seems to me that your first attempt is the correct one. I don't know if `align-regexp` can edit the input fields (before adding its own spacing), but if it cannot, then the only solution I can see is to clean up the input before you align. Why is there a tab there and not just a space? – NickD Oct 19 '22 at 17:15

0 Answers0