;;; -*-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
;;;
(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)
(let ((char
(prompt-for-typein
(string-append (search-state-message state) "^Q")
- false
+ #f
keyboard-read)))
(if (char? char)
(isearch-append-char state char)
(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))
(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)
(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)
(search-state-initial-point state)))))
\f
(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)
parent
forward?
regexp?
- true
- false
- false
+ #t
+ #f
+ #f
point
point
point
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)
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
;;; -*-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
(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
(define-variable search-exit-char
"Character to exit incremental search."
- #\altmode
+ #\return
char?)
(define-variable search-delete-char
(define-variable search-exit-option
"True means random control characters terminate incremental search."
- true
+ #t
boolean?)
(define-variable search-slow-speed
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.
(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.
(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.
(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.
(lambda (toggle-case-fold?)
(opposite-case-fold toggle-case-fold?
(lambda ()
- (isearch false true)))))
+ (isearch #f #t)))))
\f
;;;; Character Search
;;; (Courtesy of Jonathan Rees)
(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."
(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")))