I am trying to pass arguments to the align-regexp function in Emacs (Lisp):
(defun align-on-comment-char ()
(interactive)
(align-regexp (region-beginning) (region-end) "#")
)
I would actually like to do this for all my modes specifically, where for each mode I want to bind an “align to comment character (; for emacs lisp, % for Latex, # for R)”.
What am I missing?
comment-startandcomment-endare the usual variables to get the comment-string for the current mode.You will also need to append some magic to get the matching right when
calling align-regexp. Like Oleg, I had to figure that out the hard way
by looking at the source. The error message here is not really
descriptive and I really consider this worthy of a bug-report or at
least a doc fix.