mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-11 09:22:02 +01:00
a5a651dbb9
Signed-off-by: main <magic_rb@redalder.org>
23 lines
802 B
Org Mode
23 lines
802 B
Org Mode
:PROPERTIES:
|
|
:ID: 50d451b0-eddf-4192-afc4-c505a5bb3b20
|
|
:END:
|
|
#+title: Filling and unfilling paragraphs
|
|
#+filetags: emacs-load
|
|
|
|
# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
|
|
#
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
#+begin_src emacs-lisp
|
|
;;; Stefan Monnier <foo at acm.org>. It is the opposite of fill-paragraph
|
|
(defun unfill-paragraph (&optional region)
|
|
"Takes a multi-line paragraph and makes it into a single line of text."
|
|
(interactive (progn (barf-if-buffer-read-only) '(t)))
|
|
(let ((fill-column (point-max))
|
|
;; This would override `fill-column' if it's an integer.
|
|
(emacs-lisp-docstring-fill-column t))
|
|
(fill-paragraph nil region)))
|
|
|
|
;; Handy key definition
|
|
(define-key global-map "\M-Q" 'unfill-paragraph)
|
|
#+end_src
|