Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version nyu B notes v1.5 12/10/84; site acf8.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!cmcl2!acf8!schwrtze From: schwrtze@acf8.UUCP (E. Schwartz group) Newsgroups: net.emacs Subject: An el hack for GNUemacs Message-ID: <7750001@acf8.UUCP> Date: Tue, 10-Dec-85 19:07:00 EST Article-I.D.: acf8.7750001 Posted: Tue Dec 10 19:07:00 1985 Date-Received: Thu, 12-Dec-85 05:24:09 EST Organization: New York University Lines: 33 Heres an el hack I know you will like.... The doc. sez it all but basically it does what vi's delete to char does except this works forward and backwards on reg expers. A count implies a skip. If I have disobeyed el style and semantics, be charitable since this is my first hack ( please tell me though). I like to map it to ^Xt and then u get prompted for the string. Enjoy, Hedley Rainnie. (hedley@alaya) cmcl2!alaya!hedley ------ (define-key ctl-x-map "t" 'del-to) (defun del-to(arg) "deletes characters from dot upto|downto the character before|after the prompted Upto|Downto string. Provided of course the string exists. Undo will work for those deletes which go bezerk. Upto is the default Downto can be selected by a neg ARG. ARG specifies the number of matches that will be passed over." (interactive "P") (let ((x (dot))(aval)(y (read-string (if (< (prefix-numeric-value arg) 0) "Downto: " "Upto: ") ))) (setq aval (prefix-numeric-value arg)) (if (< (prefix-numeric-value arg) 0) (progn (re-search-backward y (dot-min) t (- aval)) (forward-char (length y))) (progn (re-search-forward y (dot-max) t aval) (forward-char (- 0 (length y))))) (delete-region x (dot))))