all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: Lluís <xscript@gmx.net>
Cc: Uwe Brauer <oub@mat.ucm.es>, emacs-devel@gnu.org
Subject: Re: unfill-paragraph (region) and indentation
Date: Mon, 2 Nov 2009 19:35:53 +0100	[thread overview]
Message-ID: <e01d8a50911021035o2539c2b0q9ccf5846ba5e7cc@mail.gmail.com> (raw)
In-Reply-To: <86bpjkn5y2.wl%lluis@ginnungagap.pc.ac.upc.edu>

On Mon, Nov 2, 2009 at 7:21 PM, Lluís <xscript@gmx.net> wrote:
> `fill-paragraph-or-region' has been conflated with `fill-paragraph' [1] (don't know in which
> version), so your code should be something like:
>
> (defun unfill-paragraph-or-region ()
>  (interactive)
>  (filladapt-mode nil);this is important, because
>                      ;otherwise    the   result  is   distorted  by the
>                      ;filladapt function stuff
>  (let ((fill-column (point-max)))
>    (fill-paragraph nil)
>    (filladapt-mode nil)))              ;on again
>
> Note that this will not work with a region containing multiple paragraphs.

I think I have sent something like those very simple functions below a
couple of times here (they are part of nXhtml):

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Unfilling
;;
;; The idea is from
;;   http://interglacial.com/~sburke/pub/emacs/sburke_dot_emacs.config

;;;###autoload
(defun unfill-paragraph ()
  "Unfill the current paragraph."
  (interactive) (with-unfilling 'fill-paragraph))
;;(defalias 'unwrap-paragraph 'unfill-paragraph)

;;;###autoload
(defun unfill-region ()
  "Unfill the current region."
  (interactive) (with-unfilling 'fill-region))
;;(defalias 'unwrap-region 'unfill-region)

;;;###autoload
(defun unfill-individual-paragraphs ()
  "Unfill individual paragraphs in the current region."
  (interactive) (with-unfilling 'fill-individual-paragraphs))
;;(defalias 'unwrap-individual-paragraphs 'unfill-individual-paragraphs)

(defun with-unfilling (fn)
  "Unfill using the fill function FN."
  (let ((fill-column 10000000)) (call-interactively fn)))




  reply	other threads:[~2009-11-02 18:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 16:45 unfill-paragraph (region) and indentation Uwe Brauer
2009-11-02 18:21 ` Lluís
2009-11-02 18:35   ` Lennart Borgman [this message]
2009-11-03 10:08     ` Uwe Brauer
2009-11-03 20:02 ` Stefan Monnier
2009-11-04  9:43   ` Uwe Brauer
2009-11-04 18:40     ` Stefan Monnier
2009-11-04 23:12       ` Miles Bader
2009-11-06 10:01       ` unfill-paragraph(region) is different in GNU emacs and xemacs (was: unfill-paragraph (region) and indentation, ) Uwe Brauer
2009-11-06 11:44         ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e01d8a50911021035o2539c2b0q9ccf5846ba5e7cc@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=oub@mat.ucm.es \
    --cc=xscript@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.