Ignore:
Timestamp:
12/04/03 17:22:11 (18 years ago)
Author:
piso
Message:

Clean up incremental find support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/examples/key-pressed.lisp

    r2783 r4970  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: key-pressed.lisp,v 1.4 2003-07-05 02:03:36 piso Exp $
     4;;; $Id: key-pressed.lisp,v 1.5 2003-12-04 17:22:11 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    2828(defcommand open-file-in-other-window)
    2929(defcommand open-file-in-other-frame)
    30 (defcommand new-buffer)
     30;; (defcommand new-buffer)
    3131(defcommand recent-files)
    3232(defcommand save)
     
    3939(defcommand prev-buffer)
    4040(defcommand new-frame)
    41 (defcommand my-execute-command "executeCommand")
    42 (defcommand j-print "print")
     41(defcommand execute-command "executeCommand")
     42;; (defcommand j-print "print")
    4343(defcommand save-all-exit)
    4444(defcommand quit)
     
    6767(defcommand shell)
    6868
     69;;; Incremental find needs special handling.
     70(defun invoke-incremental-find ()
     71  (location-bar-cancel-input)
     72  (restore-focus)
     73  (invoke-later 'incremental-find))
     74
    6975(defvar *table* (make-hash-table :test #'equalp))
    7076
     
    7783  (let* ((key (car args))
    7884         (value (gethash key *table*)))
    79     (cond ((and value (symbolp value))
    80            (funcall (symbol-function value)))
    81           ((functionp value)
    82            (funcall value)))))
     85    (when (and value
     86               (or (functionp value)
     87                   (and (symbolp value) (fboundp value))))
     88      (funcall value))))
    8389
    8490;;; Key assignments.
     
    110116            #'(lambda () (restore-focus) (prev-buffer)))
    111117(assign-key "Ctrl Shift N" 'new-frame)
    112 (assign-key "Alt X" 'my-execute-command)
     118(assign-key "Alt X" 'execute-command)
    113119;; Ctrl P is used for history in textfields.
    114120;; (assign-key "Ctrl P" 'j-print)
     
    117123(assign-key "Ctrl J" 'jump-to-line)
    118124(assign-key "Ctrl Shift J" 'jump-to-column)
    119 (assign-key "Alt F3" 'j-find)
    120 (assign-key "Ctrl F" 'incremental-find)
     125(assign-key "Alt F3"
     126            #'(lambda () (location-bar-cancel-input) (restore-focus) (j-find)))
     127(assign-key "Ctrl F" 'invoke-incremental-find)
    121128(assign-key "Alt L" 'list-occurrences)
    122129(assign-key "F6" 'find-in-files)
Note: See TracChangeset for help on using the changeset viewer.