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

📄 x-win.el

📁 windows版本的emacs
💻 EL
📖 第 1 页 / 共 3 页
字号:
		   "light sea green"		   "MediumSeaGreen"		   "medium sea green"		   "SeaGreen"		   "sea green"		   "DarkSeaGreen"		   "dark sea green"		   "DarkOliveGreen"		   "dark olive green"		   "DarkGreen"		   "dark green"		   "aquamarine"		   "MediumAquamarine"		   "medium aquamarine"		   "CadetBlue"		   "cadet blue"		   "LightCyan"		   "light cyan"		   "cyan"		   "turquoise"		   "MediumTurquoise"		   "medium turquoise"		   "DarkTurquoise"		   "dark turquoise"		   "PaleTurquoise"		   "pale turquoise"		   "PowderBlue"		   "powder blue"		   "LightBlue"		   "light blue"		   "LightSteelBlue"		   "light steel blue"		   "SteelBlue"		   "steel blue"		   "LightSkyBlue"		   "light sky blue"		   "SkyBlue"		   "sky blue"		   "DeepSkyBlue"		   "deep sky blue"		   "DodgerBlue"		   "dodger blue"		   "blue"		   "RoyalBlue"		   "royal blue"		   "MediumBlue"		   "medium blue"		   "LightSlateBlue"		   "light slate blue"		   "MediumSlateBlue"		   "medium slate blue"		   "SlateBlue"		   "slate blue"		   "DarkSlateBlue"		   "dark slate blue"		   "CornflowerBlue"		   "cornflower blue"		   "NavyBlue"		   "navy blue"		   "navy"		   "MidnightBlue"		   "midnight blue"		   "LightGray"		   "light gray"		   "LightGrey"		   "light grey"		   "grey"		   "gray"		   "LightSlateGrey"		   "light slate grey"		   "LightSlateGray"		   "light slate gray"		   "SlateGrey"		   "slate grey"		   "SlateGray"		   "slate gray"		   "DimGrey"		   "dim grey"		   "DimGray"		   "dim gray"		   "DarkSlateGrey"		   "dark slate grey"		   "DarkSlateGray"		   "dark slate gray"		   "black"		   "white"		   "MistyRose"		   "misty rose"		   "LavenderBlush"		   "lavender blush"		   "lavender"		   "AliceBlue"		   "alice blue"		   "azure"		   "MintCream"		   "mint cream"		   "honeydew"		   "seashell"		   "LemonChiffon"		   "lemon chiffon"		   "ivory"		   "cornsilk"		   "moccasin"		   "NavajoWhite"		   "navajo white"		   "PeachPuff"		   "peach puff"		   "bisque"		   "BlanchedAlmond"		   "blanched almond"		   "PapayaWhip"		   "papaya whip"		   "AntiqueWhite"		   "antique white"		   "linen"		   "OldLace"		   "old lace"		   "FloralWhite"		   "floral white"		   "gainsboro"		   "WhiteSmoke"		   "white smoke"		   "GhostWhite"		   "ghost white"		   "snow")  "The list of X colors from the `rgb.txt' file.XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")(defun xw-defined-colors (&optional frame)  "Internal function called by `defined-colors', which see."  (or frame (setq frame (selected-frame)))  (let ((all-colors x-colors)	(this-color nil)	(defined-colors nil))    (while all-colors      (setq this-color (car all-colors)	    all-colors (cdr all-colors))      (and (color-supported-p this-color frame t)	   (setq defined-colors (cons this-color defined-colors))))    defined-colors));;;; Function keys(defun iconify-or-deiconify-frame ()  "Iconify the selected frame, or deiconify if it's currently an icon."  (interactive)  (if (eq (cdr (assq 'visibility (frame-parameters))) t)      (iconify-frame)    (make-frame-visible)))(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame			   global-map);; 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]);; These tell read-char how to convert;; these special chars to ASCII.(put 'backspace 'ascii-character 127)(put 'delete 'ascii-character 127)(put 'tab 'ascii-character ?\t)(put 'linefeed 'ascii-character ?\n)(put 'clear 'ascii-character 12)(put 'return 'ascii-character 13)(put 'escape 'ascii-character ?\e)(defun vendor-specific-keysyms (vendor)  "Return the appropriate value of system-key-alist for VENDOR.VENDOR is a string containing the name of the X Server's vendor,as returned by (x-server-vendor)."  (cond ((string-equal vendor "Apollo Computer Inc.")	 '((65280 . linedel)	   (65281 . chardel)	   (65282 . copy)	   (65283 . cut)	   (65284 . paste)	   (65285 . move)	   (65286 . grow)	   (65287 . cmd)	   (65288 . shell)	   (65289 . leftbar)	   (65290 . rightbar)	   (65291 . leftbox)	   (65292 . rightbox)	   (65293 . upbox)	   (65294 . downbox)	   (65295 . pop)	   (65296 . read)	   (65297 . edit)	   (65298 . save)	   (65299 . exit)	   (65300 . repeat)))	((or (string-equal vendor "Hewlett-Packard Incorporated")	     (string-equal vendor "Hewlett-Packard Company"))	 '((  168 . mute-acute)	   (  169 . mute-grave)	   (  170 . mute-asciicircum)	   (  171 . mute-diaeresis)	   (  172 . mute-asciitilde)	   (  175 . lira)	   (  190 . guilder)	   (  252 . block)	   (  256 . longminus)	   (65388 . reset)	   (65389 . system)	   (65390 . user)	   (65391 . clearline)	   (65392 . insertline)	   (65393 . deleteline)	   (65394 . insertchar)	   (65395 . deletechar)	   (65396 . backtab)	   (65397 . kp-backtab)))	((or (string-equal vendor "X11/NeWS - Sun Microsystems Inc.")	     (string-equal vendor "X Consortium"))	 '((392976 . f36)	   (392977 . f37)	   (393056 . req)	   ;; These are for Sun under X11R6	   (393072 . props)	   (393073 . front)	   (393074 . copy)	   (393075 . open)	   (393076 . paste)	   (393077 . cut)))	(t	 ;; This is used by DEC's X server.	 '((65280 . remove)))));;;; Selections and cut buffers;;; We keep track of the last text selected here, so we can check the;;; current selection against it, and avoid passing back our own text;;; from x-cut-buffer-or-selection-value.(defvar x-last-selected-text nil);;; It is said that overlarge strings are slow to put into the cut buffer.;;; Note this value is overridden below.(defvar x-cut-buffer-max 20000  "Max number of characters to put in the cut buffer.")(defcustom x-select-enable-clipboard nil  "Non-nil means cutting and pasting uses the clipboard.This is in addition to, but in preference to, the primary selection."  :type 'boolean  :group 'killing);;; Make TEXT, a string, the primary X selection.;;; Also, set the value of X cut buffer 0, for backward compatibility;;; with older X applications.;;; gildea@stop.mail-abuse.org says it's not desirable to put kills;;; in the clipboard.(defun x-select-text (text &optional push)  ;; Don't send the cut buffer too much text.  ;; It becomes slow, and if really big it causes errors.  (if (< (length text) x-cut-buffer-max)      (x-set-cut-buffer text push)    (x-set-cut-buffer "" push))  (x-set-selection 'PRIMARY text)  (if x-select-enable-clipboard      (x-set-selection 'CLIPBOARD text))  (setq x-last-selected-text text));;; Return the value of the current X selection.;;; Consult the selection, then the cut buffer.  Treat empty strings;;; as if they were unset.;;; If this function is called twice and finds the same text,;;; it returns nil the second time.  This is so that a single;;; selection won't be added to the kill ring over and over.(defun x-cut-buffer-or-selection-value ()  (let (text)    (when x-select-enable-clipboard      (if (null text) 	  (condition-case c	      (setq text (x-get-selection 'CLIPBOARD 'COMPOUND_TEXT))	    (error nil)))      (if (null text) 	  (condition-case c	      (setq text (x-get-selection 'CLIPBOARD 'STRING))	    (error nil)))      (if (string= text "") (setq text nil)))    ;; Don't die if x-get-selection signals an error.    (if (null text) 	(condition-case c	    (setq text (x-get-selection 'PRIMARY 'COMPOUND_TEXT))	  (error nil)))    (if (null text) 	(condition-case c	    (setq text (x-get-selection 'PRIMARY 'STRING))	  (error nil)))    (if (string= text "") (setq text nil))    (or text (setq text (x-get-cut-buffer 0)))    (if (string= text "") (setq text nil))    (cond     ((not text) nil)     ((eq text x-last-selected-text) nil)     ((string= text x-last-selected-text)      ;; Record the newer string, so subsequent calls can use the `eq' test.      (setq x-last-selected-text text)      nil)     (t      (setq x-last-selected-text text)))));;; Do the actual X Windows setup here; the above code just defines;;; functions and variables that we use now.(setq command-line-args (x-handle-args command-line-args));;; Make sure we have a valid resource name.(or (stringp x-resource-name)    (let (i)      (setq x-resource-name (invocation-name))      ;; Change any . or * characters in x-resource-name to hyphens,      ;; so as not to choke when we use it in X resource queries.      (while (setq i (string-match "[.*]" x-resource-name))	(aset x-resource-name i ?-))));; For the benefit of older Emacses (19.27 and earlier) that are sharing;; the same lisp directory, don't pass the third argument unless we seem;; to have the multi-display support.(if (fboundp 'x-close-connection)    (x-open-connection (or x-display-name			   (setq x-display-name (getenv "DISPLAY")))		       x-command-line-resources		       ;; Exit Emacs with fatal error if this fails.		       t)  (x-open-connection (or x-display-name			 (setq x-display-name (getenv "DISPLAY")))		     x-command-line-resources))(setq frame-creation-function 'x-create-frame-with-faces)(setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)			    x-cut-buffer-max))(if (fboundp 'new-fontset)    (progn      ;; Create the standard fontset.      (create-fontset-from-fontset-spec standard-fontset-spec t)      ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...).      (create-fontset-from-x-resource)      ;; Try to create a fontset from a font specification which comes      ;; from initial-frame-alist, default-frame-alist, or X resource.      ;; A font specification in command line argument (i.e. -fn XXXX)      ;; should be already in default-frame-alist as a `font'      ;; parameter.  However, any font specifications in site-start      ;; library, user's init file (.emacs), and default.el are not      ;; yet handled here.      (let ((font (or (cdr (assq 'font initial-frame-alist))		      (cdr (assq 'font default-frame-alist))		      (x-get-resource "font" "Font")))	    xlfd-fields resolved-name)	(if (and font		 (not (query-fontset font))		 (setq resolved-name (x-resolve-font-name font))		 (setq xlfd-fields (x-decompose-font-name font)))	    (if (string= "fontset"			 (aref xlfd-fields xlfd-regexp-registry-subnum))		(new-fontset font (x-complement-fontset-spec xlfd-fields nil))	      ;; Create a fontset from FONT.  The fontset name is	      ;; generated from FONT.	      (create-fontset-from-ascii-font font					      resolved-name "startup"))))));; Sun expects the menu bar cut and paste commands to use the clipboard.;; This has ,? to match both on Sunos and on Solaris.(if (string-match "Sun Microsystems,? Inc\\."		  (x-server-vendor))    (menu-bar-enable-clipboard));; Apply a geometry resource to the initial frame.  Put it at the end;; of the alist, so that anything specified on the command line takes;; precedence.(let* ((res-geometry (x-get-resource "geometry" "Geometry"))       parsed)  (if res-geometry      (progn	(setq parsed (x-parse-geometry res-geometry))	;; If the resource specifies a position,	;; call the position and size "user-specified".	(if (or (assq 'top parsed) (assq 'left parsed))	    (setq parsed (cons '(user-position . t)			       (cons '(user-size . t) parsed))))	;; All geometry parms apply to the initial frame.	(setq initial-frame-alist (append initial-frame-alist parsed))	;; The size parms apply to all frames.	(if (assq 'height parsed)	    (setq default-frame-alist		  (cons (cons 'height (cdr (assq 'height parsed)))			default-frame-alist)))	(if (assq 'width parsed)	    (setq default-frame-alist		  (cons (cons 'width (cdr (assq 'width parsed)))			default-frame-alist))))));; Check the reverseVideo resource.(let ((case-fold-search t))  (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))    (if (and rv	     (string-match "^\\(true\\|yes\\|on\\)$" rv))	(setq default-frame-alist	      (cons '(reverse . t) default-frame-alist)))));; Set x-selection-timeout, measured in milliseconds.(let ((res-selection-timeout       (x-get-resource "selectionTimeout" "SelectionTimeout")))  (setq x-selection-timeout 20000)  (if res-selection-timeout      (setq x-selection-timeout (string-to-number res-selection-timeout))))(defun x-win-suspend-error ()  (error "Suspending an emacs running under X makes no sense"))(add-hook 'suspend-hook 'x-win-suspend-error);;; Arrange for the kill and yank functions to set and check the clipboard.(setq interprogram-cut-function 'x-select-text)(setq interprogram-paste-function 'x-cut-buffer-or-selection-value);;; Turn off window-splitting optimization; X is usually fast enough;;; that this is only annoying.(setq split-window-keep-point t);; Don't show the frame name; that's redundant with X.(setq-default mode-line-frame-identification "  ");;; Motif direct handling of f10 wasn't working right,;;; So temporarily we've turned it off in lwlib-Xm.c;;; and turned the Emacs f10 back on.;;; ;; Motif normally handles f10 itself, so don't try to handle it a second time.;;; (if (featurep 'motif);;;     (global-set-key [f10] 'ignore));;; x-win.el ends here

⌨️ 快捷键说明

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