;;; 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, 2005 Free Software Foundation, Inc.
;; Author: FSF
;; Keywords: terminals, i18n
;; 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:
(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))))))
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)
(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))