(defun add-spaces (&optional num) "Add spaces until the line has num spaces" (interactive "p") (if (<= num 1) (setq num 70)) (end-of-line) (while (> num (- (line-end-position) (line-beginning-position))) (insert " ")) (beginning-of-line))