comparison etc/sample.emacs @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 9ee227acff29
children 4103f0995bd7
comparison
equal deleted inserted replaced
15:ad457d5f7d04 16:0293115a14e9
36 36
37 ;; set up the function keys to do common tasks to reduce Emacs pinky 37 ;; set up the function keys to do common tasks to reduce Emacs pinky
38 ;; and such. 38 ;; and such.
39 39
40 ;; Make F1 invoke help 40 ;; Make F1 invoke help
41 (global-set-key 'f1 'help-command) 41 (global-set-key [f1] 'help-command)
42 ;; Make F2 be `undo' 42 ;; Make F2 be `undo'
43 (global-set-key 'f2 'undo) 43 (global-set-key [f2] 'undo)
44 ;; Make F3 be `find-file' 44 ;; Make F3 be `find-file'
45 ;; Note: it does not currently work to say 45 ;; Note: it does not currently work to say
46 ;; (global-set-key 'f3 "\C-x\C-f") 46 ;; (global-set-key 'f3 "\C-x\C-f")
47 ;; The reason is that macros can't do interactive things properly. 47 ;; The reason is that macros can't do interactive things properly.
48 ;; This is an extremely longstanding bug in Emacs. Eventually, 48 ;; This is an extremely longstanding bug in Emacs. Eventually,
49 ;; it will be fixed. (Hopefully ..) 49 ;; it will be fixed. (Hopefully ..)
50 (global-set-key 'f3 'find-file) 50 (global-set-key [f3] 'find-file)
51 51
52 ;; Make F4 be "mark", F5 be "copy", F6 be "paste" 52 ;; Make F4 be "mark", F5 be "copy", F6 be "paste"
53 ;; Note that you can set a key sequence either to a command or to another 53 ;; Note that you can set a key sequence either to a command or to another
54 ;; key sequence. 54 ;; key sequence.
55 (global-set-key 'f4 'set-mark-command) 55 (global-set-key [f4] 'set-mark-command)
56 (global-set-key 'f5 "\M-w") 56 (global-set-key [f5] "\M-w")
57 (global-set-key 'f6 "\C-y") 57 (global-set-key [f6] "\C-y")
58 58
59 ;; Shift-F4 is "pop mark off of stack" 59 ;; Shift-F4 is "pop mark off of stack"
60 (global-set-key '(shift f4) (lambda () (interactive) (set-mark-command t))) 60 (global-set-key '(shift f4) (lambda () (interactive) (set-mark-command t)))
61 61
62 ;; Make F7 be `save-buffer' 62 ;; Make F7 be `save-buffer'
63 (global-set-key 'f7 'save-buffer) 63 (global-set-key [f7] 'save-buffer)
64 64
65 ;; Make F8 be "start macro", F9 be "end macro", F10 be "execute macro" 65 ;; Make F8 be "start macro", F9 be "end macro", F10 be "execute macro"
66 (global-set-key 'f8 'start-kbd-macro) 66 (global-set-key [f8] 'start-kbd-macro)
67 (global-set-key 'f9 'end-kbd-macro) 67 (global-set-key [f9] 'end-kbd-macro)
68 (global-set-key 'f10 'call-last-kbd-macro) 68 (global-set-key [f10] 'call-last-kbd-macro)
69 69
70 ;; Here's an alternative binding if you don't use keyboard macros: 70 ;; Here's an alternative binding if you don't use keyboard macros:
71 ;; Make F8 be `save-buffer' followed by `delete-window'. 71 ;; Make F8 be `save-buffer' followed by `delete-window'.
72 ;;(global-set-key 'f8 "\C-x\C-s\C-x0") 72 ;;(global-set-key 'f8 "\C-x\C-s\C-x0")
73 73
95 kill-whole-line t 95 kill-whole-line t
96 ) 96 )
97 97
98 ;; When running ispell, consider all 1-3 character words as correct. 98 ;; When running ispell, consider all 1-3 character words as correct.
99 (setq ispell-extra-args '("-W" "3")) 99 (setq ispell-extra-args '("-W" "3"))
100
101 ;; Change the way the buffer name is displayed in the
102 ;; modeline. The variable for this is called
103 ;; 'modeline-buffer-identification but was called
104 ;; 'mode-line-buffer-identification in older XEmacsen.
105 (if (boundp 'modeline-buffer-identification)
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
108 ;; surround the forms with `progn'. You don't have to
109 ;; do this for the `ELSE' clauses.
110 (progn
111 (setq-default modeline-buffer-identification '("XEmacs: %17b"))
112 (setq modeline-buffer-identification '("XEmacs: %17b")))
113 (setq-default mode-line-buffer-identification '("XEmacs: %17b"))
114 (setq mode-line-buffer-identification '("XEmacs: %17b")))
115 100
116 (cond ((or (not (fboundp 'device-type)) 101 (cond ((or (not (fboundp 'device-type))
117 (equal (device-type) 'x)) 102 (equal (device-type) 'x))
118 ;; Code which applies only when running emacs under X goes here. 103 ;; Code which applies only when running emacs under X goes here.
119 ;; (We check whether the function `device-type' exists 104 ;; (We check whether the function `device-type' exists