unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Andreas Röhler" <andreas.roehler@online.de>
Subject: Re: unfill (word unwrap) and keybinding syntax
Date: Sat, 08 Apr 2006 17:35:33 +0200	[thread overview]
Message-ID: <e18l4f$52g$1@online.de> (raw)
In-Reply-To: SPIZf.1780$Es3.1700@newsread3.news.atl.earthlink.net

B. T. Raven wrote:

> These are similar to Stefan Monnier's unfill-paragraph from the
> emacswiki but use someone's magic number (maxint?) instead of
> point-max. The first one works both with M-x and with the
> binding "C-xM-q" but the second only with M-x. When I try to
> use the string format on the second one, elisp reports an
> error. How can I use the super key in this context? Another
> assignment that I have made works ok:
> 
> (global-set-key [(super g)] 'goto-line) ;; no assigned keychord
> in ver. 21.3 - M-g-g in 22.0 I think
> 
> What is the most general and fool-proof syntax to use in
> keybindings?
> 
> 
> (defun remove-hard-wrap () ;; bound to C-x M-q
>   "Do the opposite of fill-paragraph; stuff all lines in the
>   current
> paragraph into a single long line."
>   (interactive)
>   (let ((fill-column 90002000))
>     (fill-paragraph nil)))
> 
> (defun remove-hard-wrap-region () ;; bound to C-x s-q ???? bad
> syntax
>   "Do the opposite of fill-region; stuff all paragraphs in the
>   current
> region into long lines."
>   (interactive)
>   (let ((fill-column 90002000))
>     (fill-region (point) (mark))))
> 
> (global-set-key "\C-x\M-q" 'remove-hard-wrap)
> (global-set-key "\C-x\s-q"  'remove-hard-wrap-region) ;; this
> can't be evaluated
> 
> 
> 
> Thanks,
> Ed

with GNU Emacs 22.0.50.2 (i686-pc-linux-gnu, X toolkit, Xaw3d
scroll bars)

the following works:

(global-set-key [(control x)(super g)] 'remove-hard-wrap-region)


Andreas Roehler

PS.: Super key is a super idea! Thanks.

      reply	other threads:[~2006-04-08 15:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-08  6:34 unfill (word unwrap) and keybinding syntax B. T. Raven
2006-04-08 15:35 ` Andreas Röhler [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='e18l4f$52g$1@online.de' \
    --to=andreas.roehler@online.de \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).