Path: utzoo!utgpu!watserv1!watmath!att!rutgers!aramis.rutgers.edu!paul.rutgers.edu!sparky.rutgers.edu!gaynor From: gaynor@sparky.rutgers.edu (Silver) Newsgroups: comp.emacs Subject: Re: little kill-region hack Message-ID: Date: 31 Aug 90 15:44:36 GMT References: <9008302122.AAgrim01966@grim.ifi.uio.no> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 20 > Good idea, but skip the interactive test. When you use kill-word, > kill-word is called interactively but kill-region is not. This was the idea, to give kill-region some interactive feedback without causing display flutter with all the functions that might use it. > A kill-region-hook seems to be a good idea. Then people can display a > message, or add querys, or whatever. Put (or noninteractive ...) in the > hook; we don't want any bells and whistles in batch mode. Yes, looks like the correct approach. One thing, I had problems implementing a querying hook without signalling an error. (defun kill-region-query () (and (> (- end beg) 100) (not (y-or-n-p (format "Region is %d characters. Kill?" (- beg end)))) (error "Aborted."))) Seems a little tacky, but run-hooks doesn't give you a return value to play with. (Hmm, this message looks familiar; did I send you mail or something?) Regards, [Ag]