I want to have a quick way of writing a heading in an arbitrary file. So in Emacs-lisp mode the selction of Heading
in a file and a call of the function would result in:
;;;;;;;;;;;;;;;;;;;; Heading ;;;;;;;;;;;;;;;;;;;;
I.e. automatically filling the rest of the line with the comment symbol of the respective mode and the text being centered, surrounded by a space and the comment symbols. I am almost sure there is something alike, somewhere?
Edit:
Okay I found the file newcomment.el, which defines comment-styles
such as plain, indent, aligned, box
etc. Where aligned
should be what I am asking for. But how can I get it running?
M-x center-line
centers one or more lines of text, but without adding the comment chars.