How to undo fill-paragraph in emacs?

后端 未结 2 507
傲寒
傲寒 2021-02-13 09:40

I have a text file that is pretty long. Any easy way to \"undo\" a M-q (fill-paragraph) on a file that was written and saved a while ago?

For example, I wan

2条回答
  •  悲哀的现实
    2021-02-13 10:09

    Use the following from my .emacs:

    (defun unfill-paragraph ()
      (interactive)
      (let ((fill-column (point-max)))
        (fill-paragraph nil)))
    
    (defun unfill-region ()
      (interactive)
      (let ((fill-column (point-max)))
        (fill-region (region-beginning) (region-end) nil)))
    

    I can't take credit, I googled this years ago.

提交回复
热议问题