Since I would like to use a font that does not align well when using align functions, I figured that I could alter the font type prior to aligning the text.
So, I do not want to change what happens to text that is selected, but I want to edit selected text to alter the font at that time, allowing to use align.
(defun set-font-and-align ()
(change font type of the selected text)
(align-regexp)
)
Any ideas?
After some work, this is what I came up with:
(overlay-put (make-overlay (region-beginning) (region-end)) 'face '(:family "Monospace"))This changes the font of the text in the region to Monospace. Similarly, it is possible to add
:boldamong other things.Here is it in action: I use it for marking the paragraph, followed by assigning a monospace font, and then aligning on both
&and\\.