⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x-win.el

📁 windows版本的emacs
💻 EL
📖 第 1 页 / 共 3 页
字号:
;;; x-win.el --- parse switches controlling interface with X window system;; Copyright (C) 1993, 1994, 2001 Free Software Foundation, Inc.;; Author: FSF;; Keywords: terminals;; 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;; the Free Software Foundation; either version 2, or (at your option);; 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.;; 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.;;; Commentary:;; X-win.el:  this file is loaded from ../lisp/startup.el when it recognizes;; that X windows are to be used.  Command line switches are parsed and those;; pertaining to X are processed and removed from the command line.  The;; X display is opened and hooks are set for popping up the initial window.;; startup.el will then examine startup files, and eventually call the hooks;; which create the first window (s).;;; Code:;; These are the standard X switches from the Xt Initialize.c file of;; Release 4.;; Command line		Resource Manager string;; +rv			*reverseVideo;; +synchronous		*synchronous;; -background		*background;; -bd			*borderColor;; -bg			*background;; -bordercolor		*borderColor;; -borderwidth		.borderWidth;; -bw			.borderWidth;; -display		.display;; -fg			*foreground;; -fn			*font;; -font		*font;; -foreground		*foreground;; -geometry		.geometry;; -i			.iconType;; -itype		.iconType;; -iconic		.iconic;; -name		.name;; -reverse		*reverseVideo;; -rv			*reverseVideo;; -selectionTimeout    .selectionTimeout;; -synchronous		*synchronous;; -xrm;; An alist of X options and the function which handles them.  See;; ../startup.el.(if (not (eq window-system 'x))    (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))	 (require 'frame)(require 'mouse)(require 'scroll-bar)(require 'faces)(require 'select)(require 'menu-bar)(if (fboundp 'new-fontset)    (require 'fontset))(defvar x-invocation-args)(defvar x-command-line-resources nil);; Handler for switches of the form "-switch value" or "-switch".(defun x-handle-switch (switch)  (let ((aelt (assoc switch command-line-x-option-alist)))    (if aelt	(let ((param (nth 3 aelt))	      (value (nth 4 aelt)))	  (if value	      (setq default-frame-alist		    (cons (cons param value)			  default-frame-alist))	    (setq default-frame-alist		  (cons (cons param			      (car x-invocation-args))			default-frame-alist)		  x-invocation-args (cdr x-invocation-args)))))));; Handler for switches of the form "-switch n"(defun x-handle-numeric-switch (switch)  (let ((aelt (assoc switch command-line-x-option-alist)))    (if aelt	(let ((param (nth 3 aelt)))	  (setq default-frame-alist		(cons (cons param			    (string-to-int (car x-invocation-args)))		      default-frame-alist)		x-invocation-args		(cdr x-invocation-args))))));; Make -iconic apply only to the initial frame!(defun x-handle-iconic (switch)  (setq initial-frame-alist	(cons '(visibility . icon) initial-frame-alist)));; Handle the -xrm option.(defun x-handle-xrm-switch (switch)  (unless (consp x-invocation-args)    (error "%s: missing argument to `%s' option" (invocation-name) switch))  (setq x-command-line-resources	(if (null x-command-line-resources)	    (car x-invocation-args)	  (concat x-command-line-resources "\n" (car x-invocation-args))))  (setq x-invocation-args (cdr x-invocation-args)));; Handle the geometry option(defun x-handle-geometry (switch)  (let ((geo (x-parse-geometry (car x-invocation-args))))    (setq initial-frame-alist	  (append initial-frame-alist		  (if (or (assq 'left geo) (assq 'top geo))		      '((user-position . t)))		  (if (or (assq 'height geo) (assq 'width geo))		      '((user-size . t)))		  geo)	  x-invocation-args (cdr x-invocation-args))));; Handle the -name option.  Set the variable x-resource-name;; to the option's operand; set the name of;; the initial frame, too.(defun x-handle-name-switch (switch)  (or (consp x-invocation-args)      (error "%s: missing argument to `%s' option" (invocation-name) switch))  (setq x-resource-name (car x-invocation-args)	x-invocation-args (cdr x-invocation-args))  (setq initial-frame-alist (cons (cons 'name x-resource-name)				  initial-frame-alist)))(defvar x-display-name nil  "The X display name specifying server and X frame.")(defun x-handle-display (switch)  (setq x-display-name (car x-invocation-args)	x-invocation-args (cdr x-invocation-args))  ;; Make subshell programs see the same DISPLAY value Emacs really uses.  ;; Note that this isn't completely correct, since Emacs can use  ;; multiple displays.  However, there is no way to tell an already  ;; running subshell which display the user is currently typing on.  (setenv "DISPLAY" x-display-name))(defun x-handle-args (args)  "Process the X-related command line options in ARGS.This is done before the user's startup file is loaded.  They are copied to`x-invocation-args', from which the X-related things are extracted, firstthe switch (e.g., \"-fg\") in the following code, and possible values\(e.g., \"black\") in the option handler code (e.g., x-handle-switch).This function returns ARGS minus the arguments that have been processed."  ;; We use ARGS to accumulate the args that we don't handle here, to return.  (setq x-invocation-args args	args nil)  (while (and x-invocation-args	      (not (equal (car x-invocation-args) "--")))    (let* ((this-switch (car x-invocation-args))	   (orig-this-switch this-switch)	   completion argval aelt handler)      (setq x-invocation-args (cdr x-invocation-args))      ;; Check for long options with attached arguments      ;; and separate out the attached option argument into argval.      (if (string-match "^--[^=]*=" this-switch)	  (setq argval (substring this-switch (match-end 0))		this-switch (substring this-switch 0 (1- (match-end 0)))))      ;; Complete names of long options.      (if (string-match "^--" this-switch)	  (progn	    (setq completion (try-completion this-switch command-line-x-option-alist))	    (if (eq completion t)		;; Exact match for long option.		nil	      (if (stringp completion)		  (let ((elt (assoc completion command-line-x-option-alist)))		    ;; Check for abbreviated long option.		    (or elt			(error "Option `%s' is ambiguous" this-switch))		    (setq this-switch completion))))))      (setq aelt (assoc this-switch command-line-x-option-alist))      (if aelt (setq handler (nth 2 aelt)))      (if handler	  (if argval	      (let ((x-invocation-args		     (cons argval x-invocation-args)))		(funcall handler this-switch))	    (funcall handler this-switch))	(setq args (cons orig-this-switch args)))))  (nconc (nreverse args) x-invocation-args));;;; Standard X cursor shapes, courtesy of Mr. Fox, who wanted ALL of them.;;(defconst x-pointer-X-cursor 0)(defconst x-pointer-arrow 2)(defconst x-pointer-based-arrow-down 4)(defconst x-pointer-based-arrow-up 6)(defconst x-pointer-boat 8)(defconst x-pointer-bogosity 10)(defconst x-pointer-bottom-left-corner 12)(defconst x-pointer-bottom-right-corner 14)(defconst x-pointer-bottom-side 16)(defconst x-pointer-bottom-tee 18)(defconst x-pointer-box-spiral 20)(defconst x-pointer-center-ptr 22)(defconst x-pointer-circle 24)(defconst x-pointer-clock 26)(defconst x-pointer-coffee-mug 28)(defconst x-pointer-cross 30)(defconst x-pointer-cross-reverse 32)(defconst x-pointer-crosshair 34)(defconst x-pointer-diamond-cross 36)(defconst x-pointer-dot 38)(defconst x-pointer-dotbox 40)(defconst x-pointer-double-arrow 42)(defconst x-pointer-draft-large 44)(defconst x-pointer-draft-small 46)(defconst x-pointer-draped-box 48)(defconst x-pointer-exchange 50)(defconst x-pointer-fleur 52)(defconst x-pointer-gobbler 54)(defconst x-pointer-gumby 56)(defconst x-pointer-hand1 58)(defconst x-pointer-hand2 60)(defconst x-pointer-heart 62)(defconst x-pointer-icon 64)(defconst x-pointer-iron-cross 66)(defconst x-pointer-left-ptr 68)(defconst x-pointer-left-side 70)(defconst x-pointer-left-tee 72)(defconst x-pointer-leftbutton 74)(defconst x-pointer-ll-angle 76)(defconst x-pointer-lr-angle 78)(defconst x-pointer-man 80)(defconst x-pointer-middlebutton 82)(defconst x-pointer-mouse 84)(defconst x-pointer-pencil 86)(defconst x-pointer-pirate 88)(defconst x-pointer-plus 90)(defconst x-pointer-question-arrow 92)(defconst x-pointer-right-ptr 94)(defconst x-pointer-right-side 96)(defconst x-pointer-right-tee 98)(defconst x-pointer-rightbutton 100)(defconst x-pointer-rtl-logo 102)(defconst x-pointer-sailboat 104)(defconst x-pointer-sb-down-arrow 106)(defconst x-pointer-sb-h-double-arrow 108)(defconst x-pointer-sb-left-arrow 110)(defconst x-pointer-sb-right-arrow 112)(defconst x-pointer-sb-up-arrow 114)(defconst x-pointer-sb-v-double-arrow 116)(defconst x-pointer-shuttle 118)(defconst x-pointer-sizing 120)(defconst x-pointer-spider 122)(defconst x-pointer-spraycan 124)(defconst x-pointer-star 126)(defconst x-pointer-target 128)(defconst x-pointer-tcross 130)(defconst x-pointer-top-left-arrow 132)(defconst x-pointer-top-left-corner 134)(defconst x-pointer-top-right-corner 136)(defconst x-pointer-top-side 138)(defconst x-pointer-top-tee 140)(defconst x-pointer-trek 142)(defconst x-pointer-ul-angle 144)(defconst x-pointer-umbrella 146)(defconst x-pointer-ur-angle 148)(defconst x-pointer-watch 150)(defconst x-pointer-xterm 152);;;; Available colors;;(defvar x-colors '("LightGreen"		   "light green"		   "DarkRed"		   "dark red"		   "DarkMagenta"		   "dark magenta"		   "DarkCyan"		   "dark cyan"		   "DarkBlue"		   "dark blue"		   "DarkGray"		   "dark gray"		   "DarkGrey"		   "dark grey"		   "grey100"		   "gray100"		   "grey99"		   "gray99"		   "grey98"		   "gray98"		   "grey97"		   "gray97"		   "grey96"		   "gray96"		   "grey95"		   "gray95"		   "grey94"		   "gray94"		   "grey93"		   "gray93"		   "grey92"		   "gray92"		   "grey91"		   "gray91"		   "grey90"		   "gray90"		   "grey89"		   "gray89"		   "grey88"		   "gray88"		   "grey87"		   "gray87"		   "grey86"		   "gray86"		   "grey85"		   "gray85"		   "grey84"		   "gray84"		   "grey83"		   "gray83"		   "grey82"		   "gray82"		   "grey81"		   "gray81"		   "grey80"		   "gray80"		   "grey79"		   "gray79"		   "grey78"		   "gray78"		   "grey77"		   "gray77"		   "grey76"		   "gray76"		   "grey75"		   "gray75"		   "grey74"		   "gray74"		   "grey73"		   "gray73"		   "grey72"		   "gray72"		   "grey71"		   "gray71"		   "grey70"		   "gray70"		   "grey69"		   "gray69"		   "grey68"		   "gray68"		   "grey67"		   "gray67"		   "grey66"		   "gray66"		   "grey65"		   "gray65"		   "grey64"		   "gray64"		   "grey63"		   "gray63"		   "grey62"		   "gray62"		   "grey61"		   "gray61"		   "grey60"		   "gray60"		   "grey59"		   "gray59"		   "grey58"		   "gray58"		   "grey57"		   "gray57"		   "grey56"		   "gray56"		   "grey55"		   "gray55"		   "grey54"		   "gray54"		   "grey53"		   "gray53"		   "grey52"		   "gray52"		   "grey51"		   "gray51"		   "grey50"		   "gray50"		   "grey49"		   "gray49"		   "grey48"		   "gray48"		   "grey47"		   "gray47"		   "grey46"		   "gray46"		   "grey45"		   "gray45"		   "grey44"		   "gray44"		   "grey43"		   "gray43"		   "grey42"		   "gray42"		   "grey41"		   "gray41"		   "grey40"		   "gray40"		   "grey39"		   "gray39"		   "grey38"		   "gray38"		   "grey37"		   "gray37"		   "grey36"		   "gray36"		   "grey35"		   "gray35"		   "grey34"		   "gray34"		   "grey33"		   "gray33"		   "grey32"		   "gray32"		   "grey31"		   "gray31"		   "grey30"		   "gray30"		   "grey29"		   "gray29"		   "grey28"		   "gray28"		   "grey27"		   "gray27"		   "grey26"		   "gray26"		   "grey25"		   "gray25"		   "grey24"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -