home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / emacs / 3598 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  3.6 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!west.West.Sun.COM!cronkite.Central.Sun.COM!texsun!digi!kgallagh
  2. From: kgallagh@digi.lonestar.org (Kevin Gallagher)
  3. Newsgroups: comp.emacs
  4. Subject: Re: repetetive search with function keys
  5. Message-ID: <1992Nov23.000647.3309@digi.lonestar.org>
  6. Date: 23 Nov 92 00:06:47 GMT
  7. References: <1992Nov20.235319.8477@cs.odu.edu> <1992Nov21.183024.19520@umbc3.umbc.edu>
  8. Distribution: usa
  9. Organization: DSC Communications Corp, Plano, TX
  10. Lines: 58
  11.  
  12. In article <1992Nov21.183024.19520@umbc3.umbc.edu> steibel@venus.cs.umbc.edu (David M. Steibel) writes:
  13. >sastr_a@ptah.cs.odu.edu (RAVI AYYALASOMAYAJULA) writes:
  14. >
  15. >> My question is how do I make my fuction key search repetitively search
  16. >> for the search the same string?
  17. >
  18. >You would want to bind it to isearch-forward, and isearch-backwards.
  19.  
  20. The function "isearch-backward" does not have an "s" at the end of the name.
  21.  
  22. >Note that isearch-forward is sometimes already bound to control-s,
  23. >except when control-s is used for flow control purposes.  Sometimes
  24. >isearch-forward is bound to control-backslash also.
  25.  
  26. This particular "binding" is usually accomplished via the keyboard translate
  27. table, not by re-binding isearch-forward to C-\.  (See the GNU Emacs Lisp
  28. Reference Manual, Edition 1.03, for more information on the use of translate
  29. tables.) 
  30.  
  31. >[stuff deleted]
  32. >control-d ends the process, as does moving around with the
  33. >cursor keys.
  34.  
  35. This is sometimes NOT true.  Actually, the default character used to end an
  36. isearch is ESC, which is specified in the variable "search-exit-char".
  37. Control-d usually works as an exit character because the variable
  38. "search-exit-option" is set to "t", by default, meaning "random control
  39. characters terminate incremental search".  No doubt your arrow keys generate
  40. control characters, none of which mean anything special to isearch, so isearch
  41. treats it as random and exits when one of them is pressed.  However, if you
  42. are using a VT100 terminal, the arrow keys generate escape sequences like
  43. ESC-OA, yielding unexpected results.  For example, pressing the up-arrow key
  44. will exit isearch with the first character ESC, but then the characters OA
  45. will be entered into the buffer; not exactly what the user had in mind!
  46.  
  47. On the other hand, if GNU Emacs were installed at your site with the variable
  48. search-exit-char set to C-d, then the arrow keys on a VT100 will NOT exit
  49. isearch at all.  Isearch will try to search for them, instead.
  50.  
  51. >Also, if you have finished your search string, and wish to find the second
  52. >occurance of your search string, press the isearch key again.
  53.  
  54. If you rebind isearch-forward to something other than C-s, pressing this new
  55. key to search again will NOT work unless you have set the variable
  56. "search-repeat-char" to the character generated by the new key used to invoke
  57. isearch-forward.  Unfortunately, setting this variable to more than a single
  58. character is NOT supported within the isearch-forward function.  This means,
  59. if you bind isearch-forward to a function key that generates a
  60. multiple-character sequence, you cannot use that same function key to repeat
  61. the search for the same string (without getting inside and hacking the
  62. isearch-forward code).  (By the way, the corresponding repeat variable for
  63. isearch-backward is search-reverse-char.)
  64.  
  65. -- 
  66. ----------------------------------------------------------------------------
  67. Kevin Gallagher        kgallagh@digi.lonestar.org OR ...!uunet!digi!kgallagh
  68. DSC Communications Corporation   Addr: MS 152, 1000 Coit Rd, Plano, TX 75075
  69. ----------------------------------------------------------------------------
  70.