1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00
emacs/lisp/term/sun.el

169 lines
5.6 KiB
EmacsLisp
Raw Normal View History

1997-04-20 07:33:52 +00:00
;;; sun.el --- keybinding for standard default sunterm keys
2005-08-01 15:47:19 +00:00
;; Copyright (C) 1987, 2001, 2002, 2003, 2004,
2007-01-21 03:53:13 +00:00
;; 2005, 2006, 2007 Free Software Foundation, Inc.
1996-01-14 09:58:28 +00:00
;; Author: Jeff Peck <peck@sun.com>
;; Keywords: terminals
1996-01-14 09:58:28 +00:00
;; 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
2007-07-25 04:24:43 +00:00
;; the Free Software Foundation; either version 3, or (at your option)
1996-01-14 09:58:28 +00:00
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
1991-12-20 08:24:06 +00:00
1996-01-14 09:58:28 +00:00
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
2005-07-04 16:49:24 +00:00
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
1991-12-20 08:24:06 +00:00
;;; Commentary:
1991-12-20 08:24:06 +00:00
;; The function key sequences for the console have been converted for
;; use with function-key-map, but the *tool stuff hasn't been touched.
;;; Code:
1991-12-20 08:24:06 +00:00
(defun scroll-down-in-place (n)
(interactive "p")
(forward-line (- n))
1991-12-20 08:24:06 +00:00
(scroll-down n))
(defun scroll-up-in-place (n)
(interactive "p")
(forward-line n)
1991-12-20 08:24:06 +00:00
(scroll-up n))
(defun kill-region-and-unmark (beg end)
"Like kill-region, but pops the mark [which equals point, anyway.]"
(interactive "r")
(kill-region beg end)
(setq this-command 'kill-region-and-unmark)
(set-mark-command t))
(defun select-previous-complex-command ()
"Select Previous-complex-command"
(interactive)
(if (zerop (minibuffer-depth))
(repeat-complex-command 1)
;; FIXME: this function does not seem to exist. -stef'01
1991-12-20 08:24:06 +00:00
(previous-complex-command 1)))
(defun rerun-prev-command ()
"Repeat Previous-complex-command."
(interactive)
(eval (nth 0 command-history)))
(defvar grep-arg nil "Default arg for RE-search")
(defun grep-arg ()
(if (memq last-command '(research-forward research-backward)) grep-arg
(let* ((command (car command-history))
(command-name (symbol-name (car command)))
(search-arg (car (cdr command)))
2003-02-04 13:30:45 +00:00
(search-command
1991-12-20 08:24:06 +00:00
(and command-name (string-match "search" command-name)))
)
(if (and search-command (stringp search-arg)) (setq grep-arg search-arg)
2003-02-04 13:30:45 +00:00
(setq search-command this-command
1991-12-20 08:24:06 +00:00
grep-arg (read-string "REsearch: " grep-arg)
this-command search-command)
grep-arg))))
(defun research-forward ()
"Repeat RE search forward."
(interactive)
(re-search-forward (grep-arg)))
(defun research-backward ()
"Repeat RE search backward."
(interactive)
(re-search-backward (grep-arg)))
;;
;; handle sun's extra function keys
;; this version for those who run with standard .ttyswrc and no emacstool
;;
2003-02-04 13:30:45 +00:00
;; sunview picks up expose and open on the way UP,
;; so we ignore them on the way down
;;
1991-12-20 08:24:06 +00:00
(defvar sun-raw-prefix (make-sparse-keymap))
1991-12-20 08:24:06 +00:00
;; Since .emacs gets loaded before this file, a hook is supplied
;; for you to put your own bindings in.
1991-12-20 08:24:06 +00:00
1992-01-15 21:36:18 +00:00
(defvar sun-raw-prefix-hooks nil
"List of forms to evaluate after setting sun-raw-prefix.")
1991-12-20 08:24:06 +00:00
(defun terminal-init-sun ()
"Terminal initialization function for sun."
Fix semantics of terminal-local variables. Remove `terminal-local-value' hack. * src/data.c (do_symval_forwarding, store_symval_forwarding) (find_symbol_value): Use the selected frame's keyboard, not current_kboard. * src/data.c (Fterminal_local_value, Fset_terminal_local_value): Disable these functions. * src/data.c (syms_of_data): Don't defsubr them. * lisp/edmacro.el (edmacro-format-keys): Remove terminal-local-value calls. * lisp/emulation/cua-base.el (cua--pre-command-handler-1): Ditto. * lisp/international/encoded-kb.el (encoded-kbd-setup-display): Ditto. * lisp/isearch.el (isearch-other-meta-char): Ditto. * lisp/obsolete/keyswap.el (the-table): Ditto. * lisp/simple.el (normal-erase-is-backspace-mode): Ditto. * lisp/subr.el (keyboard-translate, read-quoted-char): Ditto. * lisp/term/AT386.el (terminal-init-AT386): Ditto. * lisp/term/internal.el: Ditto. * lisp/term/iris-ansi.el (terminal-init-iris-ansi): Ditto. * lisp/term/lk201.el (terminal-init-lk201): Ditto. * lisp/term/mac-win.el: Ditto. * lisp/term/news.el (terminal-init-news): Ditto. * lisp/term/rxvt.el (terminal-init-rxvt): Ditto. * lisp/term/sun.el (terminal-init-sun): Ditto. * lisp/term/tvi970.el (terminal-init-tvi970): Ditto. * lisp/term/vt200.el (terminal-init-vt200): Ditto. * lisp/term/vt201.el (terminal-init-vt201): Ditto. * lisp/term/vt220.el (terminal-init-vt220): Ditto. * lisp/term/vt240.el (terminal-init-vt240): Ditto. * lisp/term/vt300.el (terminal-init-vt300): Ditto. * lisp/term/vt320.el (terminal-init-vt320): Ditto. * lisp/term/vt400.el (terminal-init-vt400): Ditto. * lisp/term/vt420.el (terminal-init-vt420): Ditto. * lisp/term/wyse50.el (terminal-init-wyse50): Ditto. * lisp/term/x-win.el (x-setup-function-keys): Ditto. * lisp/term/xterm.el (terminal-init-xterm): Ditto. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-434
2005-10-29 11:50:12 +00:00
(define-key local-function-key-map "\e[" sun-raw-prefix)
(define-key sun-raw-prefix "210z" [r3])
(define-key sun-raw-prefix "213z" [r6])
(define-key sun-raw-prefix "214z" [r7])
(define-key sun-raw-prefix "216z" [r9])
(define-key sun-raw-prefix "218z" [r11])
(define-key sun-raw-prefix "220z" [r13])
(define-key sun-raw-prefix "222z" [r15])
(define-key sun-raw-prefix "193z" [redo])
(define-key sun-raw-prefix "194z" [props])
(define-key sun-raw-prefix "195z" [undo])
;; (define-key sun-raw-prefix "196z" 'ignore) ; Expose-down
;; (define-key sun-raw-prefix "197z" [put])
;; (define-key sun-raw-prefix "198z" 'ignore) ; Open-down
;; (define-key sun-raw-prefix "199z" [get])
(define-key sun-raw-prefix "200z" [find])
;; (define-key sun-raw-prefix "201z" 'kill-region-and-unmark) ; Delete
(define-key sun-raw-prefix "224z" [f1])
(define-key sun-raw-prefix "225z" [f2])
(define-key sun-raw-prefix "226z" [f3])
(define-key sun-raw-prefix "227z" [f4])
(define-key sun-raw-prefix "228z" [f5])
(define-key sun-raw-prefix "229z" [f6])
(define-key sun-raw-prefix "230z" [f7])
(define-key sun-raw-prefix "231z" [f8])
(define-key sun-raw-prefix "232z" [f9])
(define-key sun-raw-prefix "233z" [f10])
(define-key sun-raw-prefix "234z" [f11])
(define-key sun-raw-prefix "235z" [f12])
(define-key sun-raw-prefix "A" [up]) ; R8
(define-key sun-raw-prefix "B" [down]) ; R14
(define-key sun-raw-prefix "C" [right]) ; R12
(define-key sun-raw-prefix "D" [left]) ; R10
(global-set-key [r3] 'backward-page)
(global-set-key [r6] 'forward-page)
(global-set-key [r7] 'beginning-of-buffer)
(global-set-key [r9] 'scroll-down)
(global-set-key [r11] 'recenter)
(global-set-key [r13] 'end-of-buffer)
(global-set-key [r15] 'scroll-up)
(global-set-key [redo] 'redraw-display) ;FIXME: collides with default.
(global-set-key [props] 'list-buffers)
(global-set-key [put] 'sun-select-region)
(global-set-key [get] 'sun-yank-selection)
(global-set-key [find] 'exchange-point-and-mark)
(global-set-key [f3] 'scroll-down-in-place)
(global-set-key [f4] 'scroll-up-in-place)
(global-set-key [f6] 'shrink-window)
(global-set-key [f7] 'enlarge-window)
(when sun-raw-prefix-hooks
(message "sun-raw-prefix-hooks is obsolete! Use term-setup-hook instead!")
(let ((hooks sun-raw-prefix-hooks))
(while hooks
(eval (car hooks))
2007-09-21 03:55:20 +00:00
(setq hooks (cdr hooks))))))
2003-09-01 15:45:59 +00:00
;;; arch-tag: db761d47-fd7d-42b4-aae1-04fa116b6ba6
;;; sun.el ends here