Hi!
I really don't like the default behavior of M-) in the LispWorks
editor. So, I tried to write a little function that mimcs Emacs'
behavior; it seems to work fine as far as I can tell, although
the version of `move-past-close-and-reindent' in the Emacs sources
seems to do something more complicated. Here is my version:
(defpackage "MYEDIT"
(:add-use-defaults t)
(:use "EDITOR")
(:export move-past-close-and-reindent-command))
(in-package "MYEDIT")
(defcommand "Move Past Close And Reindent" (p)
"Move past next `)', delete indentation before it, then indent after it.
Prefix argument is ignored."
"Just like Emacs' M-), as God intended."
(declare (ignore p))
(let ((cpoint (current-point)))
(form-offset cpoint 1 t 1)
(forward-character-command -1)
(when (save-excursion
(let* ((before-paren (copy-point cpoint :temporary)))
(back-to-indentation-command nil)
(point= cpoint before-paren)))
(beginning-of-line-command nil)
(delete-previous-character-command nil)
(delete-horizontal-space-command nil)))
(forward-character-command 1)
(new-line-command nil)
(indent-command nil))
Has anybody written a more sophisticated version? If so, please
share :-)
Regards,
--
Nils Goesche
Ask not for whom the <CONTROL-G> tolls.
PGP key ID 0xC66D6E6F