How to undo fill-paragraph in emacs?

后端 未结 2 604
时光说笑
时光说笑 2021-02-13 09:08

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 09:55

    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.

提交回复
热议问题