From 7381e1db199e0f1d35842f32b519f0ebd372a4e8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 3 Mar 2000 14:55:16 +0000 Subject: [PATCH] Change incremental search to terminate on RET rather than ESC, for compatibility with Emacs. --- v7/src/edwin/iserch.scm | 52 ++++++++++++++++++++--------------------- v7/src/edwin/sercom.scm | 26 ++++++++++----------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/v7/src/edwin/iserch.scm b/v7/src/edwin/iserch.scm index fee6615e3..768e13e92 100644 --- a/v7/src/edwin/iserch.scm +++ b/v7/src/edwin/iserch.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: iserch.scm,v 1.22 2000/01/10 03:25:19 cph Exp $ +;;; $Id: iserch.scm,v 1.23 2000/03/03 14:55:05 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; @@ -34,7 +34,7 @@ (with-editor-interrupts-disabled (lambda () (isearch-loop - (initial-search-state false forward? regexp? point))))) + (initial-search-state #f forward? regexp? point))))) clear-message))) (cond ((eq? result 'ABORT) (set-window-point! window point) @@ -61,7 +61,7 @@ (let ((char (prompt-for-typein (string-append (search-state-message state) "^Q") - false + #f keyboard-read))) (if (char? char) (isearch-append-char state char) @@ -74,14 +74,14 @@ (search-state-regexp? state)) (begin (isearch-exit state) - false))) + #f))) ((test-for #\C-g) (editor-beep) (isearch-pop state)) ((test-for (ref-variable search-repeat-char)) - (isearch-continue (search-state-next state true))) + (isearch-continue (search-state-next state #t))) ((test-for (ref-variable search-reverse-char)) - (isearch-continue (search-state-next state false))) + (isearch-continue (search-state-next state #f))) ((test-for (ref-variable search-delete-char)) (isearch-loop (or (search-state-parent state) (editor-error)))) ((test-for (ref-variable search-yank-word-char)) @@ -92,7 +92,7 @@ (isearch-append-string state (extract-rest-of-line (search-state-end-point state)))) - ((char=? char #\return) + ((char=? char #\linefeed) (isearch-append-char state #\newline)) ((or (not (zero? (char-bits char))) (and (ref-variable search-exit-option) @@ -123,7 +123,7 @@ (prompt-for-string/prompt (if forward? "Search" "Search backward") (write-to-string (ref-variable search-last-string)))) - false + #f keyboard-peek))) (cond ((not (char? char)) char) @@ -254,17 +254,17 @@ (search-state-initial-point state))))) (define-structure (search-state) - (text false read-only true) - (parent false read-only true) - (forward? false read-only true) - (regexp? false read-only true) - (successful? false read-only true) - (wrapped? false read-only true) - (invalid-regexp false read-only true) - (start-point false read-only true) - (end-point false read-only true) - (point false read-only true) - (initial-point false read-only true)) + (text #f read-only #t) + (parent #f read-only #t) + (forward? #f read-only #t) + (regexp? #f read-only #t) + (successful? #f read-only #t) + (wrapped? #f read-only #t) + (invalid-regexp #f read-only #t) + (start-point #f read-only #t) + (end-point #f read-only #t) + (point #f read-only #t) + (initial-point #f read-only #t)) (define (most-recent-successful-search-state state) (if (search-state-successful? state) @@ -278,9 +278,9 @@ parent forward? regexp? - true - false - false + #t + #f + #f point point point @@ -292,9 +292,9 @@ parent forward? (search-state-regexp? parent) - false + #f (search-state-wrapped? parent) - false + #f start-point (mark+ start-point (string-length text)) (search-state-point parent) @@ -328,11 +328,11 @@ parent forward? regexp? - true + #t (and (boolean=? forward? (search-state-forward? parent)) (or (search-state-wrapped? parent) (not (search-state-successful? parent)))) - false + #f (re-match-start 0) (re-match-end 0) result diff --git a/v7/src/edwin/sercom.scm b/v7/src/edwin/sercom.scm index 02136eb64..c4e261bac 100644 --- a/v7/src/edwin/sercom.scm +++ b/v7/src/edwin/sercom.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: sercom.scm,v 1.64 1999/01/02 06:11:34 cph Exp $ +;;; $Id: sercom.scm,v 1.65 2000/03/03 14:55:16 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -28,9 +28,9 @@ (define-variable-per-buffer case-fold-search "True if searches should ignore case. Automatically becomes local when set in any fashion. -If given a numeric arguemnt, most of the search commands will toggle +If given a numeric argument, most of the search commands will toggle this variable temporarily." - true + #t boolean?) (define-variable search-last-string @@ -59,7 +59,7 @@ and does not include searches that are aborted." (define-variable search-exit-char "Character to exit incremental search." - #\altmode + #\return char?) (define-variable search-delete-char @@ -84,7 +84,7 @@ and does not include searches that are aborted." (define-variable search-exit-option "True means random control characters terminate incremental search." - true + #t boolean?) (define-variable search-slow-speed @@ -233,7 +233,7 @@ As you type characters, they add to the search string and are found. A numeric argument allows you to toggle case-fold-search but this information is lost whenever you exit search, even if you do a C-s C-s. Type Delete to cancel characters from end of search string. -Type ESC to exit, leaving point at location found. +Type RET to exit, leaving point at location found. Type C-s to search again forward, C-r to search again backward. Type C-w to yank word from buffer onto end of search string and search for it. Type C-y to yank rest of line onto end of search string, etc. @@ -249,7 +249,7 @@ C-g when search is successful aborts and moves point to starting point." (lambda (toggle-case-fold?) (opposite-case-fold toggle-case-fold? (lambda () - (isearch true false))))) + (isearch #t #f))))) (define-command isearch-forward-regexp "Do incremental search forward for regular expression. @@ -259,7 +259,7 @@ is treated as a regexp. See \\[isearch-forward] for more info." (lambda (toggle-case-fold?) (opposite-case-fold toggle-case-fold? (lambda () - (isearch true true))))) + (isearch #t #t))))) (define-command isearch-backward "Do incremental search backward. @@ -268,7 +268,7 @@ See \\[isearch-forward] for more information." (lambda (toggle-case-fold?) (opposite-case-fold toggle-case-fold? (lambda () - (isearch false false))))) + (isearch #f #f))))) (define-command isearch-backward-regexp "Do incremental search backward for regular expression. @@ -278,7 +278,7 @@ is treated as a regexp. See \\[isearch-forward] for more info." (lambda (toggle-case-fold?) (opposite-case-fold toggle-case-fold? (lambda () - (isearch false true))))) + (isearch #f #t))))) ;;;; Character Search ;;; (Courtesy of Jonathan Rees) @@ -295,7 +295,7 @@ Special characters: (lambda (toggle-case-fold?) (opposite-case-fold toggle-case-fold? (lambda () - (character-search true))))) + (character-search #t))))) (define-command char-search-backward "Like \\[char-search-forward], but searches backwards." @@ -303,7 +303,7 @@ Special characters: (lambda (toggle-case-fold?) (opposite-case-fold toggle-case-fold? (lambda () - (character-search false))))) + (character-search #f))))) (define (character-search forward?) (let ((char (prompt-for-char "Character search"))) -- 2.25.1