Convert a program to markdown in Emacs lisp

This interactive Emacs lisp function converts the current buffer into markdown format.

(defun markdown ()
  "Convert a C or other program file to markdown"
    (untabify (point-min) (point-max))
    (while (re-search-forward "^" nil t)
      (replace-match "    "))))


Copyright © Ben Bullock 2009-2023. All rights reserved. For comments, questions, and corrections, please email Ben Bullock ( or use the discussion group at Google Groups. / Privacy / Disclaimer