Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Thanks! I was also working on it but struggling with learning the basics of lisp...I tried to set the comment style to align and the call comment-region, but I guess the lisp syntax is wrong..? (defun comment-for-heading (arg) "Comment selected region and move it to center surounded by comment symbols." (setq comment-style 'aligned) (comment-region ((/ fill-column 2) arg)) (setq comment-style 'indent) ) Commented Jul 25, 2018 at 13:37
  • 1
    it is better to use temporary binding with let form instead of setq here. And for comment-region usage -- you didn't provide correct parameters Commented Jul 25, 2018 at 13:53
  • I see.. I used your function and tweaked it a bit.. there was a different result for an even or odd number of characters in the line ;-) Commented Jul 25, 2018 at 14:29
  • I didn't try to make it perfect ;). Your solution most probably has an issue with odd number of characters and c-style comments Commented Jul 25, 2018 at 17:07