Path: utzoo!mnetor!uunet!husc6!ukma!rutgers!mtune!codas!killer!pollux!ti-csl!home!ekberg From: ekberg@home.csc.ti.com (Tom Ekberg) Newsgroups: comp.emacs Subject: Re: fixing a file Message-ID: <39749@ti-csl.CSNET> Date: 11 Jan 88 16:15:24 GMT References: <21226@yale-celray.yale.UUCP> Sender: news@ti-csl.CSNET Lines: 33 in article <21226@yale-celray.yale.UUCP>, (Ashwin Ram) says: > I have a related query. When typing in auto-fill-mode, words that run > beyond the right edge of the window are wrapped around AFTER you've finished > typing the entire word. Is there any way to have them wrap down to the next > line as soon as you type the (right-edge + 1)'th character? I.e., is there > any way, when typing Brian's example, to avoid seeing the "para/ > graph" > phenomenon even temporarily, but instead having "parag" wrapped around as > soon as you type the "g"? > How about the following functions? The first one is a substitute for the self-insert-command function and the second one sets up the global map to use it. It worked fine for me in my simple test case. The only thing I'm not sure of is what to do about the other keymaps which contain the self-insert-command symbol. To try it out, just evaluate (or byte-compile and load) the two functions, and enter (setup-global-map) into a lisp listener. (defun insert-self-anything (count) (interactive "p") (if (and (>= (current-column) fill-column) auto-fill-hook) (do-auto-fill)) (self-insert-command count)) (defun setup-global-map () (let ((index 0) (global-map-length (length global-map))) (while (< index global-map-length) (if (eq (aref global-map index) 'self-insert-command) (aset global-map index 'insert-self-anything)) (setq index (1+ index))))) -- tom (aisle C-4L), EKBERG%TI-CSL@CSNET-RELAY, TI-CSL!EKBERG@IM4U.UUCP