Olaf Dietrich <[EMAIL PROTECTED]>: > Kevin Rodgers <[EMAIL PROTECTED]>: >> Olaf Dietrich wrote: >>> >>> Inserting a new line break in an existing line by "r <Return>" >>> (more exactly: replacing the current character by a newline) >>> does not work; instead, '^M' appears as replacement text. >>> >> The version of viper-cmd.el distributed with Emacs 21.3 has this snippet >> in the viper-replace-char-subr function: >> >> (if (eq char ?\C-m) (setq char ?\n)) > > This line is in my viper-cmd.el as well:
I've just played a little bit with viper-cmd.el; the original function is | (defun viper-replace-char-subr (com arg) | (let ((inhibit-quit t) | char) | (viper-set-complex-command-for-undo) | (or (eq viper-intermediate-command 'viper-repeat) | (viper-special-read-and-insert-char)) | | (if (eq char ?\C-m) (setq char ?\n)) | | (delete-char 1 t) | | (setq char (if com viper-d-char (viper-char-at-pos 'backward))) | (if com (insert char)) | | (setq viper-d-char char) | | (viper-loop (1- (if (> arg 0) arg (- arg))) | (delete-char 1 t) | (insert char)) | | (viper-adjust-undo) | (backward-char arg) | )) Since I have never work with (emacs) lisp before, I don't know whether my attempts made any sense, but if I (simple enough) changed e.g. "(delete-char 1 t)" to "(delete-char 3 t)" than 3 instead of 1 character were replaced by a single new one. But I wasn't able to find out whether the line | (if (eq char ?\C-m) (setq char ?\n)) is executed at all. Adding something like "(insert ?A)" inserted an additional "A", but I wasn't able to change char by e.g. "(setq char ?A)". Any ideas what to try next? Olaf _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs