(defun dot () (point)) (defun number-lines () "Number lines from dot to end of buffer. Each line number is right justified in four print spaces, and followed by two spaces. Note, therefore, that files with 10,000 or greater lines will be off a bit starting at line 10,000." (interactive) (setq ln 1) (while (not (eobp)) (progn (if (< ln 10) (insert-string " ") (if (< ln 100) (insert-string " ") (if (< ln 1000) (insert-string " ")))) (insert-string (concat (int-to-string ln) " ")) (setq ln (+ ln 1)) (beginning-of-line) (setq d (dot)) (end-of-line) (message "%s" (buffer-substring d (dot))) (forward-line 1) ) ) ) (defun untabify-buffer () (interactive) (untabify (point-min) (point-max)) ) (defun untabify-buffer-and-save () (interactive) (untabify (point-min) (point-max)) (save-buffer) ) (defun quiet-replace-backslash () (while (not (eobp)) (if (= (following-char) ?\\) (progn (forward-char 1) (insert-string "\\") ) (forward-char 1) ) ) (goto-char (point-min)) ) (defun number-lines-untabify () (interactive) (untabify-buffer) (quiet-replace-backslash) (goto-line (point-min)) (number-lines) )