all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* unfill (word unwrap) and keybinding syntax
@ 2006-04-08  6:34 B. T. Raven
  2006-04-08 15:35 ` Andreas Röhler
  0 siblings, 1 reply; 2+ messages in thread
From: B. T. Raven @ 2006-04-08  6:34 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: unfill (word unwrap) and keybinding syntax
  2006-04-08  6:34 unfill (word unwrap) and keybinding syntax B. T. Raven
@ 2006-04-08 15:35 ` Andreas Röhler
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Röhler @ 2006-04-08 15:35 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-08 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-08  6:34 unfill (word unwrap) and keybinding syntax B. T. Raven
2006-04-08 15:35 ` Andreas Röhler

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.