[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unfill (word unwrap) and keybinding syntax
From: |
Andreas Röhler |
Subject: |
Re: unfill (word unwrap) and keybinding syntax |
Date: |
Sat, 08 Apr 2006 17:35:33 +0200 |
User-agent: |
KNode/0.9.2 |
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.