home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / gnu / emacs / help / 3563 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.7 KB  |  43 lines

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