I'd like to put something like this in my .emacs:
(local-set-key (kbd "C-c a =")
(lambda () (interactive)
(align-regexp (region-beginning) (region-end) "=")))
But whenever I run it, I get an error "Wrong type argument: numberp, nil".
What does this error mean and how do I get the effect I'm looking for?
Here you are my dear fellow.
(defun align-to-equals (begin end)
"Align region to equal signs"
(interactive "r")
(align-regexp begin end "\\(\\s-*\\)=" 1 1 ))
The (\s-*)
prefix is used internally by align-regexp
From the align.el
(list (concat "\\(\\s-*\\)"
John Wiegley just neglected to document it, and I guess most people just use align-regexp interactively, or just record and save a macro!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With