all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: [C-u M-q] -> unfill-paragraph
Date: Thu, 10 Nov 2011 11:55:56 +0800	[thread overview]
Message-ID: <8739dwbpgz.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87r51h0zhn.fsf@pobox.com

On Thu, Nov 10 2011, Tom Roche wrote:

> I'm running
>
> $ lsb_release -ds
> Linux Mint Debian Edition # Update Pack 3
> $ uname -rv
> 2.6.39-2-amd64 #1 SMP Tue Jul 5 02:51:22 UTC 2011
> $ emacs --version
> GNU Emacs 23.3.1
>
> on which M-q "runs the command fill-paragraph". Therefore ISTM
> C-u M-q should run the command unfill-paragraph ... but it does not.
> How to accomplish that? I tried

First of all, on my setup (emacs 24) there's no `unfill-paragraph'
command, are you sure you've got one? I had to make my own.

Your basic problem is that C-u is a prefix argument: ie, it's used to
feed a numerical argument (specifically, 4) to whatever command you call
next. You can't actually bind it as part of a key sequence to call a
specific command. Prefix keys have to be defined specially, and C-u
isn't.

In order for a command to change its behavior in the presence of a
prefix argument, the function definition itself has to look for the
argument and handle it. A function that doesn't handle it just ignores
it. In this case, `fill-paragraph' does handle a prefix argument, but
takes it to mean that you want to justify the paragraph.

You would have to rewrite the function definition to make it treat a
prefix argument differently. Even then, you wouldn't bind any new
function to C-u M-q, you'd just call `fill-paragraph' with a prefix
argument (which is the key combination C-u M-q), and the function would
behave differently.

So, provided you actually have an `unfill-paragraph' command, you'll
have to bind it to some other key (like C-M-q).

Sure hope that makes sense,

Eric

> - (define-key global-map "\C-u\M-q" 'unfill-paragraph)
>
> but that fails with error=
>
> - Lisp error: (error "Key sequence C-u M-q starts with non-prefix key C-u")
>
> Apologies if this is a FAQ: feel free to send links to RTFM.
>
> TIA, Tom Roche <Tom_Roche@pobox.com>
>
>

-- 
GNU Emacs 24.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.24.6)
 of 2011-11-07 on pellet




  reply	other threads:[~2011-11-10  3:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 21:15 [C-u M-q] -> unfill-paragraph Tom Roche
2011-11-10  3:55 ` Eric Abrahamsen [this message]
2011-11-10 17:29 ` Tom Roche
2011-11-10 19:00   ` Scott Frazer
2011-11-13  1:50   ` Tom Roche
2011-11-13 15:52   ` Tom Roche
2011-11-14  3:44     ` Eric Abrahamsen
2011-11-14 17:27   ` Tom Roche

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=8739dwbpgz.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /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.