I've encountered a problem with repeating Macros multiple times. For example, starting with the following lines: void FunctionFoo1(int x); void FunctionFoo2(int x); . . . Define a macro that outputs the following from the first line: void FunctionFoo1(int x) { FunctionFoo1(4); } The cursor should be placed at the beginning of the next line, i.e. at the beginning of "void FunctionFoo2(int x);". But if a window scroll occurs then the cursor is positioned somewhere in the middle of the next line. This will cause the macro to output incorrect results if repeated, e.g. C-2-0-x e. ****************************** In GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600) of 2011-03-10 on 3249CTO Windowing system distributor `Microsoft Corp.', version 6.1.7600 configured using `configure --with-gcc (4.5) --no-opt --cflags -Ic:/imagesupport/include' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU value of $XMODIFIERS: nil locale-coding-system: cp1252 default enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x k C-x k C-x k C-x k C-SPC C-w C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-y C-x ` 1 C-x 1 C-x ( C-SPC M-f C-w C-y C-e { SPC SPC SPC SPC C-y ( 4 ) ; } C-x ) C-x e C-x e ; C-x C-s Recent messages: Unable to load color "systeminfotext" Unable to load color "systeminfowindow" Unable to load color "systeminfotext" Unable to load color "systeminfowindow" Unable to load color "systeminfotext" Unable to load color "systeminfowindow" Unable to load color "systeminfotext" Undo! [2 times] Saving file c:/Saryangat/Downloads/emacs-23.3-bin-i386/emacs-23.3/bin/temp2.cs... Wrote c:/Saryangat/Downloads/emacs-23.3-bin-i386/emacs-23.3/bin/temp2.cs Load-path shadows: None found. Features: (shadow sort mail-extr message ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug help-fns apropos dabbrev repeat help-mode easymenu view edmacro kmacro dired regexp-opt tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process multi-tty emacs)*** E-Mail body has been placed on clipboard, please paste it here! *** ==================== This email/fax message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution of this email/fax is prohibited. If you are not the intended recipient, please destroy all paper and electronic copies of the original message.