🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189106

Re: Keypad defs' for EMACS under AT386 terminal type..????

#189106
From: Kevin Gallagher
Date: Thu, 02 May 1991 02:47
52 lines
3157 bytes
In article <43@hlthnt.UUCP> sginn@hlthnt.UUCP (Steve Ginn) writes:
>In article <1991Apr29.204040.14429@jato.jpl.nasa.gov> dave@jato.jpl.nasa.gov (Dave Hayes) writes:
>[stuff deleted]
>   The problem is, let's say you do a search...and then failing to find 
>   anything you want to use the cursor keys. The darn thing eats the ESC
>   character (I think it wants to use that character to signify end of 
>   searching) and then the rest of the keycode shows gleefully up in
>   your edited file. 

You are using isearch-forward/isearch-backward, which are "enter and use
until YOU decide to exit" functions.  And ESC is the isearch exit key!  If you
use search-forward/search-backward, you won't have this problem.  These are
"execute once and exit" functions.  However, you will have to write your own
search-forward-again function that remembers the last search string, so you
don't have to re-enter it each time when doing multiple searches.  Here is part
of the code we use in our emulation of EDT's FIND and FNDNXT commands, as an
example:

(defun edt-find-forward ()
  "Find first occurance of a string in the forward direction and save the string."
  (interactive)
  (set 'search-last-string (read-string "Search forward: "))
  (if (eq (search-forward search-last-string) t) 
      (search-backward search-last-string)))

(defun edt-find-backward ()
  "Find first occurance of a string in the backward direction and save the string."
  (interactive)
  (set 'search-last-string (read-string "Search backward: "))
  (search-backward search-last-string))

(defun edt-find-next-forward ()
  "Find next occurance of a string in forward direction."
  (interactive)
  (forward-char 1)
  (if (eq (search-forward search-last-string nil t) t)
      (search-backward search-last-string)
      (progn
        (backward-char 1)
        (error "Search failed: \"%s\"." search-last-string))))

(defun edt-find-next-backward ()
  "Find next occurance of a string in backward direction."
  (interactive)
  (if (eq (search-backward search-last-string nil t) nil)
      (progn
        (error "Search failed: \"%s\"." search-last-string))))
-- 
----------------------------------------------------------------------------
Kevin Gallagher        kgallagh@digi.lonestar.org OR ...!uunet!digi!kgallagh
DSC Communications Corporation   Addr: MS 152, 1000 Coit Rd, Plano, TX 75075
----------------------------------------------------------------------------
Technical Details
Message-ID: <1991May2.024758.25802@digi.lonestar.org>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!sun-barr!newstop!texsun!digi!kgallagh
References: <1991Apr27.191020.500@vax1.mankato.msus.edu> <1991Apr29.204040.14429@jato.jpl.nasa.gov> <43@hlthnt.UUCP>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,7d961eb936261ec0
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-05-02 19:23:59 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!sun-barr!newstop!texsun!digi!kgallagh
From: kgallagh@digi.lonestar.org (Kevin Gallagher)
Newsgroups: gnu.emacs.help
Subject: Re: Keypad defs' for EMACS under AT386 terminal type..????
Message-ID: <1991May2.024758.25802@digi.lonestar.org>
Date: 2 May 91 02:47:58 GMT
References: <1991Apr27.191020.500@vax1.mankato.msus.edu> <1991Apr29.204040.14429@jato.jpl.nasa.gov> <43@hlthnt.UUCP>
Organization: DSC Communications Corp, Plano, TX
Lines: 52