File: sunpro-keys.el

package info (click to toggle)
xemacs20 20.4-13
  • links: PTS
  • area: main
  • in suites: slink
  • size: 67,324 kB
  • ctags: 57,643
  • sloc: lisp: 586,197; ansic: 184,662; sh: 4,296; asm: 3,179; makefile: 2,021; perl: 1,059; csh: 96; sed: 22
file content (26 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
;;; sunpro-keys.el --- SunPro-specific key bindings

;; Copyright (C) 1993, 1994 Sun Microsystems, Inc

(define-key global-map 'find 'x-isearch-maybe-with-region)

(define-key isearch-mode-map 'f18 'isearch-yank-x-clipboard)
(add-hook 'isearch-mode-hook 'sunpro-set-isearch-direction)
(define-key isearch-mode-map 'f19 'isearch-repeat-forward)

(defun x-isearch-maybe-with-region (&optional backward-p)
  "Enter isearch mode.  If the region is active, find the selected text."
  (interactive "P")
  (let ((sunpro-isearch-direction
	 (if backward-p 'backward 'forward)))
    (if (and zmacs-regions (mark))
	(progn (isearch-mode (not backward-p)) (isearch-yank-x-selection))
      (if backward-p (isearch-backward) (isearch-forward)))))

(defun sunpro-set-isearch-direction ()
  (if (or (eq this-command 'isearch-backward)
	  (eq this-command 'isearch-backward-regexp)
	  (and (boundp 'sunpro-isearch-direction)
	       (eq sunpro-isearch-direction 'backward)))
      (define-key isearch-mode-map 'f19 'isearch-repeat-backward)
    (define-key isearch-mode-map 'f19 'isearch-repeat-forward)))