home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!pacbell.com!pacbell!oracle!unrepliable!bounce
- From: wmesard@tofu.oracle.com (Wayne Mesard)
- Newsgroups: gnu.emacs.help
- Subject: Re: Cursor appearing in buffer during interactive command
- Message-ID: <WMESARD.92Jul29125143@tofu.oracle.com>
- Date: 29 Jul 92 20:51:43 GMT
- References: <1992Jul24.212207.17578@advtech.uswest.com>
- Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
- Organization: /home/wmesard/.organization
- Lines: 26
- In-Reply-To: rray@lookout.it.uswc.uswest.com's message of 24 Jul 92 21:22:07 GMT
- Nntp-Posting-Host: tofu.us.oracle.com
- X-Disclaimer: This message was written by an unauthenticated user
- at Oracle Corporation. The opinions expressed are those
- of the user and not necessarily those of Oracle.
-
- rray@lookout.it.uswc.uswest.com (Randy J. Ray) writes:
- > I have a command that goes through a buffer and deletes any line that
- > contains a specified pattern. I used it to delete lines marked with a
- > debugging comment. It has the option of being interactive, where it
- > queries you prior to each delete. When it does this, the cursor is in
- > the minibuffer, at the end of the query. I would like it to be in the
- > buffer, at the point that the search-forward has it at, a la
- > query-replace.
-
- read-char is what you want to know about. As in:
-
- (defun mumble ()
- (interactive)
- (message "query-deleting lines:")
- (let ((inp (read-char)))
- (if (char-equal ?\n inp)
- ...don't do it...
- ...do it...
- ))
-
- BTW, Emacs already has a function called delete-matching-lines (aka
- flush-lines) which sounds like the non-interactive version of your
- function.
- --
- Wayne();
- WMesard@us.Oracle.COM
-