Line snippet helper for posting code

On the org list there are a few ways that people post code indicate the start and end of that code. This is my version that might work in any mode:

(defun gcr/insert-noticeable-snip-comment-line ()
  "Insert a noticeable snip comment line (NSCL)."
  (if (not (bolp))
      (message "I may only insert a NSCL at the beginning of a line.")
    (let ((ncl (make-string 70 ?✂)))
      (insert ncl)
      (comment-or-uncomment-region (line-beginning-position) (line-end-position)))))

ADDENDUM: 2014-06-22T10:18:59-0500: Added newline first

One thought on “Line snippet helper for posting code”

Leave a Reply

Your email address will not be published. Required fields are marked *