Guest User

Untitled

a guest
Jun 22nd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. (defun wrap-or-unwrap-region (start end &optional arg)
  2. "Without prefix arg: unfill region.
  3. With prefix arg: fill region."
  4. (interactive "rP")
  5. (save-excursion
  6. (if arg
  7. (fill-region start end)
  8. (let ((temp-fill-column fill-column))
  9. (setq fill-column 10000) ; TODO: find a better value
  10. (fill-region start end)
  11. (setq fill-column temp-fill-column)))))
  12.  
  13. (defun wrap-or-unwrap-buffer (&optional arg)
  14. "Without prefix arg: unfill buffer.
  15. With prefix arg: fill buffer."
  16. (interactive "P")
  17. (wrap-or-unwrap-region (point-min) (point-max) arg))
Add Comment
Please, Sign In to add comment