help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unfill (word unwrap) and keybinding syntax


From: B. T. Raven
Subject: unfill (word unwrap) and keybinding syntax
Date: Sat, 08 Apr 2006 06:34:26 GMT

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]