Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
;;; The .emacs.el file of Gary T. Leavens
;;;
;;; Last updated on $Date: 2007/08/16 21:30:22 $
;;;
;;; Feel free to browse, copy, and tweak as desired.
;;; I try to make these sensible for anyone to just use,
;;; but of course I offer no warranty on anything here.
;;; If you're new to emacs type the escape key, then x,
;;; then help-with-tutorial and then the return key.
;;; That is: M-x help-with-tutorial RET
;;; Files mentioned below are found in "~/emacs", "~/unsup/emacs",
;;; or "c:/cygwin/usr/unsup/emacs".
;;; This means if you're looking for leavens's files,
;;; they are in ~leavens/emacs. For example, for user leavens,
;;; (load "mode-customizations") loads the file whose source is in
;;; ~leavens/emacs/mode-customizations.el
;;;
(setq load-path
(cons "~/emacs"
(append load-path
(list (if (eq system-type 'windows-nt)
"c:/cygwin/usr/unsup/emacs"
"~/unsup/emacs")))))
;;; My file for Emacs customizations (which I don't like in my .emacs.el file)
(setq custom-file "~/emacs/customizations.el")
(load custom-file t)
;;; Load my emacs-lisp files from the directory ~/emacs/ (see above).
;;; If these don't exist, they are silently ignored,
;;; because of the `t' at the end of the load command
;;;
;; Customization of various emacs modes
(load "mode-customizations" t)
;; Other commands of mine (these don't take effect unless invoked)
(load "my-commands" t)
;; Customizations for the local system, varies between HP, Vincent etc...
(load "local-customization" t)
;; Allow undo of scrolling by M-x unscroll
(load "unscroll" t)
;; Set up edit menu for end-of-line conversions
(load "eol-conversion" t)
;; Allow for demonstration frames
(load "demo-frame" t)
;; Are we running XEmacs or Emacs?
(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
;; Turn on font-lock mode for Emacs
(cond ((not running-xemacs) (global-font-lock-mode t)))
;; Enable wheelmouse support by default
(if (not running-xemacs)
(if (or (> emacs-major-version 20)
(and (= emacs-major-version 20) (>= emacs-minor-version 7)))
(require 'mwheel)) ; Emacs
(mwheel-install) ; XEmacs
)
;;; Disabling commands and key bindings (disaster prevention)
;;; The following disable key sequences that can cause
;;; big or unnoticed mistakes
(put 'zap-to-char 'disabled t) ; M-z
(put 'rmail-edit-current-message 'disabled 't)
(global-unset-key "\C-x\C-u") ; C-x C-u (upcase-region) vs. C-x u (undo)
(global-unset-key "\C-x\C-l") ; downcase of region can be disaster
(global-unset-key "\C-xf") ; can use set-fill-column explicitly
;;; I don't use emacs to change directories, just to get to files
(setq find-file-run-dired nil) ; never run dired
;;; it's safer to not allow local variable lists to take effect automatically
(setq enable-local-variables 'query)
;;; Setting new commands and key bindings (make it do what I want)
;;; Make backspace (BS) work as most people expect (thanks to Bob Glickstein)
;;;
; make BS delete characters backwards, just like DEL
(global-set-key "\C-h" 'backward-delete-char-untabify)
; put help on M-? (i.e., ESC ?)
(global-set-key "\M-?" 'help-command)
;;; Function key binding, the \M-O ones come from Kermit in emacs mode...
;;;
(global-set-key "\M-OP" 'help)
(global-set-key [f2] 'goto-line)
(global-set-key "\M-OQ" 'goto-line)
(global-set-key [f3] 'begin)
(global-set-key "\M-OR" 'begin)
(global-set-key "\M-OA" 'previous-line)
(global-set-key "\M-OB" 'next-line)
(global-set-key "\M-OC" 'forward-char)
(global-set-key "\M-OD" 'backward-char)
;;; Keys from my keyboard when using kermit that's not in emacs mode (:-(
;;;
(global-set-key "\M-[A" 'previous-line)
(global-set-key "\M-[B" 'next-line)
(global-set-key "\M-[C" 'forward-char)
(global-set-key "\M-[D" 'backward-char)
;;; key bindings that are useful especially for flow control (ISN, telnet),
;;; which sometimes eats all the C-s and C-q chars,
;;; and which I can live with all the time anyway.
;;;
(global-set-key "\C-\\" 'isearch-forward)
(global-set-key "\C-^" 'quoted-insert)
(global-set-key "\M-s" 'isearch-forward-regexp)
(define-key isearch-mode-map "\C-\\" 'isearch-repeat-forward)
(define-key isearch-mode-map "\C-^" 'isearch-quote-char)
(if (< emacs-major-version 22)
(progn
;; Make emacs more like standard windows applications in terms of
;; mouse selections (this is similar to pc-select).
;; One advantage is this is that it makes Dragon Dictate work with Emacs.
(require 'cua)
;; Make the behavior of emacs on C-c, C-v, C-x, and C-z to be
;; just like that of be as in standard window apps, so you can use
;; these keys to copy, paste, and select when there is a selection
;; active, then uncomment the following.
(CUA-mode t)
;; Make C-c leave the region active, which is what happens under Windows.
(setq CUA-mode-keep-region-after-copy t)
)
;; The same for emacs version 22 (and hopefully higher...)
(progn
(cua-mode)
(setq cua-enable-cua-keys t)
(setq cua-mode-keep-region-after-copy t)
)
)
;;; Compensate for Emacs that is used through Kermit.
(load "dragondictate" t)
;;; Other customizations
;;; The following is important for the Windows file system,
;;; which uses ~ at the end of a name to control long file names!
;;; I use it also under Unix, so that sharing files on Windows works...
(setq version-control t)
;;; Preserve links of files when editing
;;;
(setq backup-by-copying-when-linked 't)
;;; Make ~ backup files even when using RCS or SCCS
;;;
(setq vc-make-backup-files 't)
;;; Make files always end in a newline
;;;
(setq require-final-newline 't)
;;; Mode-line customization
;;;
; I don't want constantly check my email, so make it look like there's no mail
(setq display-time-mail-file ".non-existent-file")
; I like to know what day it is...
(setq display-time-day-and-date t)
; display the time in the mode-line
(display-time)
;;; Inhibit the splash screen when starting emacs
(setq inhibit-splash-screen t)
;;; uncomment the following to turn on viper-mode if you are a vi user
; (viper-mode)