X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/85dc59a9ff65aaf6b8e6a0c4452f74b7dade88fd..cd0cf71c4f41023a8d9c20b3a26e44b980992b5a:/lisp/term/x-win.el diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index aa0d1fa09c..af168eb23a 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -1,6 +1,7 @@ ;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit;-*- -;; Copyright (C) 1993, 1994, 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, +;; 2005 Free Software Foundation, Inc. ;; Author: FSF ;; Keywords: terminals, i18n @@ -19,8 +20,8 @@ ;; 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 -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -59,8 +60,6 @@ ;; -font *font ;; -foreground *foreground ;; -geometry .geometry -;; -i .iconType -;; -itype .iconType ;; -iconic .iconic ;; -name .name ;; -reverse *reverseVideo @@ -86,6 +85,10 @@ (require 'server) (defvar x-invocation-args) +(defvar x-keysym-table) +(defvar x-selection-timeout) +(defvar x-session-id) +(defvar x-session-previous-id) (defvar x-command-line-resources nil) @@ -112,7 +115,7 @@ (let ((param (nth 3 aelt))) (setq default-frame-alist (cons (cons param - (string-to-int (car x-invocation-args))) + (string-to-number (car x-invocation-args))) default-frame-alist) x-invocation-args (cdr x-invocation-args)))))) @@ -1167,24 +1170,26 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") ;;;; Function keys -;; Map certain keypad keys into ASCII characters -;; that people usually expect. -(define-key function-key-map [backspace] [127]) -(define-key function-key-map [delete] [127]) -(define-key function-key-map [tab] [?\t]) -(define-key function-key-map [linefeed] [?\n]) -(define-key function-key-map [clear] [?\C-l]) -(define-key function-key-map [return] [?\C-m]) -(define-key function-key-map [escape] [?\e]) -(define-key function-key-map [M-backspace] [?\M-\d]) -(define-key function-key-map [M-delete] [?\M-\d]) -(define-key function-key-map [M-tab] [?\M-\t]) -(define-key function-key-map [M-linefeed] [?\M-\n]) -(define-key function-key-map [M-clear] [?\M-\C-l]) -(define-key function-key-map [M-return] [?\M-\C-m]) -(define-key function-key-map [M-escape] [?\M-\e]) -(define-key function-key-map [iso-lefttab] [backtab]) -(define-key function-key-map [S-iso-lefttab] [backtab]) +(defun x-setup-function-keys (frame) + "Set up `function-key-map' on FRAME for the X window system." + ;; Map certain keypad keys into ASCII characters that people usually expect. + (with-selected-frame frame + (define-key local-function-key-map [backspace] [127]) + (define-key local-function-key-map [delete] [127]) + (define-key local-function-key-map [tab] [?\t]) + (define-key local-function-key-map [linefeed] [?\n]) + (define-key local-function-key-map [clear] [?\C-l]) + (define-key local-function-key-map [return] [?\C-m]) + (define-key local-function-key-map [escape] [?\e]) + (define-key local-function-key-map [M-backspace] [?\M-\d]) + (define-key local-function-key-map [M-delete] [?\M-\d]) + (define-key local-function-key-map [M-tab] [?\M-\t]) + (define-key local-function-key-map [M-linefeed] [?\M-\n]) + (define-key local-function-key-map [M-clear] [?\M-\C-l]) + (define-key local-function-key-map [M-return] [?\M-\C-m]) + (define-key local-function-key-map [M-escape] [?\M-\e]) + (define-key local-function-key-map [iso-lefttab] [backtab]) + (define-key local-function-key-map [S-iso-lefttab] [backtab]))) ;; These tell read-char how to convert ;; these special chars to ASCII. @@ -1508,6 +1513,36 @@ as returned by `x-server-vendor'." (#x5f1 . ?,Gq(B) (#x5f2 . ?,Gr(B) ;; Cyrillic + (#x680 . ?$,1)R(B) + (#x681 . ?$,1)V(B) + (#x682 . ?$,1)Z(B) + (#x683 . ?$,1)\(B) + (#x684 . ?$,1)b(B) + (#x685 . ?$,1)n(B) + (#x686 . ?$,1)p(B) + (#x687 . ?$,1)r(B) + (#x688 . ?$,1)v(B) + (#x689 . ?$,1)x(B) + (#x68a . ?$,1)z(B) + (#x68c . ?$,1*8(B) + (#x68d . ?$,1*B(B) + (#x68e . ?$,1*H(B) + (#x68f . ?$,1*N(B) + (#x690 . ?$,1)S(B) + (#x691 . ?$,1)W(B) + (#x692 . ?$,1)[(B) + (#x693 . ?$,1)](B) + (#x694 . ?$,1)c(B) + (#x695 . ?$,1)o(B) + (#x696 . ?$,1)q(B) + (#x697 . ?$,1)s(B) + (#x698 . ?$,1)w(B) + (#x699 . ?$,1)y(B) + (#x69a . ?$,1){(B) + (#x69c . ?$,1*9(B) + (#x69d . ?$,1*C(B) + (#x69e . ?$,1*I(B) + (#x69f . ?$,1*O(B) (#x6a1 . ?,Lr(B) (#x6a2 . ?,Ls(B) (#x6a3 . ?,Lq(B) @@ -2187,6 +2222,11 @@ order until succeed.") ctext utf8))))) +;; Get a selection value of type TYPE by calling x-get-selection with +;; an appropiate DATA-TYPE argument decidd by `x-select-request-type'. +;; The return value is already decoded. If x-get-selection causes an +;; error, this function return nil. + (defun x-selection-value (type) (let (text) (cond ((null x-select-request-type) @@ -2241,7 +2281,7 @@ order until succeed.") (if text (remove-text-properties 0 (length text) '(foreign-selection nil) text)) text)) - + ;;; Return the value of the current X selection. ;;; Consult the selection, and the cut buffer. Treat empty strings ;;; as if they were unset. @@ -2341,10 +2381,7 @@ order until succeed.") (defun x-clipboard-yank () "Insert the clipboard contents, or the last stretch of killed text." (interactive) - (let ((clipboard-text - (condition-case nil - (x-get-selection 'CLIPBOARD) - (error nil))) + (let ((clipboard-text (x-selection-value 'CLIPBOARD)) (x-select-enable-clipboard t)) (if (and clipboard-text (> (length clipboard-text) 0)) (kill-new clipboard-text))