]> code.delx.au - gnu-emacs/blobdiff - lisp/isearch-old.el
* faces.el (secondary-selection): Change background to yellow.
[gnu-emacs] / lisp / isearch-old.el
index 57e04fc39566ef9af08f339a4202a52b269b91e3..ee7a1b0447610e07de6ead9af45fc3fadbad55fc 100644 (file)
@@ -1,11 +1,14 @@
-;; Incremental search
+;;; isearch.el --- incremental search commands
+
 ;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
 
+;; Maintainer: FSF
+
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 1, or (at your option)
+;; the Free Software Foundation; either version 2, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; along with GNU Emacs; see the file COPYING.  If not, write to
 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
-;;;###autoload
+;;; Code:
+
 (defvar search-last-string "" "\
 Last string search for by a non-regexp search command.
 This does not include direct calls to the primitive search functions,
 and does not include searches that are aborted.")
 
-;;;###autoload
 (defvar search-last-regexp "" "\
 Last string searched for by a regexp search command.
 This does not include direct calls to the primitive search functions,
 and does not include searches that are aborted.")
 
 
-;;;###autoload
 (defconst search-repeat-char ?\C-s "\
 *Character to repeat incremental search forwards.")
-;;;###autoload
 (defconst search-reverse-char ?\C-r "\
 *Character to repeat incremental search backwards.")
-;;;###autoload
 (defconst search-exit-char ?\C-m "\
 *Character to exit incremental search.")
-;;;###autoload
 (defconst search-delete-char ?\177 "\
 *Character to delete from incremental search string.")
-;;;###autoload
 (defconst search-quote-char ?\C-q "\
 *Character to quote special characters for incremental search.")
-;;;###autoload
 (defconst search-yank-word-char ?\C-w "\
 *Character to pull next word from buffer into search string.")
-;;;###autoload
 (defconst search-yank-line-char ?\C-y "\
 *Character to pull rest of line from buffer into search string.")
-;;;###autoload
 (defconst search-ring-advance-char ?\M-n "\
 *Character to pull next (more recent) search string from the ring of same.")
-;;;###autoload
 (defconst search-ring-retreat-char ?\M-p "\
 *Character to pull previous (older) search string from the ring of same.")
 
-;;;###autoload
 (defconst search-exit-option t "\
 *Non-nil means random control characters terminate incremental search.")
 
-;;;###autoload
 (defvar search-slow-window-lines 1 "\
 *Number of lines in slow search display windows.
 These are the short windows used during incremental search on slow terminals.
 Negative means put the slow search window at the top (normally it's at bottom)
 and the value is minus the number of lines.")
 
-;;;###autoload
 (defvar search-slow-speed 1200 "\
 *Highest terminal speed at which to use \"slow\" style incremental search.
 This is the style where a one-line window is created to show the line
@@ -103,7 +94,6 @@ Each element is a cons cell of the form (STRING . UPPERCASE-FLAG).")
 thing searched for.")
 
 
-;;;###autoload
 (defun isearch-forward ()
   "Do incremental search forward.
 As you type characters, they add to the search string and are found.
@@ -122,36 +112,29 @@ C-g while searching or when search has failed
 C-g when search is successful aborts and moves point to starting point."
   (interactive)
   (isearch t))
-;;;###autoload
 (define-key global-map "\C-s" 'isearch-forward)
 
-;;;###autoload
 (defun isearch-forward-regexp ()
   "Do incremental search forward for regular expression.
 Like ordinary incremental search except that your input
 is treated as a regexp.  See \\[isearch-forward] for more info."
   (interactive)
   (isearch t t))
-;;;###autoload
 (define-key esc-map "\C-s" 'isearch-forward-regexp)
 
-;;;###autoload
 (defun isearch-backward ()
   "Do incremental search backward.
 See \\[isearch-forward] for more information."
   (interactive)
   (isearch nil))
-;;;###autoload
 (define-key global-map "\C-r" 'isearch-backward)
 
-;;;###autoload
 (defun isearch-backward-regexp ()
   "Do incremental search backward for regular expression.
 Like ordinary incremental search except that your input
 is treated as a regexp.  See \\[isearch-forward] for more info."
   (interactive)
   (isearch nil t))
-;;;###autoload
 (define-key esc-map "\C-r" 'isearch-backward-regexp)
 
 
@@ -187,7 +170,7 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
        ;; non-nil means an explicit uppercase letter seen in the input
        (uppercase-flag nil)
        ;; Non-nil means start using a small window
-       ;; if the search moves outside what is currently on the screen.
+       ;; if the search moves outside what is currently on the frame.
        (slow-terminal-mode (and (<= baud-rate search-slow-speed)
                                 (> (window-height)
                                    (* 4 search-slow-window-lines))))
@@ -204,8 +187,8 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
        ;; for moving the cursor back on quitting.
        (opoint (point))
        (inhibit-quit t)  ;Prevent ^G from quitting, so we can read it.
-       ;; The screen we're working on; if this changes, we exit isearch.
-       (screen (if (fboundp 'selected-screen) (selected-screen))))
+       ;; The frame we're working on; if this changes, we exit isearch.
+       (frame (if (fboundp 'selected-frame) (selected-frame))))
           
     (isearch-push-state)
     (save-window-excursion
@@ -246,8 +229,8 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
                  (setq unread-command-char char)
                  (throw 'search-done t))
 
-                ;; If the user switches to a different screen, exit.
-                ((not (eq screen last-event-screen))
+                ;; If the user switches to a different frame, exit.
+                ((not (eq frame last-event-frame))
                  (setq unread-command-char char)
                  (throw 'search-done t))
 
@@ -466,7 +449,7 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
              (setq regexp-search-ring (cons (cons search-string uppercase-flag)
                                            regexp-search-ring)
                    regexp-search-ring-yank-pointer regexp-search-ring)
-             (if (> (length regexp-search-ring) regexp-search-ring-max)
+             (if (> (length regexp-search-ring) search-ring-max)
                  (setcdr (nthcdr (1- search-ring-max) regexp-search-ring) nil)))
          (if (not (member search-string search-ring))
              (progn
@@ -621,3 +604,5 @@ is treated as a regexp.  See \\[isearch-forward] for more info."
     (setq command-history (cons (list function string) command-history))
     ;; Go ahead and search.
     (funcall function string)))
+
+;;; isearch.el ends here