Inverse of M-q, an unfill-paragraph-function

前端 未结 4 2305
渐次进展
渐次进展 2020-12-30 01:48

Is there an inverse for M-q, some kind of unfill-paragraph-function?

If I have undo data, then it\'s of course easy. What I am asking for is

4条回答
  •  盖世英雄少女心
    2020-12-30 02:16

    Here's the answer. In short:

    (defun unfill-paragraph ()
      "Replace newline chars in current paragraph by single spaces.
    This command does the reverse of `fill-paragraph'."
      (interactive)
      (let ((fill-column 90002000))
        (fill-paragraph nil)))
    
    (defun unfill-region (start end)
      "Replace newline chars in region by single spaces.
    This command does the reverse of `fill-region'."
      (interactive "r")
      (let ((fill-column 90002000))
        (fill-region start end))) 
    

    Update: I've packaged this up here and it can be installed from Marmalade or Melpa.

提交回复
热议问题