I'm trying to align

 4000 1 2                 4000  1     2    
  11 1 44          =>     11    1     44   
  1  0000 999             1     0000  999  

as described at http://emacswiki.org/emacs/AlignCommands

However, typing in C-u M-x align-regexp, and accepting all defaults, makes no modifications - my emacs minibuffer is just stuck on Repeat throughout line? (y or n) y and I need to press C-g. Am I using the command incorrectly or is there something wrong with my emacs (emacs version 22.1.1)

  • This is not a solution, but please try to upgrade to the latest stable version (24.5) if you can. Looks like version 22.1.1 is about 7-8 years old! There have been tons of bug fixes and feature enhancements since then. – Kaushal Modi Oct 1 '15 at 4:00
  • Now talking about solution, my emacs is not getting stuck at the final step where you enter y. Can you replicate this problem in an emacs -Q session? Also, running C-u M-x align-regexp with all default values except the last one (y) will not give you the result you are looking for. You will need to modify the first value too.. simply append [0-9]+ to the default regexp. – Kaushal Modi Oct 1 '15 at 4:03
  • Hi. Regarding the version of emacs, unfortunately this is provided to us at work and we don't have root access, but I'll try to see if I can upgrade – Trent Oct 1 '15 at 7:26
  • RE: recreating the 'stuck' issue, I can't recreate it now either! Potentially what was happening was with the default parameters, the input wouldn't change post alignment, so it appeared like it was stalling – Trent Oct 1 '15 at 7:28
  • RE: the regex used to align the numbers, using your suggestion worked except that a space at the beginning of the row was inserted. Does this mean the suggestion on the linked page is wrong? – Trent Oct 1 '15 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.