From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: [C-u M-q] -> unfill-paragraph Date: Thu, 10 Nov 2011 11:55:56 +0800 Message-ID: <8739dwbpgz.fsf@ericabrahamsen.net> References: <87r51h0zhn.fsf@pobox.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1320897395 29578 80.91.229.12 (10 Nov 2011 03:56:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Nov 2011 03:56:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 10 04:56:31 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ROLkb-0001Id-Fv for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Nov 2011 04:56:29 +0100 Original-Received: from localhost ([::1]:34654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROLka-0000q4-Nx for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Nov 2011 22:56:28 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:44021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROLkW-0000pi-7D for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 22:56:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROLkU-0006zO-S3 for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 22:56:24 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:45512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROLkU-0006zH-H5 for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 22:56:22 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1ROLkT-0001EN-Co for help-gnu-emacs@gnu.org; Thu, 10 Nov 2011 04:56:21 +0100 Original-Received: from 123.115.190.86 ([123.115.190.86]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Nov 2011 04:56:21 +0100 Original-Received: from eric by 123.115.190.86 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Nov 2011 04:56:21 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 58 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 123.115.190.86 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:JL6i2OpJmTa0mZGP87bNE5uePUo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82837 Archived-At: 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 > > -- GNU Emacs 24.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.24.6) of 2011-11-07 on pellet