Mercurial > hg > xemacs-beta
comparison etc/sample.emacs @ 2:ac2d302a0011 r19-15b2
Import from CVS: tag r19-15b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:35 +0200 |
parents | 376386a54a3c |
children | bcdc7deadc19 |
comparison
equal
deleted
inserted
replaced
1:c0c6a60d29db | 2:ac2d302a0011 |
---|---|
1 ;;; -*- Mode: Emacs-Lisp -*- | 1 ;; -*- Mode: Emacs-Lisp -*- |
2 | 2 |
3 ;;; This is a sample .emacs file. | 3 ;;; This is a sample .emacs file. |
4 ;;; | 4 ;;; |
5 ;;; The .emacs file, which should reside in your home directory, allows you to | 5 ;;; The .emacs file, which should reside in your home directory, allows you to |
6 ;;; customize the behavior of Emacs. In general, changes to your .emacs file | 6 ;;; customize the behavior of Emacs. In general, changes to your .emacs file |
15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
16 ;; Basic Customization ;; | 16 ;; Basic Customization ;; |
17 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 17 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
18 | 18 |
19 ;; Enable the commands `narrow-to-region' ("C-x n n") and | 19 ;; Enable the commands `narrow-to-region' ("C-x n n") and |
20 ;; `eval-expression' ("M-ESC", or "ESC ESC"). Both are useful | 20 ;; `eval-expression' ("M-:", or "ESC :"). Both are useful |
21 ;; commands, but they can be confusing for a new user, so they're | 21 ;; commands, but they can be confusing for a new user, so they're |
22 ;; disabled by default. | 22 ;; disabled by default. |
23 (put 'narrow-to-region 'disabled nil) | 23 (put 'narrow-to-region 'disabled nil) |
24 (put 'eval-expression 'disabled nil) | 24 (put 'eval-expression 'disabled nil) |
25 | 25 |
26 ;;; Define a variable to indicate whether we're running XEmacs/Lucid Emacs. | 26 ;;; Define a variable to indicate whether we're running XEmacs/Lucid Emacs. |
27 ;;; (You do not have to defvar a global variable before using it -- | 27 ;;; (You do not have to defvar a global variable before using it -- |
28 ;;; you can just call `setq' directly like we do for `emacs-major-version' | 28 ;;; you can just call `setq' directly like we do for `emacs-major-version' |
29 ;;; below. It's clearer this way, though.) | 29 ;;; below. It's clearer this way, though.) |
104 ;; 'mode-line-buffer-identification in older XEmacsen. | 104 ;; 'mode-line-buffer-identification in older XEmacsen. |
105 (if (boundp 'modeline-buffer-identification) | 105 (if (boundp 'modeline-buffer-identification) |
106 ;; Note that if you want to put more than one form in the | 106 ;; Note that if you want to put more than one form in the |
107 ;; `THEN' clause of an IF-THEN-ELSE construct, you have to | 107 ;; `THEN' clause of an IF-THEN-ELSE construct, you have to |
108 ;; surround the forms with `progn'. You don't have to | 108 ;; surround the forms with `progn'. You don't have to |
109 ;; do this for the `ELSE' clause. | 109 ;; do this for the `ELSE' clauses. |
110 (progn | 110 (progn |
111 (setq-default modeline-buffer-identification '("XEmacs: %17b")) | 111 (setq-default modeline-buffer-identification '("XEmacs: %17b")) |
112 (setq modeline-buffer-identification '("XEmacs: %17b"))) | 112 (setq modeline-buffer-identification '("XEmacs: %17b"))) |
113 (setq-default mode-line-buffer-identification '("XEmacs: %17b")) | 113 (setq-default mode-line-buffer-identification '("XEmacs: %17b")) |
114 (setq mode-line-buffer-identification '("XEmacs: %17b"))) | 114 (setq mode-line-buffer-identification '("XEmacs: %17b"))) |
115 | 115 |
116 (cond ((or (not (fboundp 'device-type)) | 116 (cond ((or (not (fboundp 'device-type)) |
117 (equal (device-type) 'x)) | 117 (equal (device-type) 'x)) |
118 ;; | |
119 ;; Code which applies only when running emacs under X goes here. | 118 ;; Code which applies only when running emacs under X goes here. |
120 ;; (We check whether the function `device-type' exists | 119 ;; (We check whether the function `device-type' exists |
121 ;; before using it. In versions before 19.12, there | 120 ;; before using it. In versions before 19.12, there |
122 ;; was no such function. If it doesn't exist, we | 121 ;; was no such function. If it doesn't exist, we |
123 ;; simply assume we're running under X -- versions before | 122 ;; simply assume we're running under X -- versions before |
210 '(pointer)) | 209 '(pointer)) |
211 (error nil)) ; returns nil if an error occurred. | 210 (error nil)) ; returns nil if an error occurred. |
212 (set-glyph-image gc-pointer-glyph file)))) | 211 (set-glyph-image gc-pointer-glyph file)))) |
213 | 212 |
214 ;; Add `dired' to the File menu | 213 ;; Add `dired' to the File menu |
215 (add-menu-item '("File") "Edit Directory" 'dired t) | 214 (add-menu-button '("File") ["Edit Directory" dired t]) |
216 | 215 |
217 ;; Here's a way to add scrollbar-like buttons to the menubar | 216 ;; Here's a way to add scrollbar-like buttons to the menubar |
218 (add-menu-item nil "Top" 'beginning-of-buffer t) | 217 (add-menu-button nil ["Top" beginning-of-buffer t]) |
219 (add-menu-item nil "<<<" 'scroll-down t) | 218 (add-menu-button nil ["<<<" scroll-down t]) |
220 (add-menu-item nil " . " 'recenter t) | 219 (add-menu-button nil [" . " recenter t]) |
221 (add-menu-item nil ">>>" 'scroll-up t) | 220 (add-menu-button nil [">>>" scroll-up t]) |
222 (add-menu-item nil "Bot" 'end-of-buffer t) | 221 (add-menu-button nil ["Bot" end-of-buffer t]) |
223 | 222 |
224 ;; Change the behavior of mouse button 2 (which is normally | 223 ;; Change the behavior of mouse button 2 (which is normally |
225 ;; bound to `mouse-yank'), so that it inserts the selected text | 224 ;; bound to `mouse-yank'), so that it inserts the selected text |
226 ;; at point (where the text cursor is), instead of at the | 225 ;; at point (where the text cursor is), instead of at the |
227 ;; position clicked. | 226 ;; position clicked. |
233 | 232 |
234 ;; When editing C code (and Lisp code and the like), I often | 233 ;; When editing C code (and Lisp code and the like), I often |
235 ;; like to insert tabs into comments and such. It gets to be | 234 ;; like to insert tabs into comments and such. It gets to be |
236 ;; a pain to always have to use `C-q TAB', so I set up a more | 235 ;; a pain to always have to use `C-q TAB', so I set up a more |
237 ;; convenient binding. Note that this does not work in | 236 ;; convenient binding. Note that this does not work in |
238 ;; TTY frames. | 237 ;; TTY frames, where tab and shift-tab are indistinguishable. |
239 (define-key global-map '(shift tab) 'self-insert-command) | 238 (define-key global-map '(shift tab) 'self-insert-command) |
240 | 239 |
241 ;; LISPM bindings of Control-Shift-C and Control-Shift-E. | 240 ;; LISPM bindings of Control-Shift-C and Control-Shift-E. |
242 ;; Note that "\C-C" means Control-C, not Control-Shift-C. | 241 ;; Note that "\C-C" means Control-C, not Control-Shift-C. |
243 ;; To specify shifted control characters, you must use the | 242 ;; To specify shifted control characters, you must use the |
451 ;; because the startup code does intelligent things to the | 450 ;; because the startup code does intelligent things to the |
452 ;; 'italic and 'bold faces to ensure that they are different | 451 ;; 'italic and 'bold faces to ensure that they are different |
453 ;; from the default face. For example, if the default face | 452 ;; from the default face. For example, if the default face |
454 ;; is bold, then the 'bold face will be unbold.) | 453 ;; is bold, then the 'bold face will be unbold.) |
455 (copy-face 'italic 'font-lock-comment-face) | 454 (copy-face 'italic 'font-lock-comment-face) |
456 ;; Underling comments looks terrible on tty's | 455 ;; Underlining comments looks terrible on tty's |
457 (set-face-underline-p 'font-lock-comment-face nil 'global 'tty) | 456 (set-face-underline-p 'font-lock-comment-face nil 'global 'tty) |
458 (set-face-highlight-p 'font-lock-comment-face t 'global 'tty) | 457 (set-face-highlight-p 'font-lock-comment-face t 'global 'tty) |
459 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face) | 458 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face) |
460 (set-face-foreground 'font-lock-comment-face "red") | 459 (set-face-foreground 'font-lock-comment-face "red") |
461 | 460 |
540 ;;; MH is a mail-reading system from the Rand Corporation that relies on a | 539 ;;; MH is a mail-reading system from the Rand Corporation that relies on a |
541 ;;; number of external filter programs (which do not come with emacs.) | 540 ;;; number of external filter programs (which do not come with emacs.) |
542 ;;; Emacs provides a nice front-end onto MH, called "mh-e". | 541 ;;; Emacs provides a nice front-end onto MH, called "mh-e". |
543 ;;; | 542 ;;; |
544 ;; Bindings that let you send or read mail using MH | 543 ;; Bindings that let you send or read mail using MH |
545 ;(global-set-key "\C-xm" 'mh-smail) | 544 ;(global-set-key "\C-xm" 'mh-smail) |
546 ;(global-set-key "\C-x4m" 'mh-smail-other-window) | 545 ;(global-set-key "\C-x4m" 'mh-smail-other-window) |
547 ;(global-set-key "\C-cr" 'mh-rmail) | 546 ;(global-set-key "\C-cr" 'mh-rmail) |
548 | 547 |
549 ;; Customization of MH behavior. | 548 ;; Customization of MH behavior. |
550 (setq mh-delete-yanked-msg-window t) | 549 (setq mh-delete-yanked-msg-window t) |
551 (setq mh-yank-from-start-of-msg 'body) | 550 (setq mh-yank-from-start-of-msg 'body) |
552 (setq mh-summary-height 11) | 551 (setq mh-summary-height 11) |